http://stackoverflow.com/q/27843258
answer count: 1
tagged with: node.js
tagged with: gmail
upvote count: 2
has answer: http://stackoverflow.com/a/27843898
score: 2
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/27843898
has body: I am using nodemailer with gmail and I need to include my password somehow. The issue is that my password contains both single and double quotes. e.g. my"annoying'password. I've tried to escape either of the quotes, but Google refuses my password. "my\"annoying'password" 'my"annoying\'password' I can login just fine, but I can't use it in my script. Here is the code creating the mailer object. var mailer = email.createTransport({ service : "gmail", auth : { user : "myemail@gmail.com", // neither of these work password : "my\"annoying'password", // password : 'my"annoying\'password', } }); Is this possible or am I going to have to change my password? UPDATE The error I get is: [Error: Invalid login] code: 'EAUTH', response: '535-5.7.8 Username and Password not accepted.
has title: Password trouble in nodemailer and node
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44091009
tagged with: nodemailer
has comment: http://stackoverflow.com/comment/44090466
has comment: http://stackoverflow.com/comment/44090282

http://stackoverflow.com/comment/44107789
has text: Did you check their documentation? I don't see ISO8601 duration parsing there http://momentjs.com/docs/#/parsing/
comment on: http://stackoverflow.com/q/27851832
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/27957376
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44309425
type: UnansweredQuestion
has body: I have my date coming from server in the form of Date.now() and stored in order.date &lt;input type="date" data-ng-model="order.date" id="date" name="date" min="2013-01-01" max="2020-12-31" required/&gt; Currently order.date is sent by server and stores in the form Date.now(). Even when order.date is valid, it shows dd/mm/yy as placeholder. It works well when order.date is set with order.date = new Date(2013, 9, 22) but not order.date = Date.now(); It can also be tested in http://plnkr.co/edit/sl9OlHSNRPo2LXzupOxT?p=preview.
tagged with: date
type: Question
has answer: http://stackoverflow.com/a/27957490
has answer: http://stackoverflow.com/a/27957674
tagged with: javascript
has title: Date.now() not shown in placeholder date type in form - angularjs
has comment: http://stackoverflow.com/comment/44309320
score: 0
has comment: http://stackoverflow.com/comment/44309490
answer count: 3
has answer: http://stackoverflow.com/a/27957706
has comment: http://stackoverflow.com/comment/44309330

http://stackoverflow.com/comment/44272306
score: 1
has text: use like below 'name_button.style.marginLeft = '125px';' 'name_button.style.paddingRight = '0px';'
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27937671

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

http://stackoverflow.com/comment/44141226
type: AnswerComment
has text: The hacky thing is to use `.indexOf()` to cut certain parts of the resulting string, instead of using native formatting abilities. Especially when `toLocaleString()` formats differently across all computers.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27868938

http://stackoverflow.com/a/27920454
has comment: http://stackoverflow.com/comment/44243031
has comment: http://stackoverflow.com/comment/44238470
type: Answer
has comment: http://stackoverflow.com/comment/44238331
has comment: http://stackoverflow.com/comment/44238361
upvote count: 3
has comment: http://stackoverflow.com/comment/44238687
has comment: http://stackoverflow.com/comment/44238289
has body: Sure it is, shouldn't even be very hard, just submit the form with ajax and show the result in a dialog $('form').on('submit', function(e) { e.preventDefault(); $.ajax({ url : $(this).attr('action'), type : $(this).attr('method'), data : $(this).serialize() }).done(function(data) { $('#dialog').html(data).dialog(settings); }); });
downvote count: 0
answers question: http://stackoverflow.com/q/27920387
score: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27920387
has comment: http://stackoverflow.com/comment/44238408

http://stackoverflow.com/comment/44106234
has text: What's `i` at the point of the first call? And are you sure `pinArray` is defined, initialized, and in scope at that time? Any errors in the Javascript console?
score: 3
comment on: http://stackoverflow.com/q/27851053
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27941080
downvote count: 0
score: 1
has body: You need a couple of functions here to convert your "DOM" implementation to a standard XML DOM - one to create the document and another to recursively create elements: // create a document based on a Node instance function toXmlDom(node) { // create a document var doc = document.implementation.createDocument('', ''); // convert the root node var e = toXmlElement(doc, node); // add root to document doc.appendChild(e); return doc; } // convert a Node and its children to an XML element function toXmlElement(doc, node) { // create an element var e = doc.createElement(node.nodeName); // set its attributes for(var i = 0; i < node.attributes.length; i++) { var attr = node.attributes[i]; e.setAttribute(attr.name, attr.value); } // set its text content e.textContent = node.textContent; // convert and add its child nodes for(var i = 0; i < node.childrenNodes.length; i++) { var childrenNode = node.childrenNodes[i]; var childNode = toXmlElement(doc, childrenNode); e.appendChild(childNode); } return e; } // do the conversion var myDocument = toXmlDom(root); Working Example console.clear(); function Attribute(name, value) { this.name = name; this.value = value; } function Node(nodeName) { this.nodeName = nodeName; this.textContent = ""; this.childrenNodes = []; this.attributes = []; } function toXmlDom(node) { // create a document var doc = document.implementation.createDocument('', ''); // convert the root node var e = toXmlElement(doc, node); // add root to document doc.appendChild(e); return doc; } function toXmlElement(doc, node) { // create an element var e = doc.createElement(node.nodeName); // set its attributes for(var i = 0; i < node.attributes.length; i++) { var attr = node.attributes[i]; e.setAttribute(attr.name, attr.value); } // set its text content e.textContent = node.textContent; // convert and add its child nodes for(var i = 0; i < node.childrenNodes.length; i++) { var childrenNode = node.childrenNodes[i]; var childNode = toXmlElement(doc, childrenNode); e.append…
has comment: http://stackoverflow.com/comment/44281201
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27940143
answers question: http://stackoverflow.com/q/27940143
type: AcceptedAnswer

http://stackoverflow.com/comment/44190364
type: Comment
has text: Probably wrong quoting is not the only error, I would recommend to step through the code one line after the other. I assume `$(numeMeci).text()` should be `$('#' + numeMeci).text()` if thats an ID ...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27894506

http://stackoverflow.com/comment/44272580
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27937981
has text: still it is saying undefined
score: 0

http://stackoverflow.com/q/27875189
accepted answer: http://stackoverflow.com/a/27875318
score: 0
has title: Angular passing parameters
possible better answer: http://stackoverflow.com/a/27875326
has answer: http://stackoverflow.com/a/27875326
answer count: 4
tagged with: angularjs
has body: I am trying to learn AngularJs and I have this code shown in the image below from a course am watching. the author is doing $http.get("url").then(function()... . What I don't understand is that onUserComplete function accepts response parameter, but in the then function, he's not passing this response parameter, and the example works. From what I understand in JavaScript is that we should do like: then(onUserComplete(response)) ; Can anyone exaplain it to me?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27875309
has answer: http://stackoverflow.com/a/27875318
type: Question
has answer: http://stackoverflow.com/a/27875305
tagged with: javascript

http://stackoverflow.com/comment/44297870
has text: 'urls' it's a simple array of objects. Sorry @JohnSaunders didn't know that
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27951005

http://stackoverflow.com/comment/44142097
comment on: http://stackoverflow.com/a/27869255
has text: No errors - it simply doesn't respond to any saved changes. When i startup the server, it does see Watchman now.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/67956243
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/36623117
has text: @Paulos3000 Express actually makes this very simple. Just make sure you add something to this effect as the last handler: `app.use('*', function(req, res, next) {res.send('<DOCTYPE html ....')});`

http://stackoverflow.com/a/27847197
has comment: http://stackoverflow.com/comment/44098474
has comment: http://stackoverflow.com/comment/44098977
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44098292
has body: Each contractor in ContractorList should have the whole properties that you want later in your if bindings. // where 'x' is a property of each contractor: 1 2 These properties might be added using Array.prototype.forEach in your view model source code like this: var myViewModel = function() { // I'm sure you're populating this from a JSON source or who knows... this.ContractorList = ko.observableArray(); // or ko.observableArray([{}, {}, {}})... this.ContractorList.forEach(function(contractor) { // It's just a sample, you should set whatever you want in a property that you want // to use in an 'if' binding contractor.x = 1; }); };
has comment: http://stackoverflow.com/comment/44098558
has comment: http://stackoverflow.com/comment/44099478
answers question: http://stackoverflow.com/q/27846931

http://stackoverflow.com/q/27913266
downvote count: 1
type: Question
has title: Tweak D3 calendar view example to be vertical with days be ordered left to right, then top to bottom?
tagged with: javascript
score: 0
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/27930327
tagged with: d3.js
type: AnsweredQuestion
has body: See original gallery example: http://bl.ocks.org/mbostock/4063318 The way the example works, the days are ordered top to bottom, then left to right. Hover over them to see what I mean. What I want is something more like a regular vertical calendar, where the months are stacked vertically on top of each other and the days are numbered left to right, then top to bottom. See mock up: Rotating the entire month stack is not too bad but I'm tripping up on SVG drawing the edge cases involved from months not having all having the same number of days. Anybody willing to to alter the layout algorithm to do it this way?
upvote count: 1
accepted answer: http://stackoverflow.com/a/27930327

http://stackoverflow.com/comment/44276290
type: QuestionComment
type: Comment
has text: @Juhana I have a file that provides helper functionality to an Angular ViewModel. Arguably it could be written as a directive but I didn't write the code, another developer did, and I don't have time to completely rewrite it & test it. I was just updating it be inside a function block (as I had related MVC bundling issues) when I realised I didn't know the best practice in this situation
score: 0
comment on: http://stackoverflow.com/q/27939873

http://stackoverflow.com/a/27809031
has comment: http://stackoverflow.com/comment/44028013
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44030841
has body: My recommendation is to use localStorage, this way you can AJAX the data in so it doesn't impact initial page load. Once cached on the client, you are free to use it as you please. Also, you might need to add a way to keep checking for your array. You can check to see if it exists, and AJAX it in again if it doesn't. Local storage can be removed by the browser at any point in time. Another alternative is to put in a JavaScript web resource that gets cached in the browser. You use &lt;script&gt; tags to bring it in. This file will declare the global array in your application. There is an async attribute available to have it load asynchronously. The downside here is figuring out when your array becomes available.
answers question: http://stackoverflow.com/q/27808610
downvote count: 0
score: 1

http://stackoverflow.com/a/27876140
downvote count: 0
score: 1
has body: adding x+y and giving random deg var originalBG = $(".gradient").css("background"); $('.gradient') .mousemove(function(e) { x = e.pageX - this.offsetLeft; y = e.pageY - this.offsetTop; xy = x + y; bgWebKit = "linear-gradient(" + xy + "deg, #4ac1ff, #795bb0)"; $(this).css({ 'background': bgWebKit }) }).mouseleave(function() { $(this).css({ background: originalBG }); }); * { margin: 0; padding: 0; } html { height: 100%; } body { background-color: #292c2f; font-family: monospace; overflow: hidden; } .gradient { height: calc(100%); background: -webkit-linear-gradient(270deg, #4ac1ff, #795bb0); background: -moz-linear-gradient(270deg, #4ac1ff, #795bb0); background: -o-linear-gradient(270deg, #4ac1ff, #795bb0); background: -ms-linear-gradient(270deg, #4ac1ff, #795bb0); background: linear-gradient(180deg, #4ac1ff, #795bb0); position: absolute; width: 100%; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="gradient"&gt;&lt;/div&gt;
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27875703

http://stackoverflow.com/comment/44218483
type: Comment
type: QuestionComment
score: 0
has text: @ShirgillAnsari I meant that, you didn't miss anything from the book.
comment on: http://stackoverflow.com/q/27909353

http://stackoverflow.com/comment/44203838
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27901506
score: 0
has text: @anpsmn Sorry about that, a typo when changing names to create the JSBin example. Each list is created with the whatever_list_element var created just the line above. I'm using https://github.com/RubaXa/Sortable

http://stackoverflow.com/a/27885582
has body: You should use another $.each() loop: $.each(data, function (key, val) { $.each(val, function (key, elem) { $('ul').append('&lt;li id="' + key + '"&gt;' + elem.active + ' ' + elem.event_id + '&lt;/li&gt;'); }); }); When you loop on an array which has some objects then in the callback function (key, val) key is not the actual key name but the index of the object. So if you want to get the key name of the object then you have to loop it again to the each object in the array, now this time you get the key names with the param key in the callback. [{},{}] in this case first loop will get you the index of the each object so it will return you the index like 0, 1. Then if you apply another loop in then now you are trying to loop in to a js object {} in this case the key param of the callback will give the actual key names used in the each object.
type: Answer
has comment: http://stackoverflow.com/comment/44177937
has comment: http://stackoverflow.com/comment/44172507
answers question: http://stackoverflow.com/q/27885561
has comment: http://stackoverflow.com/comment/44172445
score: 0

http://stackoverflow.com/a/27865569
upvote count: 4
type: AcceptedAnswer
has body: I think it's just a matter of invalid HTML. Here is an updated JSFiddle with working behaviour. &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"&gt; &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"&gt;&lt;/script&gt; The modal dosnt come up after clicking on "edit". you have to click Action once again for it to come up &lt;div class="bs-example"&gt; &lt;form&gt; &lt;!--Default buttons with dropdown menu--&gt; &lt;div class="btn-group"&gt; &lt;button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle"&gt;Action &lt;span class="caret"&gt;&lt;/span&gt;&lt;/button&gt; &lt;ul class="dropdown-menu"&gt; &lt;li&gt;&lt;a href="#myModal" data-toggle="modal"&gt;edit&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;div id="myModal" class="modal fade"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Confirmation&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;p&gt;Do you want to save changes you made to document before closing?&lt;/p&gt; &lt;p class="text-warning"&gt;&lt;small&gt;If you don't save, your changes will be lost.&lt;/small&gt;&lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27865368
score: 4
answers question: http://stackoverflow.com/q/27865368

http://stackoverflow.com/comment/44100205
has text: This sounds more like an Ajax issue than JSP. You're loading the panel with Ajax right?
comment on: http://stackoverflow.com/q/27848027
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44234835
type: AnswerComment
comment on: http://stackoverflow.com/a/27918381
type: Comment
has text: I have just put your piece of code to `$(document).ready(function(){});` function,
score: 0

http://stackoverflow.com/comment/44064316
type: Comment
has text: I was curious... `console.log('http://ab%s', 'c')` works as "expected" and makes a clickable link (`http://abc`), but `console.log('http://ab%s')` breaks the console. :-)
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27828804

http://stackoverflow.com/q/27948912
favorite count: 0
upvote count: 2
tagged with: css
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27960792
type: Question
has body: I am attempting to make a psuedo-parallax site. I am using the Scrollmagic jquery plugin. My background animations are working fine, but I am having issues with the first text box (living in the grey bar). I have it set to start at opacity:1 and tween to opacity:0. When I load the page, the div container already seems to have the opacity set to .5. What am I doing wrong? I've tried adjusting the duration in TweenMax.to to .5 and I've seen no difference how .text-background is tweening. The codepen is available here: http://codepen.io/anon/pen/vExZPR Thank you. We offer a full line of EPA approved enclosed combustors that meet the ever-changing requirements of today’s regulation-filled oil and gas industry. Are you in compliance with the latest EPA tank emission regulations? ... Are you in compliance with the latest EPA tank emission regulations? ... Are you in compliance with the latest EPA tank emission regulations? ... Are you in compliance with the latest EPA tank emission regulations? ... Are you in compliance with the latest EPA tank emission regulations? ...
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: scrollmagic
has title: Tweening opacity of text box with Scrollmagic
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27960792

http://stackoverflow.com/a/27951484
type: Answer
has comment: http://stackoverflow.com/comment/44323189
score: 0
has comment: http://stackoverflow.com/comment/44318708
has body: Here is an issue: if ((usr==username) &amp;&amp; (psw=password)) { Notice the single = sign? This means you are assigning, and not comparing. if ((usr==username) &amp;&amp; (psw==password)) { Change to the above and see if it works then.
has comment: http://stackoverflow.com/comment/44298562
answers question: http://stackoverflow.com/q/27951436
has comment: http://stackoverflow.com/comment/44298578

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/27956407
tags question: http://stackoverflow.com/q/27923635
tags question: http://stackoverflow.com/q/27919952
tags question: http://stackoverflow.com/q/27843530
tags question: http://stackoverflow.com/q/27940047
tags question: http://stackoverflow.com/q/27846647
tags question: http://stackoverflow.com/q/27924066
tags question: http://stackoverflow.com/q/27886280
tags question: http://stackoverflow.com/q/27953555
tags question: http://stackoverflow.com/q/27957427
tags question: http://stackoverflow.com/q/27862046
tags question: http://stackoverflow.com/q/27911547
tags question: http://stackoverflow.com/q/27904502
tags question: http://stackoverflow.com/q/27960226
tags question: http://stackoverflow.com/q/27924557
tags question: http://stackoverflow.com/q/27825538
tags question: http://stackoverflow.com/q/27948585
tags question: http://stackoverflow.com/q/27947815
tags question: http://stackoverflow.com/q/27912726
tags question: http://stackoverflow.com/q/27840873
tags question: http://stackoverflow.com/q/27902521
tags question: http://stackoverflow.com/q/27913873
tags question: http://stackoverflow.com/q/27834806
tags question: http://stackoverflow.com/q/27806415
tags question: http://stackoverflow.com/q/27825788
tags question: http://stackoverflow.com/q/27826615
tags question: http://stackoverflow.com/q/27947984
tags question: http://stackoverflow.com/q/27812234
tags question: http://stackoverflow.com/q/27948912
tags question: http://stackoverflow.com/q/27810521
tags question: http://stackoverflow.com/q/27869419
tags question: http://stackoverflow.com/q/27897151
tags question: http://stackoverflow.com/q/27884967
tags question: http://stackoverflow.com/q/27859273
tags question: http://stackoverflow.com/q/27880927
tags question: http://stackoverflow.com/q/27832350
tags question: http://stackoverflow.com/q/27837100
tags question: http://stackoverflow.com/q/27821701
tags question: http://stackoverflow.com/q/27889867
tags question: http://stackoverflow.com/q/27821961
tags question: http://stackoverflow.com/q/27809272
tags question: http://stackoverflow.com/q/27875272
tags question: http://stackoverflow.com/q/27822665
tags question: http://stackoverflow.com/q/27838977
tags question: http://stackoverflow.com/q/27912510
tags question: http://stackoverflow.com/q/27962742
tags question: http://stackoverflow.com/q/27947824
tags question: http://stackoverflow.com/q/27944065
tags question: http://stackoverflow.com/q/27864081
tags question: http://stackoverflow.com/q/27916253
tags question: http://stackoverflow.com/q/27829141
tags question: http://stackoverflow.com/q/27953449
tags question: http://stackoverflow.com/q/27925655
tags question: http://stackoverflow.com/q/27949506
tags question: http://stackoverflow.com/q/27887657
tags question: http://stackoverflow.com/q/27851150
tags question: http://stackoverflow.com/q/27927261
tags question: http://stackoverflow.com/q/27917974
tags question: http://stackoverflow.com/q/27841206
tags question: http://stackoverflow.com/q/27871537
tags question: http://stackoverflow.com/q/27902060
tags question: http://stackoverflow.com/q/27822414
tags question: http://stackoverflow.com/q/27808462
tags question: http://stackoverflow.com/q/27910917
tags question: http://stackoverflow.com/q/27917966
tags question: http://stackoverflow.com/q/27810418
tags question: http://stackoverflow.com/q/27841464
tags question: http://stackoverflow.com/q/27953581
tags question: http://stackoverflow.com/q/27932127
tags question: http://stackoverflow.com/q/27930995
tags question: http://stackoverflow.com/q/27844366
tags question: http://stackoverflow.com/q/27905858
tags question: http://stackoverflow.com/q/27849944
tags question: http://stackoverflow.com/q/27875091
tags question: http://stackoverflow.com/q/27849231
tags question: http://stackoverflow.com/q/27955674
tags question: http://stackoverflow.com/q/27835344
tags question: http://stackoverflow.com/q/27821683
tags question: http://stackoverflow.com/q/27831314
tags question: http://stackoverflow.com/q/27821262

http://stackoverflow.com/comment/44102227
type: QuestionComment
comment on: http://stackoverflow.com/q/27849109
score: 0
has text: Just thinking... have you triedto add a `event.preventDefault()` inside the `mypng(event){` function?
type: Comment

http://stackoverflow.com/q/27809549
tagged with: javascript
answer count: 3
downvote count: 0
possible better answer: http://stackoverflow.com/a/27809658
favorite count: 0
has answer: http://stackoverflow.com/a/27844618
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27809630
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27809658
has answer: http://stackoverflow.com/a/27809630
type: Question
has body: I have these dropdown forms and I am looking for a way to slide them back up whenever i click on anywhere outside of the forms. My javascript code is as below: $(document).ready( function(){ $('#login-trigger').click( function(){ $(this).next('#login-content').slideToggle(); }) }); $(document).ready(function() { $('#signup-trigger').click( function(){ $(this).next('#signup-content').slideToggle(); }) }); My main reason for needing this function is so the two forms wouldnt be open at the same time or with any other dropdown list I add later
has title: drop down logon in html

django-models
tag name: django-models
tags question: http://stackoverflow.com/q/27856867
type: Tag

http://stackoverflow.com/comment/44236690
score: 0
type: AnswerComment
has text: Please add the name of the formula in the answer, it's not clear why this formula is cited.
comment on: http://stackoverflow.com/a/27919425
type: Comment

http://stackoverflow.com/comment/44162101
comment on: http://stackoverflow.com/q/27880171
score: 0
type: Comment
type: QuestionComment
has text: @Kelsadita Yes, my condition is true

http://stackoverflow.com/q/27842083
has title: fullCalendar renderEvent not sticking
type: UnansweredQuestion
type: Question
has body: I'm trying to insert an event to my fullcalendar and let it be there when i refresh the page but it's disappeared for some reason. &lt;script&gt; $(document).ready(function() { // page is now ready, initialize the calendar... $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,basicWeek,basicDay' }, selectable: true, selectHelper: true, select: function(start, end) { var title = prompt('Event Title:'); var eventData; if (title) { eventData = { title: title, start: start, end: end }; $('#calendar').fullCalendar('renderEvent', eventData, true); } $('#calendar').fullCalendar('unselect'); }, }) }); &lt;/script&gt; I have try to change the code as well so it look samthing like this if (title) { calendar.fullCalendar('renderEvent', { title: title, start: start, end: end, allDay: allDay }, true ); } calendar.fullCalendar('unselect'); }, but i just got nothing on the page like i missing something
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27845833
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44088247

http://stackoverflow.com/comment/44039399
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27816572
has text: yes. Example - Create a facebook accoutn from my website. I'll show the same form to the user. But in my style and in my web page. I'll let the user know that another account is automatically using the same information. Along side my website account
score: 0

http://stackoverflow.com/comment/44222524
type: Comment
comment on: http://stackoverflow.com/a/27911094
type: AnswerComment
has text: Good catch, Scott, fixed.
score: 0

http://stackoverflow.com/comment/44232367
comment on: http://stackoverflow.com/q/27916977
score: 0
type: Comment
type: QuestionComment
has text: Thanks for the -1;) What happens.. Okay, in getlist.php there is a javascript datepicker, wich turns the value of the picked date into a php variable. to get to the datepicker user have to click on a button, he will have a popup and can choose his date by using javascript datepicker

http://stackoverflow.com/q/27858192
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44149346
has comment: http://stackoverflow.com/comment/44132851
tagged with: google-maps
has body: Hi I am trying to set marker icon in Google Map using javascript. My image is in Images.xcassets. Right now I am doing this to set icon. But its not working for me. What I am doing is this: setMarkerWithIcon('/Images/MapScreen/MapviewIcon/MapviewIcon'); function initialize(latitude, longitude, maxzoom) { var styles = [{ elementType: "labels", stylers: [ { visibility: "off" } ] }]; var styledMap = new google.maps.StyledMapType(styles, {name: "Styled Map"}); var mapOptions = { zoom: initialZoomLevel, center: new google.maps.LatLng(latitude + LatLngDeltas[ randomIntFromInterval(0, LatLngDeltas.length) ], longitude + LatLngDeltas[ randomIntFromInterval(0, LatLngDeltas.length) ] ), disableDefaultUI: true, disableDoubleClickZoom: false, minZoom: initialZoomLevel, maxZoom: maxzoom, scrollwheel: false, scaleControl: false, rotateControl:true, rotateControlOptions: { position: google.maps.ControlPosition.LEFT_CENTER }, mapTypeControl: false, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style'] } }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); map.mapTypes.set('map_style', styledMap); map.setMapTypeId('map_style'); google.maps.event.addListener(map, 'click', function(event) { addMarker(map, event.latLng); }); } function addMarker(mapObject, location) { deleteMarkers(); var marker = new google.maps.Marker({ position: location, draggable:true, animation: google.maps.Animation.DROP, map: mapObject, icon:markerPath }); setTimeout(function() {infowindow.open(mapObject,marker);}, 500); google.maps.event.addListener(marker, 'click', function() { infowindow.open(mapObject,marker); }); markers.push(marker); } function setMarkerWithIcon(myIcon) { markerPath = myIcon; } Any help is highly appreciated.
tagged with: ios
tagged with: javascript
tagged with: google-maps-api-3
score: 0
has title: Place Google Map Marker icon using javascript taking images from Image asset in iOS
answer count: 0

http://stackoverflow.com/q/27889337
tagged with: gruntjs
score: 0
has title: Creating bower projects that have dependencies
accepted answer: http://stackoverflow.com/a/27889448
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44180032
tagged with: bower
tagged with: node.js
type: AnsweredQuestion
has body: I am creating a javascript client side library which I will make available via Bower and depends on two other libraries, one that is available via Bower (https://github.com/abritinthebay/datejs) and another that is available only via npm (https://github.com/fent/randexp.js). I am concerned about how the users of my library would go about using it. My doubts and fears are: how can I declare the second library as a dependency of my library when it's only available via npm? after the user installs my library, will he/she have to be aware of the dependencies and manually include the corresponding javascript files in their index.html? I am aware of grunt-bower-install solving this issue, but I'm concerned about people who don't even use grunt at all. would it be so bad if I just gave up on all of this and included the code of said libraries in my own code? (bonus round): I want my library to be available as an AngularJS service, as a node.js module, and as a 'normal' javascript function. Is there a way for me to achieve this using only one repository or do I have to create 3 separate projects?
type: Question
has answer: http://stackoverflow.com/a/27889448
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44176630
comment on: http://stackoverflow.com/q/27887840
score: 4
has text: Appendchild requires a node (element object), you are passing a string. Use `a.innerHTML = bodyContent` Kind of what the error is saying to you.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44238162
type: Comment
has text: When you say functions, you mean `exposedFunction` ?
type: QuestionComment
comment on: http://stackoverflow.com/q/27920351
score: 0

http://stackoverflow.com/comment/44219108
score: 0
type: Comment
type: QuestionComment
has text: The [Enigma Example](http://http://enigmaco.de/enigma/enigma.swf) is right here.
comment on: http://stackoverflow.com/q/27909856

http://stackoverflow.com/comment/44235102
comment on: http://stackoverflow.com/q/27918439
type: QuestionComment
type: Comment
has text: There is no `needlehay` in your `haystack`
score: 0

http://stackoverflow.com/comment/44192490
type: Comment
type: QuestionComment
has text: http://jsfiddle.net/ you post your code and share :)
score: 0
comment on: http://stackoverflow.com/q/27895742

http://stackoverflow.com/q/27804833
upvote count: 1
has comment: http://stackoverflow.com/comment/44019701
accepted answer: http://stackoverflow.com/a/27806020
type: AnsweredQuestion
downvote count: 3
has comment: http://stackoverflow.com/comment/44019572
has body: Kind of a nebulus subject I know. I have a "cart" build in Javascript. My example is on JSFIDDLE. In my example, there is a list of input boxes on the left column in the HTML output controlled by a '+' and '-' buttons. The values increase and decrease accordingly. In the right column the values are limited by what get's inputted on the left. This is the 'Product' At the bottom of the output you will see the "Cart". I am appending items to the "Cart" based off of the 'Product' selections. I would like that IF the 'Product' items are similar, then I just need to output the index or the amount, like a cart would. So in my instance, if there are 2 of the same product in the cart, put the amount of 2 next the list item. var increment; var $InputValue = $('.ProductDetailPage').find("input[data-attendee='" + gaData + "']"); $InputValue.each(function (index) { var oldThisVal = $(this).attr("value"); var newThisVal = oldThisVal; var newBoxValInc = parseFloat(oldThisVal) + 1; var newBoxValDec = parseFloat(oldThisVal) + 1; var parentSection = $(this).parents("section").attr("id"), productname = $(this).parents("section").find('h2').text(), $list = $(this).parents("section").find(".CartList ul"), //[data-attendee='" + gaData + "'] attendee = $(this).data("attendee"), attendeeprice = $(this).data("attendeeprice"), li = '&lt;li class="animated bounceIn ' + attendee + parentSection + ' item' + $(this).val() + '"&gt;&lt;span class="itemName"&gt;' + productname + '&lt;/span&gt;&lt;span class="attendeeType"&gt; ' + attendee + '&lt;/span&gt;&lt;span class="itemPrice"&gt; $' + attendeeprice + '&lt;/span&gt;&lt;/li&gt;'; if ($button.text() == "+") { increment = true; } else { increment = false; } if ($(this).val() &gt; 0 &amp;&amp; increment == true) { $list.append(li); var listItemsCount = li.length; } else { $list.find("li." + attendee + parentSection).last().remove(); } EDIT: ADDED EXPLANATION OF DESIRED OUTPUT So my right now the code above only appends items to a list like so: Adul…
type: Question
has title: Appending items to a list using jQuery but use index if items are the same using Javascript
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44018808
has answer: http://stackoverflow.com/a/27806020
answer count: 1
score: -2
favorite count: 0

http://stackoverflow.com/comment/44073807
comment on: http://stackoverflow.com/q/27833691
has text: @slebetman Prototypes are objects. Read the following answer to understand how prototypal inheritance in JavaScript works: http://stackoverflow.com/a/8096017/783743
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44258793
comment on: http://stackoverflow.com/q/27930543
type: QuestionComment
has text: Is your variable "postData" in the format expected by $http.post function?
type: Comment
score: 0

http://stackoverflow.com/comment/44229164
type: AnswerComment
has text: So what's your advice? Avoid performance improvements just because you have too much other computation? What are you getting at?
type: Comment
comment on: http://stackoverflow.com/a/27914806
score: 0

http://stackoverflow.com/a/27950313
upvote count: 2
has comment: http://stackoverflow.com/comment/44296215
has body: Make sure you are using the HTML5 audio element, and that it does not have the autoplay attribute set. This should work: var playCount = localStorage.getItem('playCount') || 0; if (playCount &lt; 3) { document.getElementById('audio').play(); localStorage.setItem('playCount', playCount + 1); }
type: Answer
has comment: http://stackoverflow.com/comment/44295988
score: 2
has comment: http://stackoverflow.com/comment/44296184
downvote count: 0
has comment: http://stackoverflow.com/comment/44296123
has comment: http://stackoverflow.com/comment/44295951
answers question: http://stackoverflow.com/q/27949301

http://stackoverflow.com/comment/44159526
comment on: http://stackoverflow.com/q/27878940
type: Comment
type: QuestionComment
has text: Why is spacebar allowed, but not click?
score: 1

http://stackoverflow.com/comment/44279910
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27940966
has text: @HiroakiMachida I've edited the question already. Hope that it's clear

http://stackoverflow.com/q/27891121
type: Question
has answer: http://stackoverflow.com/a/27892067
has answer: http://stackoverflow.com/a/27891599
has body: I have a UI Router defined something like this (trimmed for simplicity): $stateProvider .state('someState', { resolve: { model: ['modelService', 'info', function (modelService, info) { return modelService.get(info.id).$promise; }] }, controller: 'SomeController' }); This someState state is using a factory / service that is dependent on that model resolve. It's defined something like this, and AngularJS throws an Unknown provider: modelProvider &lt;- model &lt;- someService error here: angular .module('someModule') .factory('someService', someService); someService.$inject = ['model']; function someService(model) { ... } However, using the same model resolve inside of this state's controller works fine: SomeController.$inject = ['model']; function SomeController(model) { ... } So I'm understanding that UI Router is delaying the DI of the SomeController until the resolve is happening, which allows AngularJS to not throw an error. However, how come the same delay is not happening when putting that resolve as a dependency on someService? Do resolves only work on controllers? And if that is the case, how can I use a resolve inside a factory / service?
downvote count: 0
possible better answer: http://stackoverflow.com/a/27891282
tagged with: javascript
linked to: http://stackoverflow.com/q/15666048
has answer: http://stackoverflow.com/a/27891282
favorite count: 0
answer count: 3
upvote count: 6
accepted answer: http://stackoverflow.com/a/27891599
tagged with: angularjs
score: 6
has title: AngularJS UI Router using resolved dependency in factory / service
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44183605
tagged with: angular-ui-router

http://stackoverflow.com/comment/44318461
type: QuestionComment
comment on: http://stackoverflow.com/q/27962538
score: 0
has text: Thank you !!! Please write it as answer so I can mark it as 'answered'. @DontVoteMeDown
type: Comment

http://stackoverflow.com/q/27897176
has comment: http://stackoverflow.com/comment/44194854
linked to: http://stackoverflow.com/q/566203
has answer: http://stackoverflow.com/a/27897262
linked to: http://stackoverflow.com/q/24885300
has comment: http://stackoverflow.com/comment/44194778
answer count: 3
has body: Like everyone knows we can style an element using CSS like below #a { background-color : green; } And using JS document.getElementById('a').style.backgroundColor = "green"; But I would like to create some property like background-color and that can be used inside CSS. For example I will create a property like "foobar" then I should be able to use it like below #a { foobar : value; } Is this possible? I would like to execute some JS on the element that includes this property. Answers in the question referred to as a duplicate were how to create new CSS and add it to the style sheets using existing CSS properties. But here I am trying to create my own css property...
has comment: http://stackoverflow.com/comment/44194694
has comment: http://stackoverflow.com/comment/44194685
has comment: http://stackoverflow.com/comment/44194735
favorite count: 0
has title: Create CSS styling properties using JavaScript
has comment: http://stackoverflow.com/comment/44194721
has comment: http://stackoverflow.com/comment/44194749
score: 0
has comment: http://stackoverflow.com/comment/44194674
has comment: http://stackoverflow.com/comment/44194751
has answer: http://stackoverflow.com/a/27897265
tagged with: css
type: AnsweredQuestion
upvote count: 5
downvote count: 5
has comment: http://stackoverflow.com/comment/44194673
has comment: http://stackoverflow.com/comment/44194695
type: Question
has answer: http://stackoverflow.com/a/27899139
has comment: http://stackoverflow.com/comment/44194706
accepted answer: http://stackoverflow.com/a/27897265
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27897262

http://stackoverflow.com/a/27898172
type: Answer
answers question: http://stackoverflow.com/q/27898118
score: 0
has comment: http://stackoverflow.com/comment/44196482
has comment: http://stackoverflow.com/comment/44196462
has body: Wirte following code in document ready event, it should work. $(document).ready(function(){ $("#timeIdName").css("white-space", "pre"); });

http://stackoverflow.com/comment/44298785
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27951754
has text: You can't do this, for good reason. It would be very bad indeed if a script on any site could arbitrarily access any file on any visitor's computer.

http://stackoverflow.com/a/27937131
score: 5
type: AcceptedAnswer
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/27937106
answers question: http://stackoverflow.com/q/27937106
downvote count: 0
has body: Just combine the selectors without any space between them. $('[id$=_pan].oleDiv1');

http://stackoverflow.com/comment/44227109
has text: That doesn't work. The plunker still broken. Also, when I pass the value as a string directly to the value tag, it works (meaning when it's not pulling it from the model). I've updated the plunker to show how the string directly works.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27912612
type: AnswerComment

http://stackoverflow.com/comment/62249540
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27960365
type: QuestionComment
has text: If you're using the Angular JS in 60 Minutes tutorial, the instructions will stop working with newer version of Angular because it will not allow you to use a controller in the global scope - see this post: http://stackoverflow.com/questions/24894870/why-is-my-angular-controller-undefined

http://stackoverflow.com/a/27942880
has comment: http://stackoverflow.com/comment/44281867
has comment: http://stackoverflow.com/comment/44281490
type: Answer
has comment: http://stackoverflow.com/comment/44281860
has body: First of all, caching length is useless in any modern browser (except IE8). JITs easily cache it on their own. Most effective code is: for(var i = users.length-1; i; i--) { // Reversed iteration is little bit faster if((Object.prototype.hasOwnProperty.call(users[i], 'test') &amp;&amp; users[i].test) { // Your code goes here } }
score: 0
answers question: http://stackoverflow.com/q/27942251
has comment: http://stackoverflow.com/comment/44281674

http://stackoverflow.com/q/27860346
tagged with: mobile-safari
has comment: http://stackoverflow.com/comment/44214419
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27860701
has comment: http://stackoverflow.com/comment/44123125
tagged with: http://stackoverflow.com/tag/html
has body: I have a web app that requires a supported version of Mobile Safari. I know how to detect mobile safari, but how can I make a link so the user visits the Settings app and is asked to update iOS?
has title: Can I link from a web page to the 'Settings' app so a user is prompted to upgrade their OS?
type: UnansweredQuestion
type: Question
linked to: http://stackoverflow.com/q/5655674
tagged with: ios
tagged with: javascript

http://stackoverflow.com/comment/44318175
type: QuestionComment
type: Comment
has text: Are you able to provide a fiddle?
comment on: http://stackoverflow.com/q/27948715
score: 0

google-maps
tags question: http://stackoverflow.com/q/27963277
tags question: http://stackoverflow.com/q/27852513
tags question: http://stackoverflow.com/q/27872443
tag name: google-maps
tags question: http://stackoverflow.com/q/27812394
tags question: http://stackoverflow.com/q/27919910
tags question: http://stackoverflow.com/q/27927397
tags question: http://stackoverflow.com/q/27892300
tags question: http://stackoverflow.com/q/27910603
tags question: http://stackoverflow.com/q/27844732
tags question: http://stackoverflow.com/q/27873744
tags question: http://stackoverflow.com/q/27886722
tags question: http://stackoverflow.com/q/27883188
tags question: http://stackoverflow.com/q/27909901
tags question: http://stackoverflow.com/q/27962652
tags question: http://stackoverflow.com/q/27807673
tags question: http://stackoverflow.com/q/27875013
tags question: http://stackoverflow.com/q/27829792
tags question: http://stackoverflow.com/q/27877741
tags question: http://stackoverflow.com/q/27873624
tags question: http://stackoverflow.com/q/27929853
tags question: http://stackoverflow.com/q/27937689
tags question: http://stackoverflow.com/q/27841198
tags question: http://stackoverflow.com/q/27903611
tags question: http://stackoverflow.com/q/27845464
tags question: http://stackoverflow.com/q/27804707
tags question: http://stackoverflow.com/q/27956178
tags question: http://stackoverflow.com/q/27876076
tags question: http://stackoverflow.com/q/27884724
tags question: http://stackoverflow.com/q/27922689
tags question: http://stackoverflow.com/q/27858192
tags question: http://stackoverflow.com/q/27873908
tags question: http://stackoverflow.com/q/27866067
tags question: http://stackoverflow.com/q/27826918
tags question: http://stackoverflow.com/q/27833394
tags question: http://stackoverflow.com/q/27850668
tags question: http://stackoverflow.com/q/27852937
tags question: http://stackoverflow.com/q/27914810
tags question: http://stackoverflow.com/q/27919825
tags question: http://stackoverflow.com/q/27916444
tags question: http://stackoverflow.com/q/27832734
tags question: http://stackoverflow.com/q/27841664
tags question: http://stackoverflow.com/q/27940287
tags question: http://stackoverflow.com/q/27940367
tags question: http://stackoverflow.com/q/27829458
tags question: http://stackoverflow.com/q/27810639
tags question: http://stackoverflow.com/q/27962476
tags question: http://stackoverflow.com/q/27879605
tags question: http://stackoverflow.com/q/27861510
tags question: http://stackoverflow.com/q/27861267
tags question: http://stackoverflow.com/q/27924033
tags question: http://stackoverflow.com/q/27804014
tags question: http://stackoverflow.com/q/27808148
tags question: http://stackoverflow.com/q/27816682
type: Tag
tags question: http://stackoverflow.com/q/27876422
tags question: http://stackoverflow.com/q/27888617
tags question: http://stackoverflow.com/q/27929728
tags question: http://stackoverflow.com/q/27906661
tags question: http://stackoverflow.com/q/27876407
tags question: http://stackoverflow.com/q/27957498
tags question: http://stackoverflow.com/q/27840668
tags question: http://stackoverflow.com/q/27946419
tags question: http://stackoverflow.com/q/27834501
tags question: http://stackoverflow.com/q/27905256
tags question: http://stackoverflow.com/q/27961977
tags question: http://stackoverflow.com/q/27959390

http://stackoverflow.com/comment/44109184
type: AnswerComment
type: Comment
has text: Terminology aside (I know we can't change function but rather replace it) variable assignment can be avoided by doing it this way: `function SomeType() {} SomeType = SomeType.adoptArguments();` By doing this **right after constructor declaration** you can still add prototype members afterwards. Actually an additional statement after constructor.
comment on: http://stackoverflow.com/a/27842939
score: 0

heroku
tags question: http://stackoverflow.com/q/27902548
tags question: http://stackoverflow.com/q/27852879
type: Tag
tags question: http://stackoverflow.com/q/27810455
tag name: heroku

http://stackoverflow.com/comment/44152200
has text: can you provide example?
comment on: http://stackoverflow.com/q/27841400
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44096916
has text: @PaulS. I can't do that because it opens a new tab and I could have more than 100+ html file to open. I don't have the access to those html files and they don't specify title in the html
comment on: http://stackoverflow.com/q/27846474
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44019572
type: Comment
type: QuestionComment
has text: @PatrickQ, Instead of having my list items just keep appending to the list, that IF the items are the of the same item, then append and increment the total number of items to the beginning of a list item. Right now the list is just appending to the list, but if there are items of the same type, they just add. So in my example if there are more than 2 junior tickets in the list, it just appends the tickets to the list. I want to just append one list item, then if there are more than one append a total to the one list item. Does that make sense?
score: 0
comment on: http://stackoverflow.com/q/27804833

http://stackoverflow.com/comment/44119607
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27857214
has text: Sorry Quetin ...the answer to ur first question is wrong. This is the response {"name":"shalini","id":1}.

http://stackoverflow.com/comment/44125092
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27861398
has text: add a display none on your initial container and on the final load operation do a display block

http://stackoverflow.com/comment/44140906
comment on: http://stackoverflow.com/a/27869129
has text: Here is a similar solution that uses `document.elementFromPoint` to detect overlap and hover: http://stackoverflow.com/a/17819021/2502532
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27926358
type: AcceptedAnswer
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/27926044
has body: The root of your confusion appears to be that you interpret this: if(doc &amp;&amp; doc.userId === userId) as "if both doc and doc.userId are equal to userId". This is not the case. Each side of the &amp;&amp; is a separate condition altogether. It is the same as: if(doc == true &amp;&amp; doc.userId === userId) Secondly, the == true part on the left side is redundant, so is often not included when checking if a variable is truthy. The reason for the truthy check is that you want to check that doc is not falsey, before you try to access a property on it. Using a logical AND, if the left side does not evaluate to true, then the right side will not be executed. Without the check, if doc was falsey then an error would be produced for trying to access a property on a none object.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27926044

http://stackoverflow.com/q/27930441
tagged with: image
tagged with: caching
type: Question
has title: Image Preloading Challenge
tagged with: javascript
has comment: http://stackoverflow.com/comment/44258111
score: 0
answer count: 1
tagged with: preload
type: UnansweredQuestion
tagged with: php
has body: My goal is to start preloading all of the website images for a large photo gallery website on the front page (index.php) without it being perceived by the user. If the user clicks into the site (home.php) before all the images are loaded, which will definitely happen, the preloading process should continue invisible to the user. And if the user clicks to other pages (portfolio.php, etc.) the preloading process again continues. The idea is that hopefully with each new page, the process will not completely re-start because many images will already be cached, and the user will not have to wait while all the images preload. Currently I am loading all of the images with html img elements that are inside a div with style="display:none". The img elements are delay-loaded with Javascript (LazyLoad technique) so that the page loads first without waiting on the img. Is there a better way to do this? &lt;?php foreach ($imageArray as $image) { //code to find $fullImagePath....... echo "&lt;div&gt;&lt;img u=\"image\" src=\" \" data-src=\"$fullImagePath\" height=\"100\"; width=\"100\"; class=\"lazy\" /&gt;&lt;/div&gt;"; } // end of loop ?&gt; &lt;script type="text/javascript"&gt; $(window).bind("load", function() { var timeout = setTimeout(function() { $("img.lazy").each(function(){ $(this).attr('src', $(this).attr('data-src')); }) }, 500); }); &lt;/script&gt;
has answer: http://stackoverflow.com/a/27933850

http://stackoverflow.com/comment/44430768
type: Comment
comment on: http://stackoverflow.com/q/27961702
has text: @Ved be my guest. I've only provided a basic example - it's not how I would code it normally. I would hope people would overlook that! (TAMTOWTDI)
score: 0
type: QuestionComment

http://stackoverflow.com/q/27930164
has answer: http://stackoverflow.com/a/27930255
has comment: http://stackoverflow.com/comment/44258760
has comment: http://stackoverflow.com/comment/44257567
type: Question
has comment: http://stackoverflow.com/comment/44258650
has comment: http://stackoverflow.com/comment/44257883
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27930255
has comment: http://stackoverflow.com/comment/44257511
has comment: http://stackoverflow.com/comment/44258080
has answer: http://stackoverflow.com/a/27930325
accepted answer: http://stackoverflow.com/a/27930325
has comment: http://stackoverflow.com/comment/44258293
has comment: http://stackoverflow.com/comment/44257489
has title: More than one writes to file
has comment: http://stackoverflow.com/comment/44257441
has comment: http://stackoverflow.com/comment/44257650
has body: I have a web application and when the users clicks save, a write to a file should occur. The application is "a football scheduler", thus more than one players can click on the save button at the very same time. Initially I thought that this would be something rare, but this is not the case, since when the match in announced players rush into, because the match will be full in a short period of time. What happens if two players press save at the same time? Only the save of one player will take effect and the other one will be lost (and it is not rare that this happens with the last available position and then there is some conflict). How can I cope with this phenomenon? // removed code since it wasn't needed I would like to know if this is possible without using a database. So a no answer is also accepted.
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/44097158
type: AnswerComment
score: 0
type: Comment
has text: I tried to bind ':userEmail'to $email because the email field is the unique field that indicates the user and which row to pull data from. Is that correct? I added the error reporting and it spit out the number 22519. I added: echo $user['first_name']; after: $user = $stmt->fetch(PDO::FETCH_ASSOC); I also took out the second ")" after ASSOC)) because it was giving me a syntax error. I still cant get the input value to populate. @Crembo
comment on: http://stackoverflow.com/a/27841906

http://stackoverflow.com/comment/44061355
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27827665
has text: Well you're creating **two** global symbols instead of one, so if you think that's bad, it's bad.
score: 0

http://stackoverflow.com/q/27861722
favorite count: 0
has title: Creating a contact form in Angular with Nodemailer
tagged with: angularjs
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27912686
tagged with: node.js
score: 4
has comment: http://stackoverflow.com/comment/44216928
possible better answer: http://stackoverflow.com/a/29140678
upvote count: 4
has answer: http://stackoverflow.com/a/29140678
tagged with: javascript
has body: I am trying to create a contact form for my site. I am using a MEAN stack, so the nodemailer module seemed to make sense to use. I have created an endpoint '/api/contact' to which accepts a POST request and uses the data on that request to send a mail. I then have a form in my angular app, which on submit calls a function which makes an http. Hopefully this sounds correct. As an aside I've been using the Yeoman angular-fullstack generator, so my code is following that structure. When the app loads though in my console I see a 500 error code, and then when I look in the logs I see an error in reading the from and body properties in my contact.controller. Here's my code: app.js ... var express = require('express'); --- // Setup server var app = express(); var server = require('http').createServer(app); require('./config/express')(app); require('./routes')(app); // Start server server.listen(config.port, config.ip, function () { console.log('Express server listening on %d, in %s mode', config.port, app.get('env')); }); // Expose app exports = module.exports = app; routes.js module.exports = function(app) { // Insert routes below app.use('/api/contact', require('./api/contact')); ... ./api/contact/index.js var express = require('express'); var controller = require('./contact.controller'); var router = express.Router(); router.post('/', controller.send); module.exports = router; ./api/contact/contact.controller.js var nodemailer = require('nodemailer'); var transporter = nodemailer.createTransport({ service: 'gmail', auth: { user: //removed pass: //removed } }); exports.send = function(req,res){ var mailOptions = { to: //removed - my email address, subject: 'New request on lumbajack from ', from: req.data.from, html: req.data.body }; transporter.sendMail(mailOptions, function(err, info){ if (err) { console.log(err); }else{ console.log('Message sent: ' + info.response); } }); } Then on the client side, my angular controller angular.module('lumbajackApp') .controller('Main…
tagged with: express
has answer: http://stackoverflow.com/a/27912686
tagged with: nodemailer
has comment: http://stackoverflow.com/comment/44215455
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44216984

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/27884849
type: Tag
tags question: http://stackoverflow.com/q/27872540

http://stackoverflow.com/q/27888062
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
duplicate of: http://stackoverflow.com/q/23945485
favorite count: 0
has answer: http://stackoverflow.com/a/27888171
has body: I am displaying price offers for flights obtained via a third party service. When the user clicks one of the prices, he is redirected to another website for booking the flight. The problem is that the booking page loads very slowly on the other website. Is there a way to display a popup message while the booking page is loading in the same window? Or somehow preload the booking page and display it only when it's fully loaded?
linked to: http://stackoverflow.com/q/23945485
type: UnansweredQuestion
has title: Display loading message while third party website is loading
downvote count: 0
score: 1

http://stackoverflow.com/comment/44103667
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27847439
type: Comment
has text: @DaveGoten, I think you've got it! I added to my answer. :-)

http://stackoverflow.com/a/27931820
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27929914
has body: Performance tuning really depends on some of the constraints that you're facing. Here are a few suggestions: 1) Do you really need to show/hide the labels, or will not creating them at all suffice? If they don't need to exist, use ng-if instead of ng-show. This will reduce the number of watchers as well as the number of DOM elements in your example drastically. 2) If you can use Angular 1.3+ and can assume the labels are static ids, use one-time binding to avoid having so many watchers Modifying your example with these suggestions results in: http://jsbin.com/madefuqami/2/edit Ultimately, however, if you keep adding elements then at some point your app will become slow. Angular's dirty-checker will look at each of these ng-show (or ng-if) and {{}} bindings on every $digest cycle. Plus the DOM will get unnecessarily large - there's a good chance that you don't need the browser to do all of the work associated with maintaining HTML and styling for element 3000 when only 1-50 fit on your screen. A more robust solution would involve looking into pagination or virtualization. This can either be done server-side, or in Javascript. I suggest server-side pagination. Ultimately, it will scale better and make for a cleaner solution. However, if you decide to go the Javascript virtualization route, there are libraries available already such as angular-virtual-scroll
has comment: http://stackoverflow.com/comment/44261350
answers question: http://stackoverflow.com/q/27929914
has comment: http://stackoverflow.com/comment/44261406
type: Answer
has comment: http://stackoverflow.com/comment/44261499
has comment: http://stackoverflow.com/comment/44261213
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/44261173

http://stackoverflow.com/comment/134445394
comment on: http://stackoverflow.com/q/27876511
has text: The Node.js Guide shows how to do this https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44283592
comment on: http://stackoverflow.com/a/27943798
has text: If I want for 24hours I set this `now.setDate(1);`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27887391
has comment: http://stackoverflow.com/comment/44175776
tagged with: pug
answer count: 1
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/27887489
score: 0
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44175760
has comment: http://stackoverflow.com/comment/44175803
has comment: http://stackoverflow.com/comment/44175870
has title: Getting header resend error in node
accepted answer: http://stackoverflow.com/a/27887489
tagged with: url-routing
type: Question
has comment: http://stackoverflow.com/comment/44175844
has body: I have following routing: router.get('/blog/:title', function (req, res) { blog.getBlogPost(req, function (data) { res.render('blog', data); }); }); and the function getBlogPost exports.getBlogPost = function (req, callback) { // TODO SAFE PARAM // TODO ERR Handling var title = req.param('title'); Blog.findOne({permaLink: title}).exec(function (err, data) { var date = new Date(+data.timestamp); data.tags = createHashtagsFromCSV(data.tags); data.date = month_names_long[date.getMonth()] + " " + date.getDate() + ", " + date.getFullYear(); callback(data); }); // not found callback({}); }; and strangely I get following Node console log Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (http.js:689:11) at ServerResponse.header (C:\Users\Michael\Desktop\qcode\node_modules\express\lib\response.js:662:10) at ServerResponse.send (C:\Users\Michael\Desktop\qcode\node_modules\express\lib\response.js:146:12) at fn (C:\Users\Michael\Desktop\qcode\node_modules\express\lib\response.js:896:10) at View.exports.renderFile [as engine] (C:\Users\Michael\Desktop\qcode\node_modules\jade\lib\jade.js:325:12) at View.render (C:\Users\Michael\Desktop\qcode\node_modules\express\lib\view.js:76:8) at Function.app.render (C:\Users\Michael\Desktop\qcode\node_modules\express\lib\application.js:527:10) at ServerResponse.res.render (C:\Users\Michael\Desktop\qcode\node_modules\express\lib\response.js:900:7) at module.exports (C:\Users\Michael\Desktop\qcode\app.js:65:9) at Layer.handle_error (C:\Users\Michael\Desktop\qcode\node_modules\express\lib\router\layer.js:58:5) I have done stuff like this already a few times in my project, but this times it throws this error and I have now clue why? Any idea why?

http://stackoverflow.com/q/27877197
has answer: http://stackoverflow.com/a/27877233
has answer: http://stackoverflow.com/a/27879110
has answer: http://stackoverflow.com/a/69519946
has answer: http://stackoverflow.com/a/62280205
tagged with: alphabetical
type: Question
possible better answer: http://stackoverflow.com/a/30697101
has answer: http://stackoverflow.com/a/30697101
upvote count: 16
tagged with: javascript
has answer: http://stackoverflow.com/a/55145891
has answer: http://stackoverflow.com/a/27877248
favorite count: 0
answer count: 9
has comment: http://stackoverflow.com/comment/44155836
has answer: http://stackoverflow.com/a/27877220
score: 16
has body: I would like to know how to convert each alphabetic character entered to a number. e.g. a=1, b=2 ,c=3 up to z=26 In C I had managed to do something similar, by taking a character input and displaying it as an integer. But I'm not sure how I would do this in JavaScript.
has title: Convert letter to number in JavaScript
has answer: http://stackoverflow.com/a/27877235
accepted answer: http://stackoverflow.com/a/27877235
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44155866

http://stackoverflow.com/comment/44266380
has text: When using AJAX it's a best practice to just handle data with PHP and `echo json_encode($assocArray);` the results, so you're dealing with a JavaScript Object back on the Client as the argument to your AJAX `success` function. Also, be aware that `$.post()` is Asynchronous, so don't expect a return value from `save_match` to come out of the `post` `success` function, without using a while loop to make sure the Asynchronous action has already occurred.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27934113
score: 0

http://stackoverflow.com/comment/44233381
type: AnswerComment
comment on: http://stackoverflow.com/a/27917333
type: Comment
has text: i'm getting same error while i changed method to Static
score: 0

http://stackoverflow.com/comment/44246205
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27922669
has text: Thanks Jiří! I didn't add Jquery that was the error :(
type: AnswerComment

http://stackoverflow.com/comment/44226434
type: Comment
comment on: http://stackoverflow.com/q/27913537
type: QuestionComment
has text: The *createBtn* function should use DOM methods to create the button and should either return the newly created button so it can be added to the right place in the document, or it should take a DOM element as an argument that the button will be added to. Oh, and doing this inside a constructor doesn't make sense. *this.getPrice* will reference the *getPrice* property of the button, not of the *products* instance.
score: 1

http://stackoverflow.com/comment/44233980
type: QuestionComment
type: Comment
has text: @adeneo: objects are JS's idea of assoc arrays; not all AAs are implemented the same way, you know. As far as the rest, connecting "pattern" with {code} as closely as possible seems tidy by definition; the only question you can ask is whether it's understandable enough for yourself and coworkers. Not sure what you mean about `let`, but write an answer for that?
score: 0
comment on: http://stackoverflow.com/q/27917523

http://stackoverflow.com/q/27952525
has answer: http://stackoverflow.com/a/30621554
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/30621554
upvote count: 1
has title: How to make Polymer core-scroll-header-panel condense with javascript
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44302725
has body: I want to make a core-scroll-header-panel, scroll when it's clicked. &lt;core-scroll-header-panel on-tap="{{panelTap}}" id="actionPanel" shadow="true" condenses="true" keepCondensedHeader mode="waterfall-tall" class=""&gt; &lt;core-toolbar class="themed narrow" &gt; &lt;/core-toolbar&gt; &lt;/core-scroll-header-panel&gt; ... the parent element's script section is. panelTap : function() { /* make it condense here */ } How do I trigger the condense-ing transition?
type: Question
tagged with: polymer

http://stackoverflow.com/comment/44121108
has text: Please add some explanation to your answer.
type: Comment
score: 4
type: AnswerComment
comment on: http://stackoverflow.com/a/27859017

http://stackoverflow.com/q/27916977
tagged with: jquery
has comment: http://stackoverflow.com/comment/44232293
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44232665
has comment: http://stackoverflow.com/comment/44232367
has comment: http://stackoverflow.com/comment/44232520
has comment: http://stackoverflow.com/comment/44232617
has comment: http://stackoverflow.com/comment/44232579
favorite count: 0
has comment: http://stackoverflow.com/comment/44232835
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27917038
has comment: http://stackoverflow.com/comment/44232682
tagged with: php
has answer: http://stackoverflow.com/a/27917044
has comment: http://stackoverflow.com/comment/44232553
has body: This is the first time I am trying to make a popup working. I have done research over the internet but I could not see what I do wrong Perhaps you guys can see something wrong here. I will just link the form en the javascript for avoiding long script. &lt;script type="text/javascript"&gt; $('.popup').popupWindow({ height:500, width:800, top:50, left:50 }); &lt;/script&gt; And the form: echo "&lt;form action='getlist.php' method='post'&gt; &lt;input type='text' name='exte' class='exte' value=".$value['ext']."&gt; &lt;input type='submit' name='aanvragen' class='popup' id='aanvragen' value='aanvragen'&gt;&lt;/form&gt;"; echo "&lt;/td&gt;"; I want it to open getlist.php in a popup screen ;) Thanks Edit: When I click on the button it just go to getlist.php in a full screen I want this to be in a popup
upvote count: 1
downvote count: 1
type: Question
has title: JavaScript popup result from a form
tagged with: javascript

http://stackoverflow.com/a/27812892
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44064376
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27812638
has body: I think angular didn't check that, once the ngOptions value changes, angular didn't do a check to see if the ngModel is exists in ngOptions. angular.js line 21371: self.databound = $attrs.ngModel; line 21828 - 21840: return function (scope, element, attr) { var selectCtrlName = '$selectController', parent = element.parent(), selectCtrl = parent.data(selectCtrlName) || parent.parent().data(selectCtrlName); // in case we are in optgroup if (selectCtrl &amp;&amp; selectCtrl.databound) { // For some reason Opera defaults to true and if not overridden this messes up the repeater. // We don't want the view to drive the initialization of the model anyway. element.prop('selected', false); } else { selectCtrl = nullSelectCtrl; } You can see above code checks which option should be selected when generated the options, but i can't find a reverse check when ngOptions got updated.

http://stackoverflow.com/comment/44566415
comment on: http://stackoverflow.com/a/28087386
has text: Thanks for catching that. Confirmed that it works, and a fabric canvas can be created from an element using this syntax.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27817616
accepted answer: http://stackoverflow.com/a/27819146
tagged with: fullpage.js
type: AnsweredQuestion
score: 0
has title: SlideDown doesn't work with fullPage.js
type: Question
tagged with: slidedown
has body: guys. I got an headache trying to understand, how to fix it, but I don't know JavaScript at all. So, please, help me with it. The trouble is, that ScrollDown (maybe and Up) doesn't work, when fullPage.js enabled. See codes. SlideDown: jQuery(document).ready(function(e){ // -- menu ---\ $(window).scroll(function () { var html = document.documentElement; // $(".blockMenu").css("top",$(document).scrollTop()) if($('html').width()&gt;1000){ if($(document).scrollTop()&gt;=200){ $('.hedMenu').slideUp() $('.hedMenu2').slideDown() } else{ $('.hedMenu2').slideUp() $('.hedMenu').slideDown() } } }) }) fullPage: $(document).ready(function() { $('#fullpage').fullpage({ sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', 'whitesmoke', '#ccddff'], anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', 'lastPage'], menu: '#menu', afterLoad: function(anchorLink, index){ //section 2 if(index == 2){ //moving the image $('#section1').find('img').delay(500).animate({ left: '0%' }, 1500, 'easeOutExpo'); $('#section1').find('p').first().fadeIn(1800, function(){ $('#section1').find('p').last().fadeIn(1800); });; } //section 3 if(anchorLink == '3rdPage'){ //moving the image $('#section2').find('.intro').delay(500).animate({ left: '0%' }, 1500, 'easeOutExpo'); } } }); });
has answer: http://stackoverflow.com/a/27819146
has answer: http://stackoverflow.com/a/58867319
possible better answer: http://stackoverflow.com/a/27817664
has answer: http://stackoverflow.com/a/27817664
tagged with: javascript
answer count: 3

http://stackoverflow.com/a/27829101
has comment: http://stackoverflow.com/comment/44065282
has comment: http://stackoverflow.com/comment/44066190
score: 2
has comment: http://stackoverflow.com/comment/44064875
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44070357
has comment: http://stackoverflow.com/comment/44097023
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27828571
answers question: http://stackoverflow.com/q/27828571
upvote count: 2
has body: Files that are included with browserify (or other CommonJS compatible system) can expose methods or values to the requiring file via module.exports. module.exports is returned from the require() statement. Take this example: index.js var myClass = require("myClass"); myClass.js module.exports = (function() { return function (foo) { return foo + "bar"; }; }()); index.js now has access to the function that is built in myClass.js and can use it as: index.js var myClass = require("myClass"); // expose the class to the global scope window.myClass = myClass; var result = myClass("foo "); so the var result would have the value "foo bar".
has comment: http://stackoverflow.com/comment/44066994
has comment: http://stackoverflow.com/comment/44066213

http://stackoverflow.com/comment/44135664
comment on: http://stackoverflow.com/a/27865084
type: AnswerComment
has text: Is it possible to call get without parenthesis? To treat it more like an attribute?
score: 0
type: Comment

http://stackoverflow.com/q/27824036
score: 0
has body: When I click on it changes background. It works fine. But what if I want to click on it again to restore the original background? I have this code: jQuery(document).ready(function($) { $(".select").on("click", function () { $(this).css("background-image", "url(images/selected.png)"); }); }); Here is jsfiddle EXAMPLE Basically when I click on the div it changes the background, which is fine. But I want to have ability to click on it again to restore the original background. It will be an alternative solution for tick box, but just for demo purposes. Thanks
possible better answer: http://stackoverflow.com/a/27824083
has answer: http://stackoverflow.com/a/27824117
has title: click to change background toggle
accepted answer: http://stackoverflow.com/a/27824071
answer count: 4
has comment: http://stackoverflow.com/comment/44053966
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27825484
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27824071
has answer: http://stackoverflow.com/a/27824083

http://stackoverflow.com/q/27843497
upvote count: 3
type: AnsweredQuestion
score: 3
has title: mongoose static method returns a bluebird promise
has answer: http://stackoverflow.com/a/27844408
type: Question
tagged with: mongodb
answer count: 1
downvote count: 0
tagged with: mongoose
tagged with: javascript
favorite count: 0
tagged with: promise
has body: I am creating a mongoose static method 'load' so that my main controller function can use it (for chainning and error handling). UserSchema.load('54ae92dd8b8eef540eb3a66d') .then(....) .catch(....); The thing is the id is something wrong so I need to catch this error. and I am thinking it is better to do this in the model layer. When I do the following the controller can catch this error. UserSchema.statics.load = function(id) { if (!mongoose.Types.ObjectId.isValid(id)) { return Promise.resolve().then(function() { throw new Error('not a mongoose id'); }); ------------( * ) } return Promise.cast(this.findOne({ _id: id }).exec()); }; But if I only do the following the error is not successfully thrown into the controller .catch function. AchievementSchema.statics.load = function(id) { if (!mongoose.Types.ObjectId.isValid(id)) { throw new Error('not a mongoose id'); } return Promise.cast(this.findOne({ _id: id }).exec()); }; so my question is am I doing this correctly? If so is there easier ways to write the (*) statement? What I am doing seems ugly.. Thanks.
accepted answer: http://stackoverflow.com/a/27844408
tagged with: bluebird

http://stackoverflow.com/a/27835658
type: AcceptedAnswer
downvote count: 1
type: Answer
score: 6
answers question: http://stackoverflow.com/q/27835598
has body: Because setTimeout runs callback function in global object context, meaning that indexobj.testFunction is invoked with this being a window object. So you can either do setTimeout(function() { indexobj.testFunction(); },1000); or using Function.prototype.bind to create wrapper function with correct context: setTimeout(indexobj.testFunction.bind(indexobj), 1000); Another modern option from ES2015 is to use arrow function that preserves lexical context: setTimeout(() =&gt; indexobj.testFunction(), 1000);
accepted answer of: http://stackoverflow.com/q/27835598
upvote count: 7

http://stackoverflow.com/a/27950671
has body: The document itself is a document node. All HTML elements are element nodes. All HTML attributes are attribute nodes. Text inside HTML elements are text nodes. Comments are comment nodes. In the HTML DOM, the Element object represents an HTML element. DOM w3schools
answers question: http://stackoverflow.com/q/27950634
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44131505
type: QuestionComment
has text: Include your code .... and maybe screenshot with actual look and another with the desired layout
score: 0
comment on: http://stackoverflow.com/q/27864533
type: Comment

http://stackoverflow.com/comment/44182732
score: 1
comment on: http://stackoverflow.com/q/27890794
type: Comment
has text: @surajck it seems you aren't familiar with the plugin. Why are you saying `data` shouldn't be function when the docs clearly show it is
type: QuestionComment

http://stackoverflow.com/q/27894063
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44189536
has comment: http://stackoverflow.com/comment/44189572
has answer: http://stackoverflow.com/a/27894259
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/44189555
accepted answer: http://stackoverflow.com/a/27894234
tagged with: css
has title: Tabbed content won't work with multiple divs
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27894259
has answer: http://stackoverflow.com/a/27894234
score: 1
has comment: http://stackoverflow.com/comment/44189432
upvote count: 1
has comment: http://stackoverflow.com/comment/44189481
type: Question
answer count: 2
has body: I'm new to Javascript and am working on the following: $('.tabs-holder li').click(function () { var tabID = $(this).attr('data-tab-id'); $(this).closest('.tabbed-content').find('.tabs-holder li').removeClass('active'); $(this).addClass('active'); $(this).closest('.tabbed-content').find('.content-holder').children('.tab-content').removeClass('active').siblings('.tab-content[data-tab-id=' + tabID + ']').addClass('active'); }); I'm trying to get it to work on all divs with a data-tab-id of the same value, but it's only acting on the one div. JSFiddle here http://jsfiddle.net/dynaf9pc/8/

http://stackoverflow.com/comment/44215125
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27907327
has text: so you are saying, that even a server restart kept the "old" file? could you do a `find` for the file in your target-dir? could be, that it's there several times (e.g. once from your ide and once from your build tool). if both are in the classpath only one get picked up.
score: 0

http://stackoverflow.com/q/27851179
answer count: 4
has answer: http://stackoverflow.com/a/27851280
type: UnansweredQuestion
has title: Remove items from select list which have been appended in Jquery
upvote count: 1
has answer: http://stackoverflow.com/a/27851329
has answer: http://stackoverflow.com/a/27851344
type: Question
has answer: http://stackoverflow.com/a/27851504
score: 1
has body: My form allows users to select a vehicle type, which then, using Jquery, appends those values which are checked, to my select list. All good, except I need to handle the de-selection of vehicles, which should remove the value in the select list. You should be able to see that on append, I attribute a class of "select_option" which is what I use to try and remove this from the select. However, it isn't working. How can I remove those that are de-selected? HTML Bike Car Choose car JQUERY $('.vehicles').click(function(){ $('#choose_car').append(' ' + $(this).data("name")) + ' '; $.each($(".vehicles:not(:checked"), function(){ $('option.select_option').remove(); }); });
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27823420
has comment: http://stackoverflow.com/comment/44053969
has title: AngularJS object returned from $http - how to get key/value pairs
tagged with: arrays
accepted answer: http://stackoverflow.com/a/27824131
tagged with: javascript
has body: In an AngularJS app, I have an object stored in data returned from $http that looks something like this: [{"var1":"1","var2":"2","var3":"3"}] I want to be able to get the value of "var2". I thought this would be easy: $scope.myObj = data; $scope.myVar = $scope.myObj.var2; //$scope.myvar should "2" Instead, $scope.myObj returns undefined how can I access the value of var2?
has comment: http://stackoverflow.com/comment/44053145
type: Question
has comment: http://stackoverflow.com/comment/44052834
type: AnsweredQuestion
tagged with: angularjs
answer count: 1
has answer: http://stackoverflow.com/a/27824131
has comment: http://stackoverflow.com/comment/44053229
score: 0
has comment: http://stackoverflow.com/comment/44052833
has comment: http://stackoverflow.com/comment/44054106
tagged with: angularjs-scope

http://stackoverflow.com/comment/44309956
has text: you mean blue image should within the container , it should not move out side the container ? is it?
comment on: http://stackoverflow.com/q/27957869
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27931990
type: Answer
answers question: http://stackoverflow.com/q/27927950
has body: I think this was a case of my thinking too hard about the problem. Once I stepped back, I realized that I had been looking in the right direction, but wasn't triggering the click event properly. So, for example, to get the "button" that controls play and pause, you could use: document.getElementsByClassName("player-control-button player-play-pause")[0]. Then to click it programmatically in tampermonkey, you simply invoke the click event using: document.getElementsByClassName("player-control-button player-play-pause")[0].click(); Volume and other controls in the bar are similar. The playback position is looking to be a bit trickier, but I'll do some more digging and add a comment to this answer once I figure it out.
downvote count: 0
has comment: http://stackoverflow.com/comment/49068721
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44347929
upvote count: 6
has comment: http://stackoverflow.com/comment/66666501
accepted answer of: http://stackoverflow.com/q/27927950
score: 6

http://stackoverflow.com/comment/44102823
type: Comment
comment on: http://stackoverflow.com/a/27849189
type: AnswerComment
score: 0
has text: i use this function mypng(){ $("jpeg").click(function(event){ event.preventDefault(); }); var c=document.getElementById("picture"); var dataURL = c.toDataURL("image/png"); alert(dataURL); }

http://stackoverflow.com/comment/44283123
type: Comment
type: QuestionComment
has text: What's wrong with the array you suggested?
comment on: http://stackoverflow.com/q/27943866
score: 0

http://stackoverflow.com/q/27854160
type: AnsweredQuestion
has title: Function to change action attribute of form - gives 'undefined is not a function'
has body: I am trying to set the action attribute of a form depending on which button is clicked to exit a page, once the action is changed, the form should be submitted and the action then completed. My jQuery function: function changeAction(formAction) { ('#_21').attr('action', formAction); document.getElementById('_21').submit(); } is called by an inline 'onclick' reference: Save and continue The idea being that I can pass the paramater I've named 'formAction' depending on which of several buttons are clicked. On click however, console records the following error: Uncaught TypeError: undefined is not a function Against the line in my function: ('#_21').attr('action', formAction); Where am I going wrong? - Thanks
tagged with: forms
type: Question
score: -2
has comment: http://stackoverflow.com/comment/44112137
possible better answer: http://stackoverflow.com/a/27854197
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/44133170
accepted answer: http://stackoverflow.com/a/27854199
upvote count: 0
has answer: http://stackoverflow.com/a/27854197
favorite count: 0
has answer: http://stackoverflow.com/a/27854199
has comment: http://stackoverflow.com/comment/44112123
downvote count: 2
has comment: http://stackoverflow.com/comment/44112702

http://stackoverflow.com/comment/44199650
type: Comment
type: QuestionComment
score: 0
has text: try to look at the js console... do you see any error?
comment on: http://stackoverflow.com/q/27899987

http://stackoverflow.com/comment/44069772
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27831704
score: 0
has text: feed is my viewmodel name.

http://stackoverflow.com/a/27822524
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27822487
answers question: http://stackoverflow.com/q/27822487
downvote count: 0
score: 1
has body: You dont need to parse that because that IS already an object: var obj = {"readyState":4,"responseText":"{\"Success\":0,\"Failed\":0}","responseJSON":{"Success":0,"Failed":0},"status":200,"statusText":"OK"}; var failed = obj.responseJSON.Failed; var success = obj.responseJSON.Success;

http://stackoverflow.com/a/27908087
upvote count: 1
answers question: http://stackoverflow.com/q/27905277
downvote count: 0
type: Answer
has body: Solved: novalidate="novalidate" ---&gt; not supported placeholder ----&gt; not supported Just remove this.
score: 1

http://stackoverflow.com/a/27939404
has body: You have to parse the price in a sort method myArray.sort(function(a, b){ var pA = parseFloat(a["price"].substr(4).replace(",", "")); var pB = parseFloat(b["price"].substr(4).replace(",", "")); if (pA &lt; pB) return -1; if (pA &gt; pB) return 1; return 0; }); Edit : good point for the point
score: 1
answers question: http://stackoverflow.com/q/27939142
upvote count: 1
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44275377

http://stackoverflow.com/q/27810138
score: 0
has title: testing backbone views with Jasmine-node
answer count: 2
has answer: http://stackoverflow.com/a/27810338
has answer: http://stackoverflow.com/a/27810349
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: backbone.js
type: Question
tagged with: node.js
has body: I'm trying to test my backbone view using jasmine-node, and i'm facing a problem with Jquery when i run the unit tests. backbone View var Backbone = require("Backbone"), $ = require('jquery'); Template = require("mytemplate"); Backbone.$ = $; module.exports = Backbone.View.extend({// my view ...}); test var Backbone = require("Backbone"), MyView = require("MyView"); //specs .... The problem is: My view works great :). but when i run the tests it says "jQuery requires a window with a document". I've tried to use jsdom but it did'n work for me :( is it possible to run jquery inside jasmine-node ? also, i'm using gulp with webpack thank you guys

http://stackoverflow.com/comment/109415079
has text: How does this work if it's not using `dangerouslySetInnerHTML`?
type: Comment
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/30960037

http://stackoverflow.com/comment/44280217
type: QuestionComment
type: Comment
has text: When you use display:none, the element effectively disappears, and the other element will move up to the same position as the old element. Maybe try just changeing opacity to 0 or use visibility:hidden.
comment on: http://stackoverflow.com/q/27942264
score: 0

http://stackoverflow.com/a/27821535
answers question: http://stackoverflow.com/q/27821020
has comment: http://stackoverflow.com/comment/44075331
has body: you can't populate grid above another grid without destroying the first one that you created. so if you have grid with id=MyGrid placed at a div this div will be removed and the grid will replace it. so you have to use two methods the placeAt and the grid.destroyRecursive(true); the code below should work fine. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> `enter code here` Select class Level class Level
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27821020
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27814037
has body: you could deocde the json string into object or array $js_array = json_encode(array( 'var1' =&gt; '1', 'var2' =&gt; '2', 'var3' =&gt; '3', 'arr1' =&gt; array('a' =&gt; 'mobile', 'b' =&gt; 'PC'), 'arr2' =&gt; array('price' =&gt; 600, 'day' =&gt; 7) )); $decode = json_decode($js_array, true); //decode into array //you could use or seperate something you get back from json decode like this foreach($decode as $key =&gt; $value) { if(is_array($value)) { foreach ($value as $k =&gt; $v) { echo "$k =&gt; $v &lt;br /&gt;"; } } else { echo "$key: $value &lt;br /&gt;"; } } and the output: var1: 1 var2: 2 var3: 3 a: mobile b: PC price: 600 day: 7
score: 0
answers question: http://stackoverflow.com/q/27810118
type: Answer

http://stackoverflow.com/q/27881291
has comment: http://stackoverflow.com/comment/44167937
has comment: http://stackoverflow.com/comment/44165120
answer count: 1
downvote count: 0
has body: I've read extensively about Javascript prototypal inheritance, specifically in child scopes. My understanding is that we always ensure a "." is in our ng-model binding so that it references an object. My question is ... why does prototypal inheritance create a primitive on its local scope but not an object? It seems like the very same thing. In one case, we have a primitive. In another case we have an object - say an array. What's even more confusing is that I can pass an object to the child scope (without a ".") and by pushing data onto the object that was passed down within the local scope, the parent object is still modified and thus no child array object is created. Again, why? Prototypal inheritance seems to auto-create primitives ... what makes an object different?
favorite count: 0
tagged with: scope
tagged with: angularjs
type: UnansweredQuestion
score: 2
has title: AngularJS $scope prototypal inheritance - primitive vs. objects?
has comment: http://stackoverflow.com/comment/44175150
upvote count: 2
linked to: http://stackoverflow.com/q/14049480
has comment: http://stackoverflow.com/comment/44196037
has answer: http://stackoverflow.com/a/27961622
has comment: http://stackoverflow.com/comment/44171939
has comment: http://stackoverflow.com/comment/44165933
type: Question
has comment: http://stackoverflow.com/comment/44170334
tagged with: javascript
has comment: http://stackoverflow.com/comment/44181294

http://stackoverflow.com/comment/44197892
has text: yes it is returning me the old content before editing.
comment on: http://stackoverflow.com/q/27898852
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27876787
type: AcceptedAnswer
has body: like @incredible answer, I'll provide a little code snippet, may be a little help for you.. var locations = [ ['Rome', 41.9100711, 12.5359979, 4,"http://google.co.id/"], ['Coogee Beach', -33.923036, 151.259052, 5,"http://google.co.id/"], ['Cronulla Beach', -34.028249, 151.157507, 3,"http://google.co.id/"], ['Manly Beach', -33.80010128657071, 151.28747820854187, 2,"http://google.co.id/"], ['Maroubra Beach', -33.950198, 151.259302, 1,"http://google.co.id/"] ]; var map = new google.maps.Map(document.getElementById('map'), { zoom: 4, center: new google.maps.LatLng(41.9100711, 12.5359979), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i &lt; locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, clickable: true, url:locations[i][4] }); google.maps.event.addListener(marker, 'click', (function (marker, i) { return function () { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); window.location.href = marker.url; } })(marker, i)); } &lt;script src="http://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false"&gt;&lt;/script&gt; &lt;div id="map" style="width:600px; height:450px"&gt;&lt;/div&gt;
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27876422
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27876422

http://stackoverflow.com/a/27814126
score: 0
has body: You only need to put it in 1 file and it doesn't even matter which one as long as it's a file that gets included in every page. I currently have no WP installation to check which one that is, but if you put it in the file that has the &lt;head&gt;-tag in it, you should be fine.
has comment: http://stackoverflow.com/comment/44036377
type: Answer
answers question: http://stackoverflow.com/q/27814031
has comment: http://stackoverflow.com/comment/44045316

http://stackoverflow.com/comment/44217944
has text: Is there any reason why you should *want* to do this, however?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27909211

http://stackoverflow.com/comment/44069793
comment on: http://stackoverflow.com/q/27831919
score: 0
has text: There seems to be a big gap between your title and your actual question. Are you asking how to remove a class from an element, or are you asking how to get an element via class?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27958049
tagged with: angularjs
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27958689
score: 0
has body: There is the following AngularJS controller code: $scope.orders = Order.query() $scope.order_statuses = OrderStatus.query() Each order has 'order_status_id' field. And the view (HTML SLIM): table.table tr ng-repeat="order in orders | orderBy:'-id'" td.col-xs-6.vertical-align | Order \#{{ order.id }} td.col-xs-6 select data-ng-options="o.title for o in order_statuses" data-ng-model="order.order_status_id" As you can see I draw all orders in table, and each order has select with order statuses. Each select has all order statuses, it works. But I bind status of each order in 'data-ng-model' attribute, but it doesn't work - each select is unselect. How can I fix it? Thanks.
answer count: 1
tagged with: javascript
has title: data-ng-options directive in AngularJS

http://stackoverflow.com/q/27859227
accepted answer: http://stackoverflow.com/a/27859357
has comment: http://stackoverflow.com/comment/44121224
type: AnsweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44121134
type: Question
tagged with: javascript
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/44121081
has title: Javascript global module or global variable
tagged with: global
tagged with: module
favorite count: 0
has body: I couldn't come up with a better question title, sorry. My question is, in he.js as per https://github.com/mathiasbynens/he/blob/master/he.js , they are using the following code: /*! https://mths.be/he v0.5.0 by @mathias | MIT license */ ;(function(root) { //...omitted var he = { 'version': '0.5.0', 'encode': encode, 'decode': decode, 'escape': escape, 'unescape': decode }; // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' &amp;&amp; typeof define.amd == 'object' &amp;&amp; define.amd ) { define(function() { return he; }); } else if (freeExports &amp;&amp; !freeExports.nodeType) { if (freeModule) { // in Node.js or RingoJS v0.8.0+ freeModule.exports = he; } else { // in Narwhal or RingoJS v0.7.0- for (var key in he) { has(he, key) &amp;&amp; (freeExports[key] = he[key]); } } } else { // in Rhino or a web browser root.he = he; } }(this)); And if you import this into your page as &lt;script src="he.js"&gt;&lt;/script&gt; You will be able to call the methods in your page as he.encode(...). My question is, how exactly does it set the variable he? I mean, I can see the } else { // in Rhino or a web browser root.he = he; } }(this)); But at the call of }(this));, what exactly is this?
has answer: http://stackoverflow.com/a/27859357

http://stackoverflow.com/a/27877124
has comment: http://stackoverflow.com/comment/44156106
has comment: http://stackoverflow.com/comment/44156698
has body: Your switch statement is not correct. Try: switch($side){ case 'forside':// Colon instead of semicolon include('incs/forside.php'); break; case 'side2':// Colon instead of semicolon include('incs/side2.php'); break;// Break to avoid executing `default` part default:// Colon instead of semicolon include('incs/forside.php'); break; } UPDATE Print everything, hide the content you don't want to show using jquery or javascript and when the user clicks the link, switch content out. This can serve you as a sketch: $(document).ready(function() { $("#side2").hide(); // Hide side2 to start off $("#foreside_c").click(function (ev) {// Click on link, hide one show other. ev.preventDefault(); $("#side2").hide(); $("#foreside").show(); }); $("#side2_c").click(function (ev) {// Click on link, hide one show other. ev.preventDefault(); $("#foreside").hide(); $("#side2").show(); }); }); Fiddle
has comment: http://stackoverflow.com/comment/44156797
has comment: http://stackoverflow.com/comment/44156080
type: Answer
answers question: http://stackoverflow.com/q/27876965
has comment: http://stackoverflow.com/comment/44155702
has comment: http://stackoverflow.com/comment/44156335
score: 0
has comment: http://stackoverflow.com/comment/44157146

http://stackoverflow.com/comment/44019656
comment on: http://stackoverflow.com/q/27805300
type: QuestionComment
type: Comment
has text: `var id = "//www.youtube.com/embed/" + idu.substr(27,37);` Check if this works. Seems like you missed a `+`.
score: 1

http://stackoverflow.com/comment/44051490
type: Comment
has text: The `font-family` names of the new `@font-face` declarations must match "Arial" and "Nyala", if you want them to change. You could just take, say, `/fonts/HELVETICA.otf` and declare it with `font-family:Arial;`.
type: AnswerComment
comment on: http://stackoverflow.com/a/27822764
score: 0

http://stackoverflow.com/q/27957427
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44309433
has body: I have two groups that have a radio button. What it does is, when a package above is chosen, the chosen package below should be the same from the above, vice-versa. Example is if I choose "Deluxe" in the first one, the other one should also be "Deluxe". The problem is, when I choose, "Deluxe" at the top, the other package is still on the previous selection. At first try, everything is working but when you try selecting again, the problem occurs. Also I want to highlight the selected package. The other part of the code is here Html ECONOMY $49 DELUXE $79 ULTIMATE $149 Choose Package Choose Package ECONOMY $49 DELUXE $79 ULTIMATE $149
has answer: http://stackoverflow.com/a/27957678
has title: jquery not functioning for radio button
has answer: http://stackoverflow.com/a/27957573
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27957619
score: 0
has answer: http://stackoverflow.com/a/27958338
has answer: http://stackoverflow.com/a/27957619
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27957678
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4

http://stackoverflow.com/a/27928098
has comment: http://stackoverflow.com/comment/44293366
type: AcceptedAnswer
downvote count: 0
has body: Agree with @marc. Just to add more information, do this. Download Above can be url link to download and below will be php code in download.php //code to update download count (UPDATE tbl_dwn SET total = total + 1) //below is code to download (hope you know it) $zipName = $_GET['file']; //here you've to specify the absolute path to the download.zip file header("Content-type: application/zip"); header("Content-Disposition: attachment; filename=".$zipName.""); header("Content-length: " . filesize($zipName)); header("Pragma: no-cache"); header("Expires: 0"); readfile($zipName); Try out this and let me know if you've any problem.
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27927820
has comment: http://stackoverflow.com/comment/47132218
answers question: http://stackoverflow.com/q/27927820
score: 1

http://stackoverflow.com/q/27907896
has body: I'm working on removing ajax calls from select2. I have a static list of objects populating the dropdown. The workflow I'm looking at is... User clicks the select2 User types into the search box (and results are displayed) User makes a selection and a new webpage loads. At this point, I want to prepopulate the search term with what the user initially searched for, so that the user can just click the box and have it prepopulated with the results list that they selected from to get to this page. However I do not want to tamper with the available options in the static list. I.E. User types in "ABC", and they have a list of "ABC Company" "ABC Person" and "ABC Entity" show up to choose from. User chooses "ABC Person" so they're taken to the ABC Person page. User sees that this is not the page they were looking for. User clicks the search box again, and the select2 box has "ABC" in the search term area and a list of "ABC Company" "ABC Person" and "ABC Entity" automatically displayed (as if they just searched for "ABC"). User can backspace and type in "XYZ" and a new list of "XYZ Company" "XYZ Person" "XYZ Entity" shows up without making any ajax calls. Currently I can programmatically set the search term value, but I cannot figure out how to trigger the change event on the .select2-input box to get the results to open up and load.
downvote count: 0
accepted answer: http://stackoverflow.com/a/27908744
tagged with: jquery
favorite count: 0
tagged with: jquery-select2
possible better answer: http://stackoverflow.com/a/73042959
has answer: http://stackoverflow.com/a/73042959
has title: Select2 Programmatically set search terms and open dropdown with relevant results (no ajax calls)
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27908744
type: Question
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/30517128
upvote count: 4
answer count: 2

http://stackoverflow.com/a/27975947
has body: Take a look on this: http://www.threejsgames.com/extensions/#threex.objcoord It includes a translation of 3D to Screen Position, is this what you want?
score: 0
has comment: http://stackoverflow.com/comment/44359884
has comment: http://stackoverflow.com/comment/44361034
type: Answer
answers question: http://stackoverflow.com/q/27960974

enyo
tags question: http://stackoverflow.com/q/27809683
type: Tag
tag name: enyo

javascript
tags question: http://stackoverflow.com/q/27818723
tags question: http://stackoverflow.com/q/27900469
tags question: http://stackoverflow.com/q/27866328
tags question: http://stackoverflow.com/q/27862298
tags question: http://stackoverflow.com/q/27821363
tags question: http://stackoverflow.com/q/27876429
tags question: http://stackoverflow.com/q/27905790
tags question: http://stackoverflow.com/q/27823339
tags question: http://stackoverflow.com/q/27890274
tags question: http://stackoverflow.com/q/27942819
tags question: http://stackoverflow.com/q/27888193
tags question: http://stackoverflow.com/q/27923586
tags question: http://stackoverflow.com/q/27856975
tags question: http://stackoverflow.com/q/27934624
tags question: http://stackoverflow.com/q/27804707
tags question: http://stackoverflow.com/q/27816497
tags question: http://stackoverflow.com/q/27945592
tags question: http://stackoverflow.com/q/27906450
tags question: http://stackoverflow.com/q/27887391
tags question: http://stackoverflow.com/q/27962752
tags question: http://stackoverflow.com/q/27906485
tags question: http://stackoverflow.com/q/27850065
tags question: http://stackoverflow.com/q/27826678
tags question: http://stackoverflow.com/q/27901474
tags question: http://stackoverflow.com/q/27869310
tags question: http://stackoverflow.com/q/27810594
tags question: http://stackoverflow.com/q/27885060
tags question: http://stackoverflow.com/q/27840570
tags question: http://stackoverflow.com/q/27921553
tags question: http://stackoverflow.com/q/27823770
tags question: http://stackoverflow.com/q/27844786
tags question: http://stackoverflow.com/q/27865536
tags question: http://stackoverflow.com/q/27906901
tags question: http://stackoverflow.com/q/27910409
tags question: http://stackoverflow.com/q/27880183
tags question: http://stackoverflow.com/q/27956178
tags question: http://stackoverflow.com/q/27950662
tags question: http://stackoverflow.com/q/27840135
tags question: http://stackoverflow.com/q/27836020
tags question: http://stackoverflow.com/q/27929596
tags question: http://stackoverflow.com/q/27947844
tags question: http://stackoverflow.com/q/27807580
tags question: http://stackoverflow.com/q/27820980
tags question: http://stackoverflow.com/q/27920105
tags question: http://stackoverflow.com/q/27832236
tags question: http://stackoverflow.com/q/27960533
tags question: http://stackoverflow.com/q/27879677
tags question: http://stackoverflow.com/q/27838652
tags question: http://stackoverflow.com/q/27806651
tags question: http://stackoverflow.com/q/27849013
tags question: http://stackoverflow.com/q/27889764
tags question: http://stackoverflow.com/q/27911366
tags question: http://stackoverflow.com/q/27869769
tags question: http://stackoverflow.com/q/27894030
tags question: http://stackoverflow.com/q/27952808
tags question: http://stackoverflow.com/q/27937640
tags question: http://stackoverflow.com/q/27806141
tags question: http://stackoverflow.com/q/27852429
tags question: http://stackoverflow.com/q/27831999
tags question: http://stackoverflow.com/q/27888274
tags question: http://stackoverflow.com/q/27953074
tags question: http://stackoverflow.com/q/27857000
tags question: http://stackoverflow.com/q/27939873
tags question: http://stackoverflow.com/q/27949887
tags question: http://stackoverflow.com/q/27848916
tags question: http://stackoverflow.com/q/27930885
tags question: http://stackoverflow.com/q/27852955
tags question: http://stackoverflow.com/q/27866619
tags question: http://stackoverflow.com/q/27855584
tags question: http://stackoverflow.com/q/27914871
tags question: http://stackoverflow.com/q/27908232
tags question: http://stackoverflow.com/q/27889337
tags question: http://stackoverflow.com/q/27847965
tags question: http://stackoverflow.com/q/27910945
tags question: http://stackoverflow.com/q/27881387
tags question: http://stackoverflow.com/q/27828374
tags question: http://stackoverflow.com/q/27938481
tags question: http://stackoverflow.com/q/27957720
tags question: http://stackoverflow.com/q/27854447
tags question: http://stackoverflow.com/q/27906500

http://stackoverflow.com/q/27856278
has body: So I've been struggling with the javascript routing in scala Play! I've added the routes in my routes file: GET /javascriptRoutes controllers.Application.javascriptRoutes and this is the route I want to add to the javascriptRoutes GET /winkelwagen/add/:id controllers.Application.addProductToWinkelwagen(id:Int) Then when I try to add the code for the generating of the javascript in my controller it says it can't resolve javascript (from routes.javascript) def javascriptRoutes = Action { implicit request =&gt; import routes.javascript._ Ok( Routes.javascriptRouter("jsRoutes")( routes.javascript.Application.addProductToWinkelwagen() ) ).as("text/javascript") } I've added these to the source classes in project structure but that didn't work: target/scala-XXX/classes_managed target/scala-XXX/src_managed/main I'm using IntelliJ Idea professional. I hope someone can help me, Thanks!
tagged with: playframework
tagged with: intellij-idea
answer count: 1
has title: javascriptRouting in Play! Scala
type: UnansweredQuestion
tagged with: scala
has answer: http://stackoverflow.com/a/27856459
tagged with: javascript
type: Question
score: 0

http://stackoverflow.com/comment/44102066
type: Comment
has text: I update fiddle as you suggest: http://jsfiddle.net/2j1obh92/2/ but no success popups aren't shown at all
comment on: http://stackoverflow.com/a/27848605
type: AnswerComment
score: 0

http://stackoverflow.com/comment/123454982
has text: @Xaqron's one-line was more than enough for me, with just a simple fix for undefined properties in the destination object. I also returned the merged object, so to use inline `const merge = (p, c) => Object.keys(p).forEach(k => (p[k] instanceof Object && c[k] instanceof Object) ? merge(p[k], c[k]) : c[k] = p[k]) ?? c`
score: 0
comment on: http://stackoverflow.com/q/27936772
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27919077
has answer: http://stackoverflow.com/a/27920952
score: 1
upvote count: 1
type: Question
has title: panel's setTitle() function does not publish to the panel's viewModel
tagged with: javascript
has body: When I call the setTitle function of extjs panel component, the title update immediately, but the viewModel bind to the it does not change!. Code is as below : Ext.application({ name: 'Fiddle', launch: function() { var textfield = Ext.create('Ext.form.field.Text', { itemId: 'textfieldItem', fieldLabel: 'fjdks', bind: '{customer.name}' }); var panel = Ext.create('Ext.form.Panel', { viewModel: {}, bind: { title: '{customer.name}' }, renderTo: Ext.getBody(), items: [textfield] }); panel.setTitle('123'); Ext.Msg.alert('Fiddle', panel.getViewModel().get('customer.name'), function() { textfield.setValue('rrrrr'); Ext.Msg.alert('Fiddle', panel.getViewModel().get('customer.name')); }); } }); See Sencha fiddle
tagged with: extjs
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27942582
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27956370
has comment: http://stackoverflow.com/comment/57084803
upvote count: 3
type: UnansweredQuestion
type: Question
score: 3
has body: I'm using the $resource service to access and update resource on my API. However, I am having a problem when the value of the object bound to an ng-model is set to empty. The bound element gets deleted from the object. Thus, when saving my resource the element is not present on the passed data. angular.module('myApp', []) .controller('myCtrl', function($scope, $resource) { var Person = $resource('persons/:id.json', {id: @id}); $scope.data = Person.get({id:123}); }); For example: data.name is set to '' in the template below: &lt;div ng-controller="myCtrl"&gt; &lt;input type="text" ng-model="data.name" /&gt; &lt;input type="button" ng-click="data.$save()" value="Save" /&gt; &lt;/div&gt; I need the element present on the passed data when saving because it will determine if the API will set the actual value of the attribute to empty. Otherwise, the attribute doesn't get updated and it retains its old value.
answer count: 1
downvote count: 0
tagged with: javascript
has title: ng-model deletes element from object if the value is empty

http://stackoverflow.com/a/37387418
downvote count: 0
type: Answer
has body: You can get profile photo via following URL directly (No need to use a access token): https://apis.live.net/v5.0/{USER_ID}/picture?type=large Just replace your user id in the URL above. You can get different sizes of a user's picture, where SIZE is one of the following: small (to get a 96 × 96-pixel picture), medium (180 × 180), or large (360 × 360). If a particular size picture doesn't exist, the next-largest size picture that's available is returned. In any event, a 96 × 96-pixel picture is returned (unless no picture is associated with the user, in which case a default user picture is returned). For more information, you can visit here.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27861663
has comment: http://stackoverflow.com/comment/83136431

http://stackoverflow.com/q/27886154
accepted answer: http://stackoverflow.com/a/27886341
tagged with: hidden-field
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27886341
type: Question
score: 0
has title: How to combine values from three different fields and set it to the hidden field only when all the three fields are filled with values?
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: string-concatenation
has body: I've six fields on a form for showing the start time and end time in Hour: Minutes AM/PM format as follows : Starts at : hh 1 2 3 4 5 6 7 8 9 10 11 12 mm 00 05 10 15 20 25 30 35 40 45 50 55 AM PM Ends at : hh 1 2 3 4 5 6 7 8 9 10 11 12 mm 00 05 10 15 20 25 30 35 40 45 50 55 AM PM Now there are two hidden fields present on the form as follows : Now what I want to do is when user selects all the values from the respective drop downs only then the selected values should get combined and should be stored in respecive hidden fields. For example if user selects Start Time as follows 2 from Hour, 30 from Minutes and PM then the string to be formed and to be stored should be 02:35 PM. Same should be applicable to end date. If anything is missing proper alert message should appear. How should I achieve this using jQuery/Javascript? Thanks.
tagged with: html-select

http://stackoverflow.com/comment/44314669
comment on: http://stackoverflow.com/q/27959861
has text: @MorganFeeney: nope, none of these images float. Please find a complete html section sample in *Edit 2*.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/34802515
score: 0
type: Answer
has body: I've just released a bower component angular-stretch that does this
answers question: http://stackoverflow.com/q/27960957

http://stackoverflow.com/a/27859518
type: Answer
score: 2
has body: You can force the first character to be aphabet, and then alphabet or spaces as /^[a-zA-Z][a-zA-Z\s]+$/ This ensures that the input filed will not contains spaces alone "asdf asdf".match(/^[a-zA-Z][a-zA-Z\s]+$/) =&gt; True " ".match(/^[a-zA-Z][a-zA-Z\s]+$/) =&gt; False
answers question: http://stackoverflow.com/q/27859353
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27859353
type: AcceptedAnswer
upvote count: 2

http://stackoverflow.com/q/27854321
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27854411
answer count: 2
has body: I am trying to find a regular expression that detects when a string has two periods. When this condition has been met, it deletes all the characters up to (and including) the first period. string: "abc.def.ghi" abc. would be removed, and we have: "def.ghi" I've recently learned I can't use conditionals in javascript regex. Is there a solution in regular javascript? Regex code I have so far /\.[^.]*\.?/
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27854364
has title: Javascript regex conditional statement when two of same character detected in string
tagged with: regex
possible better answer: http://stackoverflow.com/a/27854364
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27854411
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/27865223
score: 0
answers question: http://stackoverflow.com/q/27864989
has body: A one-liner. This won't work in all browsers because of the map function : Math.max.apply(null, users.map(function(elem) { return +elem.score;}))
type: Answer

http://stackoverflow.com/q/27885060
has answer: http://stackoverflow.com/a/27887944
tagged with: javascript
score: 4
has title: Chrome extension: get current site name
upvote count: 4
has comment: http://stackoverflow.com/comment/44171714
has body: I just get started building my first Chrome extension. One functionality in my app is to get the name of the current site. For example, if the current url matches "*://*.facebook.com/", I would interpret this url and know the site name as Facebook. How should I go about doing this?
answer count: 2
accepted answer: http://stackoverflow.com/a/27886147
tagged with: google-chrome-extension
downvote count: 0
has comment: http://stackoverflow.com/comment/44171737
favorite count: 0
has comment: http://stackoverflow.com/comment/44171693
has comment: http://stackoverflow.com/comment/44172269
has comment: http://stackoverflow.com/comment/44171800
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44173383
has answer: http://stackoverflow.com/a/27886147
type: Question
possible better answer: http://stackoverflow.com/a/27887944

http://stackoverflow.com/comment/44125812
score: 0
type: Comment
has text: Not possible, the browser needs to know the url in order to open it, this is trivial for any one to see (F12 > Network Inspector for example) You would need to implement some kind of authentication scheme/user registration
type: QuestionComment
comment on: http://stackoverflow.com/q/27861740

http://stackoverflow.com/q/27958343
favorite count: 0
has comment: http://stackoverflow.com/comment/44310853
has body: I have two pages called as "Form_1.html" and "Form_2.html". "Form_1.html" is the parent window from which i am opening "Form_2.html" using window.open() method. Now what i want is that when i write window.close() in the child window("Form_2.html") i want the focus to return back to "Form_1.html" and the parent window should get refreshed. I want it in javascript only because i cannot use jquery(because it is not allowed). Thank you in advance
linked to: http://stackoverflow.com/q/5660700
has title: Returning focus to the parent window from child window
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27958523
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27958523
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/44295745
score: 2
comment on: http://stackoverflow.com/q/27950300
has text: Not sure I'm fully understanding, but this might help: http://stackoverflow.com/questions/4524000/turn-off-chrome-safari-spell-checking-by-html-css
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27961429
score: 0
has answer: http://stackoverflow.com/a/27968745
accepted answer: http://stackoverflow.com/a/27968745
type: AnsweredQuestion
tagged with: sapui5
has title: Custom control rendering twice
type: Question
answer count: 1
tagged with: javascript
has body: I am extending sap.ui.unified.Calendar with a custom control, overriding the renderDays() function, to place an extra span tag in each day div. The console indicates the hours array is undefined. It throws the error found below, but continues to work afterwards. This error prevents using the header arrows to move between months in the calendar. Is this rendering twice? Why is hours[] undefined at first but ok after? If I put all the code into a single file JSBin, it does not error. JSBin The top of the code for the custom control: sap.ui.unified.Calendar.extend("control.TimeCalendar", { metadata : { properties : { "hoursData" : "string[]" } }, renderer: { renderDays: function(oRm, oCal, oDate){ var hours = oCal.getHoursData(); Console output: Cannot read property 'length' of undefined Excerpt from the custom control TimeCalender.js. This is inside the do...while loop which places each day on the calendar. Where the function places the date, I also include a span tag with a number retrieved from the array 'hours'. oRm.write("&lt;span class=\"sapUiCalDayNum\"&gt;"); if ( (hours.length&gt;i) &amp;&amp; (hours[i].day == oDay.getUTCDate()) ) { oRm.write("&lt;span class=\"hours\"&gt;"); oRm.write(hours[i].hours); oRm.write("&lt;/span&gt;"); if(i &lt;= hours.length) { i++; } } oRm.write(oDay.getUTCDate()); oRm.write("&lt;/span&gt;");

http://stackoverflow.com/a/27823268
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has body: Does this work? I've never personally used the LiveValidation library but after looking at the API I guess this will work. You need to store a reference to the validator somewhere outside the function (in a higher scope) and use the add and remove methods to control the UI. See for more info: http://livevalidation.com/documentation#LiveValidationRemove var validator = new LiveValidation('text_2', {insertAfterWhatNode : "errore_base"}) function updatethis(form) { var action = 'remove'; if (tipo1 == 8) { action = 'add'; } window.addEvent('domready', function(){ validator.add(Validate.Numericality, { maximum: 250, tooHighMessage: "Max 250cm" }); }); }
accepted answer of: http://stackoverflow.com/q/27822339
has comment: http://stackoverflow.com/comment/44052389
answers question: http://stackoverflow.com/q/27822339
upvote count: 1

http://stackoverflow.com/q/27893251
type: UnansweredQuestion
tagged with: sockets
has comment: http://stackoverflow.com/comment/44263696
upvote count: 1
tagged with: node.js
has title: How can I disconnect a socket.io client by it's id using redis?
score: 1
has body: BEFORE YOU MARK THIS QUESTION AS A DUPLICATE THERE IS ONE REQUIREMENT! It needs to work with multiple servers (i.e. socket.io-redis) and it needs to work with socket.io version 1.2.1. Similar questions such as Socket.io disconnect client by id or SocketIO: disconnect client by socket id? do not fufill both of those requirements.
tagged with: socket.io
has comment: http://stackoverflow.com/comment/44263401
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/24463447
downvote count: 0
linked to: http://stackoverflow.com/q/25976501
has comment: http://stackoverflow.com/comment/44263373
has comment: http://stackoverflow.com/comment/44288745
favorite count: 0
tagged with: redis
has comment: http://stackoverflow.com/comment/44271494
answer count: 0

http://stackoverflow.com/comment/44200638
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27900384
has text: When using `createElement` or `innerHTML`, what exactly did not work? Those methods are fine to build dynamic HTML and I can assure you that they work. If you think you have a bug in your code, please post that code (the one with `createElement` or `innerHTML` in it…) to get help from others.
score: 1

http://stackoverflow.com/comment/44088063
type: Comment
type: QuestionComment
has text: if the objects come from the same place and are indeed the same objects, any Array.uniuqe routine will work. if the objects are consistent in key-order, then you can compare the JSON.stringify() version of each to find duplicates via string compares (at least for now).
comment on: http://stackoverflow.com/q/27841967
score: 0

http://stackoverflow.com/comment/44189460
type: Comment
comment on: http://stackoverflow.com/a/27893626
score: 0
type: AnswerComment
has text: It does make sense, but you'll have to add a redirect to poultry.index if you want both (show default and keep active) to work.

http://stackoverflow.com/q/27848800
has comment: http://stackoverflow.com/comment/44102057
has answer: http://stackoverflow.com/a/27850103
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27850103
has title: animate a queue elements in ng-repeat
upvote count: 1
possible better answer: http://stackoverflow.com/a/45854554
has answer: http://stackoverflow.com/a/45854554
favorite count: 0
has body: So I have a controller like so: var control = angular.module('controllers', []); control.controller('aboutme', ['$scope', function($scope) { $scope.tabs = [{ "title": "interests", "list": ["cats", "kittens"] }, { "title": "hobbies", "list": ["petting kittens", "playing with kittens", "writing bad stack overflow questions"] }] } ]); Then within my html, I have the following (using angular-directives addon) &lt;div bs-tabs&gt; &lt;div ng-repeat="tab in tabs" title="{{ tab.title }}" bs-pane&gt; &lt;ul&gt; &lt;li ng-repeat="i in tab.list"&gt;{{ i }}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; This will effectively make the tabs and list appear on page. However, what I am trying to do is make each animate in series one after the other. Ie, when one finishes animating, animate the next. How would this be done in angular?
tagged with: angularjs
tagged with: animation
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44102456
downvote count: 0
score: 1
type: Question
answer count: 2

http://stackoverflow.com/a/27833907
has comment: http://stackoverflow.com/comment/44073542
type: Answer
has comment: http://stackoverflow.com/comment/44073682
has comment: http://stackoverflow.com/comment/44073168
has comment: http://stackoverflow.com/comment/44073187
has body: The validator is within a click handler, which should live outside of that (On the base on the document.ready()). Also if you just want to validate when that checkbox is clicked you could check it within the javascript and select it via the name of the checkbox (If it has a unique ID each time). function formValidator(){ var age = document.getElementsByName('age[]'); if($("input[name = 'chk[]']").prop('checked')){ for (var i = 0; i&lt; age.length; i++) { if(!isNumeric(age[i], "Please enter a valid Age")){ return false; } } } return true; }
accepted answer of: http://stackoverflow.com/q/27833713
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27833713
score: 0

http://stackoverflow.com/comment/44085756
comment on: http://stackoverflow.com/a/27841041
type: Comment
has text: This did get the scroll to work, on the other hand it also seemed to override the loading of the new HTML doc so it scrolls to the bottom of the HTML 1 doc instead of the HTML 2 doc...
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44302183
type: QuestionComment
has text: display: none doesn't block access to content; it simply hide it, but it's still visible in source
comment on: http://stackoverflow.com/q/27953389
score: 1
type: Comment

http://stackoverflow.com/q/27891856
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44184870
score: 0
has comment: http://stackoverflow.com/comment/44184924
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44185513
has comment: http://stackoverflow.com/comment/44184899
type: UnansweredQuestion
has title: Dropdown menu to link
tagged with: php
has comment: http://stackoverflow.com/comment/44186487
has body: Im trying to create a menu that open a page based on the option selected. my js &lt;script type="text/javascript" language="JavaScript"&gt; function goToNewPage() { if(document.getElementById('target').value){ window.location.href = document.getElementById('target').value; } } my form &lt;form class="smart-green" name="dropdown"&gt; &lt;select name="list" id="target"&gt; &lt;? include_once ("xxxx"); $sql = mysql_query("xxxx"); while($row = mysql_fetch_assoc($sql)) {?&gt; &lt;option value="http://www.xxxx.co.uk/content.php?id=guide&amp;sub=dog&amp;breed=&lt;? echo $row['id'];?&gt;"&gt;&lt;? echo $row['breed'];?&gt;&lt;/option&gt;"; &lt;? } ?&gt; &lt;/select&gt;&lt;br /&gt;&lt;br /&gt; &lt;input type="submit" class="button" onClick="goToNewPage(document.dropdown.list)" value="Find Breed"&gt; &lt;/form&gt; however the page opens as http://www.xxxx.co.uk/content.php?list=http%3A%2F%2Fwww.xxxx.co.uk%2Fcontent.php%3Fid%3Dguide%26sub%3Ddog%26breed%3D2 instead of http://www.xxxx.co.uk/content.php?id=guide&amp;sub=dog&amp;breed=2 from what i can tell its an encoding error but i cannot figure out what to do about it, also the link isnt quite correct any help appreciated.
has answer: http://stackoverflow.com/a/27892680
has comment: http://stackoverflow.com/comment/44185021
type: Question
tagged with: encoding

http://stackoverflow.com/q/27923529
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44244132
possible better answer: http://stackoverflow.com/a/37017601
has answer: http://stackoverflow.com/a/37017601
has title: $asyncValidators Angular
score: 1
upvote count: 1
tagged with: http
has comment: http://stackoverflow.com/comment/44244076
type: AnsweredQuestion
has body: I am using Angular 1.3.* and I try to validate my form. It is within a ng-repeat. So I may obtain several input fields. I do not only require the field to be not empty, but also require the search to be successful when retrieving information from the backend. I have this input field You need to type something It seems that the entered user is not a valid input here is my try for the backendCall .directive('userValidator',function($http,$q){ return{ require:'ngModel', link:function($scope,element,attrs,ngModel){ ngModel.$asyncValidators.userAvailable=function(userInput){ return $http.post('/user'+userInput) .then(function)???? } } } }); Note, that I WANT the user to exist. I guess I'll have to make a backend call with asyncValidators. However, I do not seem to get it. A way for me to circumvent this would be to say that on ALL other $errors than "required", show the message "It seems that the entered user is not a valid input". How could I do a successful backend call and use it or alternatively, how can I make sure to show the other error message on all other occasions?
tagged with: javascript
has answer: http://stackoverflow.com/a/27925588
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27925588
tagged with: validation
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/27954098
type: Question
score: 3
has title: grunt usemin and IE conditional comments
tagged with: gruntjs
upvote count: 3
tagged with: javascript
favorite count: 0
has body: Supposedly, I have something like this in my index.html &lt;!-- build:js lib.js --&gt; &lt;!--[if (!IE)|(gt IE 8)]&gt;&lt;!--&gt;&lt;script src="lib/jquery/jquery.js"&gt;&lt;/script&gt;&lt;!--&lt;![endif]--&gt; &lt;!--[if lte IE 8]&gt;&lt;script src="lib/jquery/jquery-ie8.js"&gt;&lt;/script&gt;&lt;![endif]--&gt; &lt;script src="lib/jquery-ui/jquery-ui.js"&gt;&lt;/script&gt; &lt;script src="lib/bootstrap/bootstrap.js"&gt;&lt;/script&gt; &lt;!-- endbuild --&gt; I'm using useminPrepare/usemin along with concat and uglify, to combine all javascript files into one, uglify them and then replace the reference in resulting html, pointing to just this one file. This works fine if you can narrow it down to single blocks. But what with the situation above? Obviously, I don't want it to pack both versions of jquery into one file. I would like it to split into two paths, creating two versions of lib.js - one combining all common files plus files from within certain IFs, the other - all common files plus files from the other IF. Is something like this possible? AFAIK, usemin is really plain and all it can do is just parse single blocks. You cannot close one block and then open it again (it will complain). You cannot open one block and continue it later. What are your solutions for this, supposedly frequent, problem? I suppose I could split it into more separate blocks, but then the point of minification and concatenation onto one file is sort of moot. Ideally, I would like it to traverse certain path through html, gather all files and build them into one file, then traverse, go another path and build another file (i.e. one for ie8 and the other for rest). Any thoughts here?
downvote count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44239403
score: 0
has text: @Antonio. Yes this what has been reported. https://code.google.com/p/google-apps-script-issues/issues/detail?id=4611
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27912715

http://stackoverflow.com/comment/44259506
has text: Invoke the function (`function()`) to get your array.
score: 0
comment on: http://stackoverflow.com/q/27930938
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44176676
has text: You can use other methods for storing and getting cell id. Read about jQuery Data: http://api.jquery.com/jquery.data/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27887734
type: Comment

http://stackoverflow.com/a/27826578
type: Answer
has comment: http://stackoverflow.com/comment/44213576
has comment: http://stackoverflow.com/comment/44128796
has comment: http://stackoverflow.com/comment/44212108
has comment: http://stackoverflow.com/comment/44089618
type: AcceptedAnswer
has body: I've updated this to use broadcas as you've requested, now your controller will be registered to the event newMessageReceived and will update every 5 seconds. Also, this acts more as a service, so I've updated the module to be a service and not a factory. Please note that I changed timer.then(setNew, handleError); to timer.then(setNew(), handleError); .controller('checkNew', function($scope, messageService, getNewAct, $localstorage, $cordovaLocalNotification, $http, $state) { //register to broadcast and update when the messages are updated messageService.newMessageReceived($scope, updateMessage) function updateMessage(message) { if(message){ $scope.addActivity(message); $scope.counterAct = message; } else { $scope.cancelAllNotification } } }); .service('messageService', function($rootScope, $http, $localstorage, $timeout){ /* Initialization */ //setup timer to run every 5 seconds var timer = $timeout(timeoutFunction, 5000); //set the actions for resolve and reject timer.then(setNew(), handleError); function timeoutFunction() { return; } function handleError() { console.log('Timer rejected'); } //every time the newMessageRecieved event is broadcasted, run the callback and register the scope function newMessageReceived(scope, callback) { callback(getNew()); scope.$on('newMessageReceived', function() { callback(getNew()); }); } function getNew() { return $localstorage &amp;&amp; $localstorage.message || undefined; } function setNew() { var user_id = $localstorage.get('user_id'); return $http.post('http://www.digitalxp.it/appwork/include/check_msg.asp?id='+user_id) .success(function(data){ $localStorage.message = data; $rootScope.$broadcast('newMessageReceived'); }) .error(function(){alert("Errore di comunicazione!")}) } return { newMessageReceived: newMessageReceived }; });
has comment: http://stackoverflow.com/comment/44139127
accepted answer of: http://stackoverflow.com/q/27825802
has comment: http://stackoverflow.com/comment/44212350
score: 0
answers question: http://stackoverflow.com/q/27825802
has comment: http://stackoverflow.com/comment/44132885
has comment: http://stackoverflow.com/comment/44120664

http://stackoverflow.com/q/27893126
tagged with: jquery
tagged with: sorting
score: 0
has body: I am trying to sort through some JSON to create a list of the data where only certain rows are shown. I have some code that displays the data the way I want to display it, it just isn't sorted the way I want it. Here is the working code for the pre-sorted data: Search Clear Results Here is the JSON // API callback JSONP({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gsx":"http://schemas.google.com/spreadsheets/2006/extended","id":{"$t":"https://spreadsheets.google.com/feeds/list/1z7X-IvfauqyWul4oh_46e471nNt13ZpNhyXSIm_NXKI/ow6ewk2/public/values"},"updated":{"$t":"2015-01-08T04:27:29.693Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"Source Page"},"link":[{"rel":"alternate","type":"application/atom+xml","href":"https://docs.google.com/spreadsheets/d/1z7X-IvfauqyWul4oh_46e471nNt13ZpNhyXSIm_NXKI/pubhtml"},{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/1z7X-IvfauqyWul4oh_46e471nNt13ZpNhyXSIm_NXKI/ow6ewk2/public/values"},{"rel":"http://schemas.google.com/g/2005#post","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/1z7X-IvfauqyWul4oh_46e471nNt13ZpNhyXSIm_NXKI/ow6ewk2/public/values"},{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/1z7X-IvfauqyWul4oh_46e471nNt13ZpNhyXSIm_NXKI/ow6ewk2/public/values?alt=json-in-script"}],"author":[{"name":{"$t":"joshuam.hess"},"email":{"$t":"joshuam.hess@yourkickstart.org"}}],"openSearch$totalResults":{"$t":"4"},"openSearch$startIndex":{"$t":"1"},"entry":[{"id":{"$t":"https://spreadsheets.google.com/feeds/list/1z7X-IvfauqyWul4oh_46e471nNt13ZpNhyXSIm_NXKI/ow6ewk2/public/values/cokwr"},"updated":{"$t":"2015-01-08T04:27:29.693Z"},"category":[{"scheme":"http://schemas.google.c…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27893280
has comment: http://stackoverflow.com/comment/44187546
has comment: http://stackoverflow.com/comment/44187437
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: Sorting JSON by entry values
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44119191
score: 0
type: Comment
type: QuestionComment
has text: @atmd Yes. But i start with show()... but it doesn't show de div-element
comment on: http://stackoverflow.com/q/27858170

http://stackoverflow.com/q/27956857
tagged with: jquery
has comment: http://stackoverflow.com/comment/44308345
tagged with: ajax
has comment: http://stackoverflow.com/comment/44308445
score: 0
type: UnansweredQuestion
tagged with: ruby-on-rails
has body: I have a Rails 4.1 controller action called "show" that renders a page with a contact form. When the user hits "Send Now" on the contact form, I want a message notification that will be appended to the "#participant_notification" div id. Now, when I have all the form fields filled out correctly, a new kite detail is created in the database, however a success message is not appended to #participant notification in the show.html.haml page. Neither is an error message. What is going wrong? show.html.haml with form: = form_for @kite_detail, as: :kite_detail, url: send_wind_questions_path, html: { method: :post }, remote: true do |f| %p Send questions about this kite to us .input-group %span %i.fa.fa-user = f.text_field :full_name, placeholder: "Full Name" .input-group %span %i.fa.fa-envelope-o = f.text_field :email, placeholder: "Email address" .input-group .left = f.radio_button :message, "I would like more information about this kite." %div.right I would like more information about this kite. .left = f.radio_button :message, "I, or someone I know would be interested in participating in this kite." %div.right I, or someone I know would be interested in participating in this kite. .left = f.radio_button :message, "I would like to collaborate with the designer." %div.right I would like to collaborate with the designer. = f.submit "Send Now", class: "kite-form-button", id: "participant-kite-form" #participant_notification I also have a controller action send_wind_questions def send_wind_questions @kite_detail = Kite.new(kite_detail_params) if @kite_detail.save puts "success" flash[:success] = "Your message has been sent." else puts "error" flash[:error] = "You didn't specify name, email, or some other error occurred." end render nothing: true end Here is my ajax javascript: $('form#new_kite_detail').submit(function() { var valuesToSubmit = $(this).serialize(); console.log(valuesToSubmit); $.ajax({ type: "POST", url: "/send_wind_questions", data: valuesToSubmit, dataType: …
has comment: http://stackoverflow.com/comment/44308404
answer count: 0
has title: Why is this ajax request not appending to the show page at the bottom of the form in Rails 4?
tagged with: forms
has comment: http://stackoverflow.com/comment/44308357
type: Question
has comment: http://stackoverflow.com/comment/44308321
has comment: http://stackoverflow.com/comment/44308268
tagged with: javascript

http://stackoverflow.com/comment/44116433
score: 0
has text: Adding a minimum width to your image might solve your problem.
comment on: http://stackoverflow.com/q/27856565
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27844133
has answer: http://stackoverflow.com/a/27844168
accepted answer: http://stackoverflow.com/a/27844168
tagged with: javascript
answer count: 3
has body: The following code work : But this not work: On http://www.customtemplates.com.au/
downvote count: 3
possible better answer: http://stackoverflow.com/a/27844213
favorite count: 0
has answer: http://stackoverflow.com/a/27844213
has comment: http://stackoverflow.com/comment/44092178
score: -3
has answer: http://stackoverflow.com/a/27844731
type: AnsweredQuestion
upvote count: 0
has title: javascript document.write(" "); not working
type: Question

ajax-upload
tag name: ajax-upload
tags question: http://stackoverflow.com/q/27835268
type: Tag

http://stackoverflow.com/q/27856755
tagged with: javascript
tagged with: jquery
has body: I have a basic webpage that polls the backend for new/archived tweets. The returned tweets(JSON) are shown one at a time sliding into view from above the viewport, pausing at the middle and then sliding out below the viewport for the next tweet to display. Animation is via applying a Greensock tween to each tweet item and appending it to an animation timeline for playback. What are suitable ways to approach this correctly? My main concerns are with how I should insert/update the DOM with the tweet items, and any performance issues I might need to be aware of or cater to(Memory / Layout / Rendering(CSS/Images)). I am fairly new to web development. My current code uses JQuery to append each tweet into a container div, each tweet is positioned(position:fixed) outside of the viewport and visibility:hidden. I'm presently using embedded tweets with the twttr.js lib which is somewhat problematic due to several issues iframes cause. I plan to transition to my own html snippet + css/js instead. With plain html or html from template engines like Handlebars or Dust, would it still be a good idea to insert the html for the tweet item like I'm currently doing with the iframe embeds approach? I've yet to use a template engine but understand they have a feature called partials that may be more useful than declaring the html and data logic all in my JS file? The other concern I have is that as I append tweets currently, due to how the iframe embeds work they're a bit slow to render so need to be preloaded/added ahead of time, and remain in the DOM if manipulating the animation sequence timeline(rewind/fast-forward/scrubbing) due to having to reload again if added/removed. I've seen this cause performance issues with the smoothness of the animation as the amount of tweets in the DOM grows, in addition to memory I guess(not sure by how much). Switching from using twitters iframe embeds(one per tweet) is probably going to make quite a difference in itself. Is it still a good idea to k…
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: Dom Manipulation - Animation sequence on a visual element with content updating each cycle
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
downvote count: 0

oriento
type: Tag
tag name: oriento
tags question: http://stackoverflow.com/q/27917802

http://stackoverflow.com/comment/44209259
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27902910
has text: Is the model read-only? If this is your case, you can use a javascript structure (`var values =[...]`) like model directly, and access every item in delegate with "modelData" keyword. Remember that this way any changes in model won't be painted, so you should refresh the whole listview.

http://stackoverflow.com/comment/55564039
has text: `number = (number < 10) ? '0' + number: number;` if number is less than 10, add preceeding 0. Otherwise don't bother.
score: 0
comment on: http://stackoverflow.com/q/27847207
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44037655
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27815644
has text: Is the sub-pixel position causing an actual problem, or does it just seem as though it must be wrong?

http://stackoverflow.com/q/27906810
tagged with: javascript
tagged with: jshint
score: 0
has comment: http://stackoverflow.com/comment/44213526
type: UnansweredQuestion
has title: Why is jshint exported directive not working?
has comment: http://stackoverflow.com/comment/44212913
has comment: http://stackoverflow.com/comment/44213744
answer count: 0
has body: In my file matte_design.js: /*exported matte_design_change */ /*exported matte_design_populate_types */ ... function matte_design_change(cid, selected_type, x, y, opening_width, opening_height) { ... } ... function matte_design_populate_types() { ... } These functions are used in other files. Even with the exported directive I am still getting the error: 'matte_design_change' is defined but never used and 'matte_design_populate_types' is defined but never used. What am I doing wrong here?
type: Question

http://stackoverflow.com/a/27910311
has body: This script only sends data to fiddle servers which in turn send it back. It then update the value of the input. It's just a little example but it might help you to get the idea: var data_sent = 1; setInterval(function () {// Set interval to retrieve info every 1s. $.ajax({ url: "/echo/json/",// URL provided by jsfiddle to try AJAX. It just echoes back. type: 'POST',// jsfiddle imposes that you use POST for that url. data: { json: JSON.stringify(data_sent)// Send data, it'll be echoed by jsfiddle script, the format is also imposed by jsfiddle. }, success: function (data) { $("#myInput").val(data);// Put the data received in the input data_sent += 1;// change the data so that you send new one to the server next time. } }) }, 1000);
answers question: http://stackoverflow.com/q/27909978
score: 0
type: Answer

http://stackoverflow.com/comment/44221469
type: AnswerComment
comment on: http://stackoverflow.com/a/27909602
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68682/discussion-between-tyr-and-gv0000).
score: 0

http://stackoverflow.com/q/27960950
possible better answer: http://stackoverflow.com/a/27960999
has answer: http://stackoverflow.com/a/27960999
accepted answer: http://stackoverflow.com/a/27961645
type: AnsweredQuestion
has body: I am trying to implement the following code but the value returned to the id on page is populated with the NaN (Not a Number) error. Has anyone got any suggestions what I can do here? I have been battling this for over an hour now, so your assistance would be appreciated. setInterval( function(){ var b = $('input#ien_val').val(); var ien; for (ien = 0; ien &lt; b; ien++) { var encuser = parseInt($('#enutt'+ien).html()); var enteam = parseInt($('#enttotalday'+ien).html()); var enoffset = (encuser/enteam)*100; $('#tten' + ien).html(enoffset + '%'); } },2000); As per comments below I have added an example of my issue here http://jsbin.com/tobilonepu/1/
has answer: http://stackoverflow.com/a/27961645
type: Question
has title: NaN Javascript & Jquery error when trying to concatinate a number and a string
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27961013
has answer: http://stackoverflow.com/a/27961031
score: 0
answer count: 4
tagged with: nan

http://stackoverflow.com/q/27849231
has title: Changing value of input based on another input box and multiplied currency
has comment: http://stackoverflow.com/comment/44102661
has answer: http://stackoverflow.com/a/27849420
type: Question
possible better answer: http://stackoverflow.com/a/27849328
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27849328
has comment: http://stackoverflow.com/comment/44102680
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27849420
tagged with: jquery
has body: I am trying to set the value of an input box to be that of another input boxes' value times the price of an item. I have the currency wrapped in a span tag with a class. I need to multiply that value times the .productTextInput input text box. That value will show in the .subTotal box. How do I accomplish this? jQuery: $(".productTextInput").each(function() { $(this).change(function() { var priceAmount = $(this).parents().find(".priceAmount").text(); $(this).parents().find(".subTotal").val(parseInt($(this).val(), 10) * parseInt(priceAmount, 10)); }); }); html: American (wild) plum Prunus americana Bare Root 2' - 3' size $1.75
has comment: http://stackoverflow.com/comment/44102594
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27849558
linked to: http://stackoverflow.com/q/13232121

http://stackoverflow.com/q/27806383
tagged with: jquery
has title: On setting background in a div using jQuery and JSON...
possible better answer: http://stackoverflow.com/a/27806486
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/44021803
favorite count: 0
accepted answer: http://stackoverflow.com/a/27806498
upvote count: 1
tagged with: css
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: I've been working on a way to get an species of database with only JSON and I managed to get it working [who knew that a "js/" in the url would make it work? :'(] But that's not the problem, now I got an issue with CSS. Well, let's explain it. I have this JSON: [ { "title":"Facebook", "url":"http://www.facebook.com", "bg":"../img/facebook.png" }, { "title":"Twitter", "url":"http://twitter.com", "bg":"../img/twitter.png" } ] This Markup: &lt;section id="links"&gt; &lt;!-- here should be the &lt;a&gt;'s --&gt; &lt;/section&gt; And this JavaScript (using jQuery): $(function(){ $.getJSON('js/links.json', function(data){ $.each(data, function(index){ $("#links").append('&lt;a href="'+data[index].url+'" style="background-image:url("'+data[index].bg+'");"&gt;&lt;span&gt;'+data[index].title+'&lt;/span&gt;&lt;/a&gt;'); }); }); }); Now you say: It should work. And sure it works, but the background simply does not display. Seems that HTML goes nuts as I've seen in the inspector. Ok, then, what's wrong and what should I change?
type: Question
has answer: http://stackoverflow.com/a/27806486
has answer: http://stackoverflow.com/a/27806498
tagged with: javascript

http://stackoverflow.com/comment/44049488
score: 0
has text: @TrueBlueAussie I have added the services function
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27818260

http://stackoverflow.com/comment/44070210
has text: I think you want to fire('tap')
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27831981
score: 1

http://stackoverflow.com/comment/133029429
comment on: http://stackoverflow.com/a/44467274
score: 0
type: AnswerComment
has text: Thank you, I am also using Netlify, to host my front end code. This worked for me. Just to clear up the confusion I had, you need to create the folder "_redirects" inside your public folder then inside that new file you created add the line of code "/* /index.html 200" . Just to be clear do not include the quotations in the filename or the content that goes in the file. This was a life saver.
type: Comment

http://stackoverflow.com/comment/44169718
type: QuestionComment
has text: Your data variable is referencing a list containing arrays, not a JSON object. fyi.
comment on: http://stackoverflow.com/q/27882796
score: 0
type: Comment

http://stackoverflow.com/comment/44238941
has text: Thanks Quentin: it works. But can you explain why the operator is not recognized? Why this error message?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27920858

http://stackoverflow.com/q/27916253
possible better answer: http://stackoverflow.com/a/27917485
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27937723
type: Question
has title: use javascript code of html page in mainactivity.php
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27937723
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27917485
has body: I have created a small project.. in which i used multiple techniques.. here the concept goes: In android project I have 3 XML pages First two are the basic one, in the third page I used WebView It displays a calender (in asset folder I have my HTML page and .js, .css files which supports the calender to work) I displayed a Calender and selected date in HTML page code is: var calendarPicker1 = $("#dsel1").calendarPicker({ monthNames:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], useWheel:true, callbackDelay:500, years:1, months:3, days:4, showDayArrows:false, callback:function(cal) //this function displays the selected date { $("#wtf").html("Selected date: " + cal.currentDate); } }); Now I have to pass he selected date to database.. So I've added another function which returns the selected date code:: function getStringToMyAndroid() { var date = cal.currentDate; return date; window.AndroidApp.receiveString(date); } In MainActivity.java I've added class MyJavaScriptInterface { @JavascriptInterface void receiveString(String value) { Log.d("MyApp", value); } } myWebView.addJavascriptInterface(new MyJavaScriptInterface(), "calender"); myWebView.loadUrl("javascript:getStringToMyAndroid()"); But when I am sending that data to database ArrayList&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(); params.add(new BasicNameValuePair("bday",value); it giving error at value.. How can i pass the selected date to database.. any help in solving this will be appreciated
tagged with: android

http://stackoverflow.com/q/27962582
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44444360
favorite count: 0
has comment: http://stackoverflow.com/comment/44363590
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44363268
tagged with: text
has comment: http://stackoverflow.com/comment/44511506
score: 1
has comment: http://stackoverflow.com/comment/44320740
upvote count: 1
tagged with: average
type: Question
has answer: http://stackoverflow.com/a/27963719
has body: I am currently working on a "crowdsourced" average value calculator. The idea is to show a picture to people and ask them to guess the age of the person. Once they entered the value, I want to show them the average age the person was given. Here is what I want to do exactly : Put a form online and ask people to put on a value Store the data entered Return the mean value people put there Calculate the standard deviation so that people cannot put a value too high or too low compared to what others put. That means the average value shown will be more accurate this way. I am looking for the fastest way to do it, and here is what I thought about : Store the data in an SQL table and return the mean value through the AVG() function..but then, how would I calculate the Std. Dev ? Store the data in a txt file and use javascript to convert it to an array do the calculations. But if I get like 20,000 different values, it might be slow to do either way. ? I am quite a beginner in programming and what I propose might seem ridiculous...feel free to tell it to me ! Thank you all.
has comment: http://stackoverflow.com/comment/44467404
tagged with: javascript
has comment: http://stackoverflow.com/comment/44320708
has title: Crowdsourced average value
tagged with: mean
tagged with: sql

http://stackoverflow.com/comment/44155740
comment on: http://stackoverflow.com/a/27860934
has text: I like that, seems like a good solution. Only thing I noticed is that if the user changes the value the search still works on the old value not the new one. Any ideas on how to fix that?
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/27890384
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/27890274
downvote count: 0
answers question: http://stackoverflow.com/q/27890274
has body: The only idea I have is: var newDiv = document.createElement("div"); newDiv.prototype=new MyClass(); But I don't know if it's safe method, because I will override all html element prototype. More importantly than whether it's safe, it's pointless. :-) It creates a prototype property on the div, which does nothing to give it any methods from the MyClass instance. You could extend the element with all of the methods from MyClass.prototype (or from an instance of MyClass) by copying their references to the element. Many libraries provide a function typically called extend that does exactly that. (Here's jQuery's, here's Underscore's.) This is usually called a "mixin." There's no inheritance there, you're just grabbing the references. It's safe enough other than the usual warnings about naming conflicts on expando properties. To minimize the odds of naming conflicts, you could prefix your methods with some, well, prefix. For instance: var MyStuff = { myDoThis: function() { // ... }, myTurnGreen: function() { this.style.color = "green"; } // ...and so on... }; var div = document.createElement('div'); div.innerHTML = "This is the text of my div"; document.body.appendChild(div); Object.keys(MyStuff).forEach(function(key) { div[key] = MyStuff[key]; }); setTimeout(function() { div.myTurnGreen(); }, 500);
score: 2
type: AcceptedAnswer

http://stackoverflow.com/q/27835494
has comment: http://stackoverflow.com/comment/44075690
has body: I have one main page which includes side menus & iframe. When user click on any menu, It opens new page in iframe. Side menus will be as it is. Now, I am getting height issue when any page content changes. My code : // Menus... // New Page Content which will open... So, is there any way to set content or frameData height from New HTML Page. Then, It will solve my problem. Or any better proper solution for this ?
tagged with: css
score: 0
tagged with: iframe
has comment: http://stackoverflow.com/comment/44076119
linked to: http://stackoverflow.com/q/9162933
has title: iframe height issue when content changes
duplicate of: http://stackoverflow.com/q/9162933
type: UnansweredQuestion
answer count: 0
tagged with: javascript
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44205532
has text: @GunjanPatel Have you tried it? There shouldn't be such much text in a 200x200 div.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27903065
type: Comment

http://stackoverflow.com/comment/44245165
score: 0
type: Comment
type: QuestionComment
has text: Questions on StackOverflow need to be self-contained. Please edit your question and add a [MCVE](http://stackoverflow.com/help/mcve) to your question.
comment on: http://stackoverflow.com/q/27924095

http://stackoverflow.com/comment/44121884
score: 0
has text: You need to call ajax and read file from server, `echo` it using php and print on browser using javascript. Make ajax every 3 seconds.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27859671

http://stackoverflow.com/comment/44119246
score: 0
comment on: http://stackoverflow.com/q/27857534
has text: sadly yes, with ther id form as well
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44041078
comment on: http://stackoverflow.com/a/27817154
score: 0
type: AnswerComment
has text: hey please check i have edited my code "Any Accompanying Person ?:" button is not inside the " " division
type: Comment

http://stackoverflow.com/q/27836690
answer count: 2
downvote count: 1
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27836802
has answer: http://stackoverflow.com/a/27836802
has answer: http://stackoverflow.com/a/27836726
type: AnsweredQuestion
upvote count: 0
has body: By pure accident I've stumbled upon a dfference between NaN and 10 / 0. I'm interested in the reason for this behavior. Here is my code, using the console of FF 34. //as expected: console.log(NaN == false); //-&gt;false //now: function m(value) { if (value) { return 'hi, NaN is not falsy'; }} console.log(m( 5 / 0)); //-&gt;"hi, NaN is not falsy" //of course: console.log(typeof NaN); //-&gt; "number" //but: function m(value) { if (value) { return 'hi, NaN is not falsy'; }} console.log(m(NaN)); //-&gt; undefined Thank you very much for any advice! ::Edit:: Alright, my fault: function m(value) { if (value) { return 'hi, NaN is not falsy'; }} console.log(m(parseInt('hi', 10))); //-&gt;undefined
tagged with: nan
favorite count: 0
has comment: http://stackoverflow.com/comment/44077861
type: Question
has title: JavaScript: behavior of NaN as literal and stored in variable
score: -1
accepted answer: http://stackoverflow.com/a/27836726

http://stackoverflow.com/comment/44266017
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27934113
has text: @G.Samaras are you expecting that when you post on the first url, that it automatically appears on the second url (in a different tab)? as this is not how this php/javascript combination will work.. you'll need to look at doing something with either a database or using something like socket.io to pass data in realtime between pages
score: 0

http://stackoverflow.com/comment/44224805
comment on: http://stackoverflow.com/a/27897576
score: 0
has text: No worries, incomplete code is fine. And a solution like this did come to mind, but it doesn't fit the use case of: obj = {a:[{b:1, c:1}, {b:1, c:1}, {b:1, c:1}] and then ignoring b or c. The only way to deal with that that I could think of was being able to add things to the ignore list like "a~b", which would be interpreted by a function to iterate over the list. But that would be a bit involved, hence the coming here first to ask :D
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44022966
comment on: http://stackoverflow.com/a/27807008
type: Comment
score: 1
type: AnswerComment
has text: It's very likely that either a different element could be clicked to close it, or that a different event will take place.

http://stackoverflow.com/comment/44213213
comment on: http://stackoverflow.com/a/27906800
score: 0
type: AnswerComment
has text: Depends on what the static method does with null/undefined arguments.
type: Comment

http://stackoverflow.com/a/27881683
answers question: http://stackoverflow.com/q/27881495
has comment: http://stackoverflow.com/comment/44165472
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27881495
has body: One single approach would be declaring a formal parameter in the changeColor function. You have two alternatives: Either to pass directly the color value: function changeColor(newColor) {...} function colors() { ... theDiv.innerHTML += " ... "; ... } Either to pass the div's ID (and, of corse, each div must have a unique ID). function changeColor(id) { var newColor = HexToRGB(document.getElementById(id).value); ... } function colors() { ... for(i=0;i<colors.length;i++) { var id="color"+i; theDiv.innerHTML += " ... "; } }
score: 0
has comment: http://stackoverflow.com/comment/44165744

http://stackoverflow.com/a/63007586
type: Answer
has body: There is a lodash package which specifically deals only with deep cloning a object. The advantage is that you don't have to include the entire lodash library. Its called lodash.clonedeep In nodejs the usage is like this var cloneDeep = require('lodash.clonedeep'); const newObject = cloneDeep(oldObject); In ReactJS the usage is import cloneDeep from 'lodash/cloneDeep'; const newObject = cloneDeep(oldObject); Check the docs here . If you are interested in how it works take a look at the source file here
answers question: http://stackoverflow.com/q/27936772
downvote count: 4
score: -2
has comment: http://stackoverflow.com/comment/113706745
upvote count: 2

http://stackoverflow.com/comment/44177073
has text: Alright `Uncaught reference $ is not defined` means you are not loading jquery, qhich is a requirement for highcharts
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27888006

http://stackoverflow.com/a/27809786
score: 0
has body: Just tried this and it seems to work in Chrome. Although it does mean that you have to programmatically open the window as well: mywindow = window.open('', 'windowName', '', true); then you close it with: mywindow.close(); See this answer. Basically you need a reference to do what you're doing. You can't find by title or URL.
type: Answer
answers question: http://stackoverflow.com/q/27809688

http://stackoverflow.com/q/27951005
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/27951181
has answer: http://stackoverflow.com/a/27953073
has body: I'm having problems sending an AJAX call after the other while looping and array of objects. The code is the following var def = true; $.each(urls, function(index, val) { var postResult = $.Deferred(); link = 'http://myurl.com' + val.aslug + '/' + val.slug; $.when(def).then(function(){ $.post('https://graph.facebook.com ', {id : link, scrape : 'true' }, function(data, textStatus, xhr) { }).always(function(){ postResult.resolve(5); }); }); def = postResult; }); The problem is the first and the second call they are ok. But the third call and the following are the same as 2nd call :/ I think the each is not changing to the next object
has comment: http://stackoverflow.com/comment/44297211
score: 0
possible better answer: http://stackoverflow.com/a/27953073
answer count: 2
has comment: http://stackoverflow.com/comment/44297338
has title: Send one AJAX call after the other with jQuery
accepted answer: http://stackoverflow.com/a/27951181
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44297870
has comment: http://stackoverflow.com/comment/44297501
tagged with: javascript
tagged with: jquery
tagged with: facebook-graph-api

http://stackoverflow.com/q/27815856
has title: How to test, debug and view console log message of Node js app on production server
type: AnsweredQuestion
favorite count: 0
possible better answer: http://stackoverflow.com/a/27815995
type: Question
has answer: http://stackoverflow.com/a/27815995
has answer: http://stackoverflow.com/a/27815939
has answer: http://stackoverflow.com/a/27816072
tagged with: node.js
has body: I have a ubuntu server, on which node js app is running. That app is developed from Sails mvc framework. I am asked to fix some server side js code. But the problem is I don't how to test, and debug those code. First of all, it's linux server without UI, I can't test from browser by localhost, since the program is triggered from HTTP request. Secondly, it is also unlikely to debug from build-in debugger command line client, for the same reason as the first one. Maybe I just don't know how... Third, I saw there is some console.log('...') codes, but I don't know where to find the log file. Hopefully someone could provide some opinions. Thanks very much.
score: 0
answer count: 3
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/27815939
tagged with: sails.js
tagged with: javascript

http://stackoverflow.com/comment/44075913
score: 0
type: QuestionComment
has text: name='data[files][]'
type: Comment
comment on: http://stackoverflow.com/q/27835600

http://stackoverflow.com/a/27864420
has comment: http://stackoverflow.com/comment/44133928
has comment: http://stackoverflow.com/comment/44134009
has comment: http://stackoverflow.com/comment/44137282
has comment: http://stackoverflow.com/comment/47592884
has comment: http://stackoverflow.com/comment/47678295
score: 1
upvote count: 1
type: AcceptedAnswer
has body: Here is an example of "parent" directive dashboard requiring droppable, and communication between the two making use of require and passing dashboardCtrl Here is a good article to see directive to directive communication Fiddle example also built from your previous question JSFiddle app.directive('droppable', [function () { return { restrict: 'A', require: 'dashboard', link: function (scope, elem, attrs, dashboardCtrl) { dashboardCtrl.controllerSpecificFunction('hello from child directive!'); scope.addWidgetInternal = function(message) { console.log(message); } } } }]); app.directive('dashboard', [function () { return { restrict: 'A', controller: function ($scope) { $scope.handleDrop = function(message) { $scope.addWidgetInternal(message) } this.controllerSpecificFunction = function(message) { console.log(message); } } } }]); Edit Based on discussion, here is a solution for what I currently understand the problem to be Parent directive dashboard optionally requires child directive droppable and there needs to be communication between the two Handle Drop app.directive('droppable', [function () { return { restrict: 'A', require: '^?dashboard', link: function (scope, elem, attrs, dashboardCtrl) { scope.handleDrop = function($event) { dashboardCtrl.addWidgetInternal($event); } } } }]); app.directive('dashboard', [function () { return { restrict: 'A', controller: function ($scope) { this.addWidgetInternal = function($event) { console.log($event); } } } }]); Updated JSFiddle
has comment: http://stackoverflow.com/comment/44135581
has comment: http://stackoverflow.com/comment/44144075
type: Answer
accepted answer of: http://stackoverflow.com/q/27863573
answers question: http://stackoverflow.com/q/27863573
downvote count: 0

recursion
type: Tag
tags question: http://stackoverflow.com/q/27809716
tags question: http://stackoverflow.com/q/27890151
tags question: http://stackoverflow.com/q/27845178
tag name: recursion
tags question: http://stackoverflow.com/q/27952865
tags question: http://stackoverflow.com/q/27871292
tags question: http://stackoverflow.com/q/27822434
tags question: http://stackoverflow.com/q/27808346
tags question: http://stackoverflow.com/q/27880167
tags question: http://stackoverflow.com/q/27839343
tags question: http://stackoverflow.com/q/27912568
tags question: http://stackoverflow.com/q/27960152

http://stackoverflow.com/a/27860864
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27860772
type: Answer
upvote count: 3
score: 3
has body: For ng-show interpolation is not required. You can try this .directive... template: '&lt;md-item ng-show="showItem" ng-transclude&gt;&lt;/md-item&gt;', link: function($scope, iElm, iAttrs, controller) { $scope.showItem = false; iElm.find('img').bind('load' , function(e) { $scope.$apply('showItem = true'); }); }
answers question: http://stackoverflow.com/q/27860772

http://stackoverflow.com/comment/44212688
type: QuestionComment
comment on: http://stackoverflow.com/q/27905978
has text: @Quentin for more detail!! why jsfiddle not showing cheched=true attribute when check-box is checked !! I required that !!!
score: 0
type: Comment

http://stackoverflow.com/comment/44424852
comment on: http://stackoverflow.com/a/27961171
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69102/discussion-between-shailesh-shekhawat-and-neil-lunn).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27810594
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27810612
tagged with: http://stackoverflow.com/tag/html
has body: I have a problem with angularjs, i'm trying to show a element by click in checkbox but it doesn't work i think the problem in ng-model but i don't know why Code HTML : index.html &lt;body ng-app="MetaStore"&gt; &lt;div ng-controller="produContr" &gt; &lt;div ng-repeat="product in products" &gt; &lt;h3&gt; {{product.name}} &lt;/h3&gt; &lt;p&gt;&lt;strong&gt;Prix : &lt;/strong&gt; {{product.prix}} DH&lt;/p&gt; &lt;p&gt; &lt;span&gt; Acheter &amp;nbsp; &lt;input type="checkbox" ng-model="{{product.id}}" &gt; &lt;/span&gt; &lt;/p&gt;&lt;hr&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt;&lt;h3&gt;Liste des produits selectionnees&lt;/h3&gt; &lt;div class="row"&gt; &lt;div ng-repeat="product in products"&gt; &lt;div ng-show="{{product.id}}"&gt; &lt;h3&gt; {{product.name}} &lt;/h3&gt; &lt;p&gt;&lt;strong&gt;Prix : &lt;/strong&gt; {{product.prix}} DH&lt;/p&gt; &lt;hr&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="js/app.js"&gt;&lt;/script&gt; &lt;/body&gt; Page app.js var app = angular.module('MetaStore',[]); app.controller('produContr', function($scope){ $scope.products = [ { "id": 0, "name": "Boyle", "prix": 3941 }, { "id": 1, "name": "Pearson", "prix": 3235 }, { "id": 2, "name": "Burnett", "prix": 2286 } ] }) p.s. really don't want to use jQuery for this issue.
tagged with: angularjs
score: 0
has title: Show element in AngularJs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27810612
type: Question

http://stackoverflow.com/comment/44036470
type: QuestionComment
has text: Are you using Firefox?
comment on: http://stackoverflow.com/q/27814867
score: 0
type: Comment

http://stackoverflow.com/comment/44146079
type: Comment
type: QuestionComment
score: 0
has text: This was the expected return from the console.log($("#form") input?
comment on: http://stackoverflow.com/q/27870123

http://stackoverflow.com/comment/44127755
type: QuestionComment
comment on: http://stackoverflow.com/q/27861118
has text: Its all about browser caching and reducing the number of file requests. In theory you will get better caching from CDN files as they may already have been loaded from other websites, but I would tend to reserve that for really common files from a really reliable CDN. For security & reliability we bundle everything on our own servers, but the rules change per business. As Louis says it "really depends on your project".
score: 0
type: Comment

http://stackoverflow.com/a/27870893
downvote count: 0
has body: I think you missed $(document).ready() Please update your code as following: $(document).ready(function(){ $( '.filelink' ).click( function( e ) { e.preventDefault(); //do some other stuff here }); })
type: Answer
score: 7
answers question: http://stackoverflow.com/q/27870794
upvote count: 7

http://stackoverflow.com/q/27824908
possible better answer: http://stackoverflow.com/a/27824966
has answer: http://stackoverflow.com/a/27825076
upvote count: 0
has answer: http://stackoverflow.com/a/27824966
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27825076
has answer: http://stackoverflow.com/a/27824998
answer count: 4
has title: How to get form input using jQuery?
has body: Instead of PHP, I want to use jQuery to get user input and pass in a function and update a "div". My HTML(includes scripts) code is: Mobile Locale test Submit! This should change... What I want: I want to get input from user and assign that input to x. Then I want to complete a string and pass x in that string. Then I want to write that complete sentence in div id="test". I am stumbling this for more than 6 hours but got no success. Tried numerous codes but failed. Referred w3schools jQuery form example but they are using form method="abcd.asp". Thanks in advance...
score: -1
type: AnsweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44055857
has answer: http://stackoverflow.com/a/27825032

http://stackoverflow.com/a/27922884
accepted answer of: http://stackoverflow.com/q/27922408
upvote count: 4
type: AcceptedAnswer
score: 4
downvote count: 0
has body: I would suggest you to use CSS transform and perspective to do this. In the example below, I've demonstrated this using buttons for swipeLeft, swipeRight, swipeUp and swipeDown events. $(".tilt").click(function() { $('#joystick').removeAttr('class'); $('#joystick').addClass($(this).attr('id')); }); #joy_div { perspective: 500px; } button { margin: 10px 0 0 0; } .left, .right, .down, .up, .reset { transition: transform 0.5s ease; transform-origin: 50% 50%; } .left { transform: rotateY(-40deg); } .right { transform: rotateY(40deg); } .up { transform: rotateX(-40deg); } .down { transform: rotateX(40deg); } .reset { transform: rotateX(0) rotateY(0); } swipeleft swiperight swipeup swipedown Reset
type: Answer
answers question: http://stackoverflow.com/q/27922408
has comment: http://stackoverflow.com/comment/44741018

http://stackoverflow.com/a/27914969
has comment: http://stackoverflow.com/comment/44229407
has body: Try using jQuery solution. &lt;form id="search"&gt; &lt;input autofocus autocomplete="off" type="text" class="searchbar" id="searchbar" placeholder="Search Keywords: search, navigate, weather" required&gt; &lt;input type="submit" value="Submit"&gt; &lt;/form&gt; On Form Submit call go(). $(document).ready(function() { $('#search').submit(function() { //Add code from go() or just call go() }); }); UPDATE : &lt;form id="search" onSubmit="go()"&gt; &lt;input autofocus autocomplete="off" type="text" class="searchbar" id="searchbar" placeholder="Search Keywords: search, navigate, weather" required&gt; &lt;input type="submit" value="Submit"&gt; &lt;/form&gt; Jquery Part. $(document).ready(function() { $('#searchbar').live("keypress", function(e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { e.preventDefault(); e.stopPropagation(); $(this).closest('form').submit(); } }); });
answers question: http://stackoverflow.com/q/27914840
type: Answer
has comment: http://stackoverflow.com/comment/44229080
score: 0
has comment: http://stackoverflow.com/comment/44229033

http://stackoverflow.com/a/28245820
type: Answer
score: 0
has body: I was missing one important detail. For new slide I was adding div container: &lt;div class="camp-slide"&gt; &lt;div class="camp-text camp-euc"&gt; &lt;div class="camp-lg"&gt;Lorem ipsum&lt;/div&gt; &lt;div class="camp-sm"&gt;Lorem ipsum&lt;/div&gt; &lt;a href="/thirdslide.aspx"&gt;&lt;span&gt;Learn More&lt;/span&gt;&lt;/a&gt; &lt;/div&gt; &lt;img src="&lt;%= SkinPath %&gt;images/thirdslide.jpg" alt="" /&gt; &lt;/div&gt; but I forgot to adjust camp-tabs section. &lt;div class="camp-tabs"&gt;&lt;a href="#"&gt;&amp;nbsp;&lt;/a&gt;&lt;a href="#"&gt;&amp;nbsp;&lt;/a&gt;&lt;a href="#"&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
accepted answer of: http://stackoverflow.com/q/27952812
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27952812

http://stackoverflow.com/q/27956163
score: 0
accepted answer: http://stackoverflow.com/a/27956980
answer count: 1
tagged with: css
has body: Hello friends. This is DEMO page As you can see in the picture when i hover page top user1 then hovercard working normal. But if i scroll down to hover user5 or user6 then hovercard not shown next to the username it slips up like in image. I'm using the following jQuery code for the positioning. function showProfileTooltip(e, id){ var top = e.clientY + 20; var left = e.clientX - 10; $('.p-tooltip').css({ 'top':top, 'left':left }).show(); //send id & get info from get_profile.php $.ajax({ url: 'get_profile.php?uid='+id, beforeSend: function(){ $('.p-tooltip').html('Loading..'); }, success: function(html){ $('.p-tooltip').html(html); } }); } function hideProfileTooltip(){ $('.p-tooltip').hide(); } $('.profile').mouseover(function(e){ var id = $(this).attr('data-id'); showProfileTooltip(e, id); }); $('.p-tooltip').mouseleave(function(){ hideProfileTooltip(); }); }); .p-tooltip{ background: #fafbfb; border: 1px solid #BFBFBF; width: 320px; margin: 0 auto; border-radius: 5px; position: absolute; display: none; padding: 0 0 10px 0; } .p-tooltip-cover img{ width: 100%; height: 120px; } .p-tooltip-avatar{ text-align: left; margin-top: -45px; margin-left: 10px; } .p-tooltip-avatar img{ height: 75px; width: 75px; padding: 4px; background: #fff; border: 1px solid #ccc; cursor: pointer; } .p-tooltip-info{ text-align: left; } .p-tooltip-info .p-username{ float: none; margin-top: -70px; margin-left: 100px; font-size: 14px; font-weight: bold; color: white; } .p-tooltip-info .p-headline{ float: none; margin-top: 6px; margin-left: 100px; font-size: 12px; color: black; } .p-tooltip-button{ float: right; margin-top: 5px; } .p-tooltip-button button{ cursor: pointer; } user1 user2 user3 user4 user5 user6 user7 user8
tagged with: php
has title: Ajax PHP Jquery HoverCard Positioning
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27956980
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44291414
comment on: http://stackoverflow.com/a/27946321
type: Comment
score: 1
has text: This doesn't really answer the question. Primitives are immutable, so of course trying to mutate them will create a new value. All you have shown is how objects are stored in variables (as reference). You haven't shown whether, when having `foo = bar = 42`, the actual data is duplicated (same value in two different memory locations).
type: AnswerComment

http://stackoverflow.com/q/27953996
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm trying to make the '#perc value increment from 0 to the value in each svg. Similar to http://builtbybuffalo.com/ with their - a few stats further down the page. I've tried to do it with Javascript and it's just not working, I might try again when it's not 2 in the morning... I digress. Im very new to javascript/jquery so explanation would be nice as to what to do and why it doesn't work function changeText3() { var oldHTML = document.getElementsByClassName('perc').innerHTML; var intoldHTML = parseInt(oldHTML); if (intoldHTML == 0) { intoldHTML += 75; } return changeText3() + '%'; } This is the code for the radial percentage circles, the numbers inside are the numbers I want to start at 0 and increase to their values. var dark = document.getElementsByClassName('dark'); var svg = document.getElementsByClassName('svg')[0]; var radius = svg.getBBox().width / 2; var t = 0.5, x = 0, y = 0; var theta = { 0: 0, 1: 0, 2: 0 }; var anims = {} var maxTheta = calcTheta(document.getElementsByClassName('perc')); for (i = 0; i < dark.length; i++) { dark[i].setAttribute('transform', 'translate(' + radius + ',' + radius + ')'); } function calcTheta(el) { var jbo = {}; for (i = 0; i < el.length; i++) { jbo[i] = (180 * parseInt(el[i].innerHTML.slice(0, -1), 10)) / 50; } return jbo; } var animOne = setInterval(function() { theta[0] += 0.5; var x = Math.sin(theta[0] * Math.PI / 180) * radius; var y = Math.cos(theta[0] * Math.PI / 180) * -radius; var d = 'M0,0 v' + -radius + 'A' + radius + ',' + radius + ' 1 ' + ((theta[0] > 180) ? 1 : 0) + ',1 ' + x + ',' + y + 'z'; dark[0].setAttribute('d', d); if (theta[0] > maxTheta[0]) { clearInterval(animOne); } }, t); var animTwo = setInterval(function() { theta[1] += 0.5; var x = Math.sin(theta[1] * Math.PI / 180) * radius; var y = Math.cos(theta[1] * Math.PI / 180) * -radius; var d = 'M0,0 v' + -radius + 'A' + radius + ',' + radius + ' 1 ' + ((theta[1] > 180) ? 1 : 0) + ',1 ' + x + ',' + y + 'z'; dark[1].setAttribute('d', d); if (theta[1] > m…
type: UnansweredQuestion
has title: incrementing % value in svg text area
type: Question
has answer: http://stackoverflow.com/a/27955821

http://stackoverflow.com/comment/45500343
score: 0
comment on: http://stackoverflow.com/a/27958186
type: Comment
has text: If Google's servers are unable to download the file, either by explicit blocking, or an incorrect path, it won't be able to render a preview. Also, if it's not a `.doc` file, that will likely also cause problems, since if you're actually using `example.com`, they don't have a document at that location from what I can tell. I was able to successfully test it with this URL: [https://docs.google.com/gview?url=http://ieee802.org/secmail/docIZSEwEqHFr.doc&embedded=true](https://docs.google.com/gview?url=http://ieee802.org/secmail/docIZSEwEqHFr.doc&embedded=true)
type: AnswerComment

http://stackoverflow.com/a/27944397
answers question: http://stackoverflow.com/q/27944231
score: 0
type: AcceptedAnswer
has body: Ok, found the problem. jQuery is loaded 2 times. And this is were the conflict came from. I just removed jQuery from my functions.php because Wordpress already loads it's own jQuery and throws conflicts if it is loaded a separate different time. Thanks anyway.
accepted answer of: http://stackoverflow.com/q/27944231
type: Answer

http://stackoverflow.com/q/27854824
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
duplicate of: http://stackoverflow.com/q/13658021
has comment: http://stackoverflow.com/comment/44113160
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27855262
answer count: 2
accepted answer: http://stackoverflow.com/a/27855357
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/27855262
linked to: http://stackoverflow.com/q/13658021
favorite count: 0
has answer: http://stackoverflow.com/a/27855357
has title: Vanilla js replacements for jQuery's index() and eq()
has body: I am converting our webpage's older jQuery based DOM manipulations to vanilla javascript, Most has gone surprisingly easy, but have hit a wall with the flyout menus. We use a simple format of tabs and hidden menu divs: tab 1 tab 2 tab 3 tab 4 menu 1 menu 2 menu 3 menu 4 The former jQuery based system used .index() to determine which tab was clicked and then the .eq() to control which hidden menu was revealed. I am now wondering how I might go about doing the same with vanilla javascript. In worse case scenario I could rename the classes as tab1, tab2, menu1, menu2 and write individual scripts for each, but I liked the flexibility the index/eq system provided for adding or removing menu panels. Thanks
tagged with: css

http://stackoverflow.com/comment/44117568
comment on: http://stackoverflow.com/q/27857235
type: Comment
type: QuestionComment
score: 2
has text: You will probably need to use `Array.sort()` with a custom `Comparator` !

http://stackoverflow.com/a/27821402
answers question: http://stackoverflow.com/q/27820461
score: 1
has body: My solution is the following: var camp = {}; $.each(data, function(i, field) { var dt = field['datum']; var openClose = field['open'] + "-" + field['close']; var ca = field['campus']; if (camp[ca]) { camp[ca].push(openClose); } else { camp[ca] = [openClose]; } }); This yields an object which maps the campus names to the opening times, like this: "name" -&gt; ["open-close", "open-close", ...] After the object is created, we just append it to the DOM: for (prop in camp) { $("#wtf").append(prop + " "); for (var i = 0; i &lt; camp[prop].length; i++) { $('#wtf').append(camp[prop][i]); if (i !== camp[prop].length - 1) { $('#wtf').append(" "); } } $('#wtf').append('&lt;br&gt;'); } The reason why I think this method is preferable for you, is that, this way all the opening and closing times are conserved. In the other approach, only one of these intervals will remain. The fiddle is located here.
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/27868567
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/356809
tagged with: css
answer count: 4
tagged with: cross-browser
has comment: http://stackoverflow.com/comment/44139605
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27868939
has answer: http://stackoverflow.com/a/27868718
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/44139641
has answer: http://stackoverflow.com/a/27868817
favorite count: 0
has body: I have some element, div or whatever with id and i want to center it on webpage. But when it looks good on computer screen, it looks bad on mobile. How to center it correctly, with any framework like bootstrap or something, or without, any method, jquery also is possible. It has too looks good on all mobile and all computer browsers. Thanks.
has answer: http://stackoverflow.com/a/27869041
has title: How to center some element on web page on all browsers and devices?

http://stackoverflow.com/comment/44251706
score: 0
type: Comment
type: AnswerComment
has text: This isn't fixing the problem. Actually the added `}` breaks this code.
comment on: http://stackoverflow.com/a/27927313

http://stackoverflow.com/comment/44354412
type: Comment
has text: Hello World
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27904518

http://stackoverflow.com/comment/44222822
has text: Since the exception is a VEException, which looks like it's defined in an external resource, I'd say that the root cause is a timing issue with loading the javascript resources. I've had *many* issues with Google Chrome raising `load` events on external SVG resources, for example, whose DOM is not yet available. If this is the case, you might be able to `setTimeout(fn, 0)`, rather than use exception handling, as a workaround.
type: QuestionComment
comment on: http://stackoverflow.com/q/27843189
type: Comment
score: 2

http://stackoverflow.com/q/27874828
has comment: http://stackoverflow.com/comment/44151405
tagged with: scope
score: 0
has body: Here I have this input button element.A variable declared as btn is assigned a reference to that button using document.getElementById('btn'), but the btn variable is inside a function named create. As far I know functions create private scope which can't be accessed globally, but here I can manage to add eventListener to that variable without even invoking the function. How is this possible? function create(){ var btn=document.getElementById('btn'); } btn.addEventListener('click',function(e){ alert('it worked !!'); }); &lt;input type='button' value='button' id='btn'&gt;
answer count: 1
has comment: http://stackoverflow.com/comment/44151343
has comment: http://stackoverflow.com/comment/44151467
type: AnsweredQuestion
has title: eventListener works on variable which is supposed to be inside a function's private scope
has answer: http://stackoverflow.com/a/27874898
type: Question
accepted answer: http://stackoverflow.com/a/27874898
tagged with: javascript
tagged with: dom-events

http://stackoverflow.com/a/27876654
has comment: http://stackoverflow.com/comment/44154787
has comment: http://stackoverflow.com/comment/44154851
accepted answer of: http://stackoverflow.com/q/27876475
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/27876475
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44154752
has body: You could use: var tbody=document.getElementById("tbodyId"); var table=document.getElementById("tableId"); var tbodyIndex= [].slice.call(table.tBodies).indexOf(tbody); // [].slice.call() to convert HTML collection to array -DEMO-
type: Answer

http://stackoverflow.com/q/27822868
answer count: 3
possible better answer: http://stackoverflow.com/a/27830507
tagged with: promise
has body: I'm trying to delay-load some assets for a website. I'm very new to promises but they seem to be very helpful in this context. Specifically, I've got the below method I created to download both the HTML and CSS files, and then flip a KnockoutJS observable indicating that the section is then available. That method looks like this: function delayDownloadAssets(sectionName) { var htmlRequest = $.ajax({ url: 'http://www.example.com/' + sectionName + '.html' }), cssRequest = $.ajax({ url: 'http://www.example.com/' + sectionName + '.css' }); $.when(firstRequest, secondRequest).done(function (firstResponse, secondResponse) { //Insert HTML assets and CSS assets into DOM app.sections[sectionName].enabled(true); }); } I can then call the method a few times like: delayDownloadAssets("Section1"); delayDownloadAssets("Section2"); delayDownloadAssets("Section3"); So far, so good. But I'd like to wrap all three section download calls in a similar way, so that I can take action. Something like: $.when(delayDownloadAssetsCall1, delayDownloadAssetsCall2,delayDownloadAssetsCall3).done(function () { alert('Web site download is entirely complete!'); }); I hope that this question is clear, but if it needs any clarification, please let me know. Thanks!
has answer: http://stackoverflow.com/a/27822923
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27830507
has answer: http://stackoverflow.com/a/27823019
accepted answer: http://stackoverflow.com/a/27823019
type: Question
tagged with: jquery-deferred
has title: Guidance for creating jquery promise hierarchy
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/44176484
has text: Thanks Erik to your reply.. I just put a part of the Code.. Even if I put the full Code of Bootstraps Example the URL is taking just the Base URL and than the Anchro like above :(
score: 0
comment on: http://stackoverflow.com/a/27887762
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27962391
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44318053
tagged with: javascript
score: 0
has body: There were 1 video (the first part of the code below) that works fine and as expected: video is displayed if you click on the image. I would like one more video on the html page. That's why I placed this code right below the code above: However, instead of displaying both videos with the updated code, the page displays the second video when I click on ANY of this two links. Could anybody please explain what should be changed the code above? I'm new to angular with this code. Thank you.
has comment: http://stackoverflow.com/comment/44318066
has title: angularjs: for two different links, only one video is displayed for both links, not two videos
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: video

http://stackoverflow.com/q/27963760
type: Question
tagged with: api
has answer: http://stackoverflow.com/a/27995470
tagged with: javascript
tagged with: odesk
score: 0
answer count: 1
favorite count: 0
has body: /** * Example of usage oDeskAPI * * @package oDeskAPI * @since 09/22/2014 * @copyright Copyright 2014(c) oDesk.com * @author Maksym Novozhylov &lt;mnovozhilov@odesk.com&gt; * @license oDesk's API Terms of Use {@link https://developers.odesk.com/api-tos.html} */ var config = { 'consumerKey' : '571a5ff21bded617e499965f9cf013a0', 'consumerSecret' : 'e3df4989efed7761', // 'accessToken' : 'xxxxxxxx', // assign if known // 'accessSecret' : 'xxxxxxxx', // assign if known 'debug' : false }; //var oDeskApi = require('../') // uncomment to use inside current package/sources var oDeskApi = require('odesk-api') // use if package is installed via npm // , Auth = require('../lib/routers/auth').Auth // uncomment to use inside current package/sources , Auth = require('odesk-api/lib/routers/auth').Auth // use if package is installed via npm , rl = require('readline'); // you can use your own client for OAuth routine, just identify it here // and use as a second parameter for oDeskApi constructor (see the example of usage below) // note: your client must support the following methods: // 1. getAuthorizationUrl - gets request token/secret pair, creates and returns // authorization url, based on received data // 2. getAccessToken(requestToken, requestTokenSecret, verifier, callback) - // requests access token/secret pair using known request token/secret pair and verifier // 3. setAccessToken(token, secret, callback) - sets known access token/secret pair // 4. get|post|put|delete(path, data, callback) - for GET, POST, PUT and DELETE methods respectively // 5. setEntryPoint(entryPoint) - allows setup different entry point for base url // // var MyClient = require('../lib/myclient').MyClient; // // by default predefined lib/client.js will be used that works with other odesk oauth library // a function to get access token/secret pair function getAccessTokenSecretPair(api, callback) { // get authorization url api.getAuthorizationUrl('http://localhost/complete', function(error, url, requestT…
type: UnansweredQuestion
upvote count: 1
has title: You are not authorized to access this page Odesk api node.js
tagged with: node.js
downvote count: 1

http://stackoverflow.com/q/27928573
has answer: http://stackoverflow.com/a/27929729
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27928951
has body: I'm new to Backbone. I'm trying a simple page which takes the name of the user, stores it in a model and renders it in a different page using handlebars. This is as far as I could get. The page doesnt show any errors but doesnt render anything also. HTML code : Form8 Script:
score: 0
answer count: 2
tagged with: backbone.js
type: UnansweredQuestion
has title: Backbone Form not working

dom-events
tags question: http://stackoverflow.com/q/27826040
tags question: http://stackoverflow.com/q/27835426
tags question: http://stackoverflow.com/q/27946644
tags question: http://stackoverflow.com/q/27900384
tags question: http://stackoverflow.com/q/27911433
tags question: http://stackoverflow.com/q/27916604
tags question: http://stackoverflow.com/q/27888326
tags question: http://stackoverflow.com/q/27848907
tags question: http://stackoverflow.com/q/27874828
tags question: http://stackoverflow.com/q/27909441
type: Tag
tags question: http://stackoverflow.com/q/27827393
tags question: http://stackoverflow.com/q/27858306
tags question: http://stackoverflow.com/q/27842633
tags question: http://stackoverflow.com/q/27927965
tags question: http://stackoverflow.com/q/27821067
tag name: dom-events
tags question: http://stackoverflow.com/q/27948848
tags question: http://stackoverflow.com/q/27954669
tags question: http://stackoverflow.com/q/27812158
tags question: http://stackoverflow.com/q/27873606
tags question: http://stackoverflow.com/q/27933027
tags question: http://stackoverflow.com/q/27806846
tags question: http://stackoverflow.com/q/27852016

http://stackoverflow.com/q/27846603
type: Question
tagged with: pyqt4
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/27849078
upvote count: 1
tagged with: user-interface
possible better answer: http://stackoverflow.com/a/27860791
favorite count: 0
has answer: http://stackoverflow.com/a/27849078
has body: Currently, we have a number of GUIs that have been developed using PyQt4 and PyQtGraph. We need to make these interfaces accessible to a number of remote users and are hoping to do so by serving the GUIs through an HTML/CSS/JavaScript Web-Application. The link below provides a few suggestions for this task, but these seem to apply to a project that is in its initial stages of creation. I'm familiar with the development of Python-JavaScript Web-Applications using the Pyramid Server and would like to use this same method for providing users access to PyQt4 GUIs that have already been developed. https://softwareengineering.stackexchange.com/questions/109572/can-i-create-a-desktop-python-gui-application-and-run-it-as-a-web-app So my question is, can I serve a functional PyQt4 GUI as a widget using HTML/CSS/JavaScript?
tagged with: pyqtgraph
type: AnsweredQuestion
downvote count: 0
tagged with: widget
has title: Serve PyQt4 GUIs in Web-Application using HTML/CSS/JavaScript
score: 1
has answer: http://stackoverflow.com/a/27860791

http://stackoverflow.com/comment/44056855
comment on: http://stackoverflow.com/q/27825459
type: Comment
type: QuestionComment
score: 0
has text: Please include the XLM into your question.

http://stackoverflow.com/comment/44211227
type: QuestionComment
comment on: http://stackoverflow.com/q/27905978
type: Comment
has text: [Here's a fixed version of your jsfiddle.](http://jsfiddle.net/atw3maj4/)
score: 0

http://stackoverflow.com/q/27857472
type: Question
tagged with: aem
has comment: http://stackoverflow.com/comment/44120426
score: 0
has body: instead of i want the however it does not work...any ideas how to pass tag values dynamically?
has comment: http://stackoverflow.com/comment/44192460
tagged with: tags
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44117892
has title: how can I pass tagboardOptions dynamically?
answer count: 0

http://stackoverflow.com/q/27867499
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44137849
has body: I have two elements and I want to delegate click event to their children. This code works: list.on('click', '&gt; *', function (e) { clickHandler($(this), e); }); listSelected.on('click', '&gt; *', function (e) { clickHandler($(this), e); }); Tried to use jQuery element array, but this code doesn't work: $([list, listSelected]).on('click', '&gt; *', function (e) { clickHandler($(this), e); });
upvote count: 2
has answer: http://stackoverflow.com/a/27867577
has answer: http://stackoverflow.com/a/27867559
has comment: http://stackoverflow.com/comment/44138050
has title: How to delegate click event to children of jQuery element array?
accepted answer: http://stackoverflow.com/a/27867559
score: 2
type: AnsweredQuestion
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27867577
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44137710

http://stackoverflow.com/comment/44081595
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27838505
has text: @MichaelPerrenoud, yes. after dom loaded only i finding.

http://stackoverflow.com/a/27918295
has body: Put your code in onclick of submitButton $("#submitButton").on('click',function() { // VALIDATION: var validator = $("#projectForm").validate({ rules: { "kmProjectInfo.name": "required" }, messages: { "kmProjectInfo.name": "Please enter a project name" } }) });
answers question: http://stackoverflow.com/q/27918248
type: Answer
downvote count: 1
upvote count: 0
score: -1

http://stackoverflow.com/comment/44129265
comment on: http://stackoverflow.com/a/27842959
score: 0
type: Comment
has text: Sorry, but that's not going to work with the dynamic include th3e way I've coded it. The problem is that you aren't going to be executing the PHP code, so there would be no HTML output to parse through. I think you're best bet is going to using ` `
type: AnswerComment

http://stackoverflow.com/q/27963929
tagged with: onblur
has comment: http://stackoverflow.com/comment/44320873
has answer: http://stackoverflow.com/a/27964453
upvote count: 1
has title: Using JavaScript to validate form both onblur and when pressing submit
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44321164
score: 1
has comment: http://stackoverflow.com/comment/44321727
tagged with: forms
type: Question
has body: I'm trying to validate fields in a form using JavaScript. The fields should be validated either when the user leaves a field (onblur) and when the user presses submit. The form should not be sent if the validation fails in any way on a required field. The thing is I also have a JS function that if validation succeeds, should rewrite one of the fields that is validated, and send the form. This is my HTML: ... other input fields that should be validated, not yet written ... And this is my javascript for validation: function checkEmail() { var validemail = true; var email = document.getElementById("email"); var divided = email.split("@"); var divlen = divided.length; if (divlen != 2) { validemail = false; document.getElementById("labemail").innerHTML = "Felaktig e-postadress"; } else { document.getElementById("labemail").innerHTML = "Korrekt epostadress"; } // More code to validate Email to come return validemail; } function checkEmailConfirm() { var validtestemail = true; var email = document.getElementById("email"); var testemail = document.getElementById("email"); if (testemail != email) validtestemail = false; return validtestemail; } function validateForm() { var validform = true; var returnval = true; validform = checkEmail(); if (validform == false) returnval = false; validform = checkEmailConfirm(); if (validform == false) returnval = false; return returnval; } My problem is that nothing happens when i leave the email- or testemail-fields. My second question is, if I want the form not submitted if any of the validations fails, but submitted and also hashed using the function called formhash() if the validations succeeds, is this the correct way? EDIT: Using the Chrome debugger, i have the following errors: Uncaught TypeError: undefined is not a function: checkcreateuser.js:9 checkEmail: checkcreateuser.js:9 onblur: newuser.php:16
accepted answer: http://stackoverflow.com/a/27964453
tagged with: validation
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/44270893
score: 0
comment on: http://stackoverflow.com/q/27921708
type: Comment
type: QuestionComment
has text: @TrueBlueAussie So i finally get it working with all jquery code and the same issue happens, without onload=load() the numbers just reset to 0 when the page reloads.. and when i go from the first tab to the second tab and try to buy milkshakes too half the time it doesn't work so i click reload then build up the milk again then wait 5 seconds before clicking buy and then it works.. so seems to not work half the time and the page is loaded so it shouldn't need to wait until the page is loaded..

http://stackoverflow.com/q/27812928
has answer: http://stackoverflow.com/a/27813066
has answer: http://stackoverflow.com/a/27813048
possible better answer: http://stackoverflow.com/a/27813260
has answer: http://stackoverflow.com/a/27813260
has title: How to make this Jquery-blinking background stop after a few seconds?
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44033217
linked to: http://stackoverflow.com/q/1605698
upvote count: 1
has body: How to make this Jquery-blinking background stop after a few seconds? I'm trying to set the background and text to blink and then stop after 3 seconds. Thanks for your help in advance! $(document).ready(function() { blinkFont(); }); function blinkFont() { document.getElementById("blink").style.color = "red" document.getElementById("blink").style.background = "black" setTimeout("setblinkFont()", 500) } function setblinkFont() { document.getElementById("blink").style.color = "black" document.getElementById("blink").style.background = "red" setTimeout("blinkFont()", 500) } #blink { text-align: center; background: #000000; color: #F00; margin: 0; padding: 20px; } #blink span { font-size: 2em; font-weight: bold; display: block; } This is blinking text and background
has comment: http://stackoverflow.com/comment/44033170
accepted answer: http://stackoverflow.com/a/27813066
type: Question
has comment: http://stackoverflow.com/comment/44033279
has comment: http://stackoverflow.com/comment/44033240
has answer: http://stackoverflow.com/a/27813235
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0

http://stackoverflow.com/q/27822162
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27822400
possible better answer: http://stackoverflow.com/a/27822267
has comment: http://stackoverflow.com/comment/44051848
has answer: http://stackoverflow.com/a/27822267
has body: I am trying to get rid of the jQuery dependency in a project. One thing that project does is posting data to a server like so: var data = {"apple": [{"kiwi": "orange"}, {"banana": "lemon"}], "pear": "passion fruit"}; $.post( url, data); Thanks to You might not need jQuery, I know how to rewrite $.post in pure Javascript using XMLHttpRequest: var request = new XMLHttpRequest(); request.open( 'POST', url, true); request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); request.send( data); Unfortunately, this description seems to assume that the data object is already a URL-encoded query string, which is clearly not the case in the above example. It turns out jQuery does more than that: With the given data object, the above $.post call would first convert it to a query string, which would look like so: apple%5B0%5D%5Bkiwi%5D=orange&amp;apple%5B1%5D%5Bbanana%5D=lemon&amp;pear=passion+fruit The code snippet using XMLHttpRequest does not do so, and, thus, the server will throw errors at me. jQuery also has a wonderful method call $.param which does exactly this conversion. The above code snippet using XMLHttpRequest will work marvelously if in the last line I do request.send( $.param(data)); But then, I did not get rid of the jQuery dependency. So I'm looking for a pure Javascript equivalent of $.param. Does anyone have something like that? Note: The question Plain Javascript Equivalent of jQuery.param() asks a similar question, but the accepted answer only works in very simple cases. Applying the function given in that answer to my above data object yields: apple=%5Bobject%20Object%5D%2C%5Bobject%20Object%5D&amp;pear=passion%20fruit ...which is obviously different from the result of $.param(data) given above, and loses information since it doesn't work recursively.
type: AnsweredQuestion
has title: Encode object literal as URL query string in Javascript
upvote count: 3
has comment: http://stackoverflow.com/comment/44050615
type: Question
score: 3
has comment: http://stackoverflow.com/comment/44050933
linked to: http://stackoverflow.com/q/25224887
has answer: http://stackoverflow.com/a/27822400
tagged with: javascript
has answer: http://stackoverflow.com/a/27822282
answer count: 3
downvote count: 0
tagged with: query-string

http://stackoverflow.com/comment/44313574
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27959690
has text: maybe try using "file:///C:/Users/u0098668/Documents/Projects/local-folder/test.js" as the path to your js file.
type: AnswerComment

http://stackoverflow.com/a/27823029
upvote count: 6
answers question: http://stackoverflow.com/q/27822942
downvote count: 0
has body: Just return Q.all from the functions directly, like this Q.all(returns_a_promise()) .then(function() { return Q.all(array_of_promises); }) .then(function() { return Q.all(array_of_promises); }) .then(function() { return Q.all(array_of_promises); }) .done(function() { logger.info("yea we done"); }); For example, Q.all([Q(1), Q(2)]) .spread(function(value1, value2) { return Q.all([Q(value1 * 10), Q(value2 * 10)]); }) .spread(function(value1, value2) { return Q.all([Q(value1 * 100), Q(value2 * 100)]); }) .spread(function(value1, value2) { return Q.all([Q(value1 * 1000), Q(value2 * 1000)]); }) .done(function() { console.log(arguments[0]); }) would print [ 1000000, 2000000 ]
type: Answer
score: 6

http://stackoverflow.com/q/27950978
has comment: http://stackoverflow.com/comment/44297336
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44297387
has comment: http://stackoverflow.com/comment/119564606
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44297520
has title: Assign onclick event inside loop
has body: Working with onclick event assigned inside the loop , but problem has occured matej.prototype.animacia = function () { var tab = document.getElementById("table"); var x = tab.querySelectorAll(".lol td"); var kontrola=true; for (var i = 0; i &lt; x.length; i++) { x[i].onclick = function (e) { e = e ? e : window.event; var decko = e.target.querySelector(".bodky"); var bastard = e.target.querySelector(".hidden"); var hore = 0; kontrola=false; var id = function () { decko.style.opacity = 1 - hore; hore += 0.05; if (hore &lt; 1) { setTimeout(function () { id(); }, 10); } else { decko.style.display = "none"; decko.style.opacity = 0; (function (e) { e = e ? e : window.event; var dole = 0; var di = function () { bastard.style.display = "inline"; bastard.style.opacity = 0 + dole; dole += 0.05; if (dole &lt; 1) { setTimeout(function () { di(); }, 100); } else { bastard.style.opacity = 1; } }; di(); })(); } }; id(); } };} It "works" as expected but i have to click on the "TD" elements in order(from the last one to the first) otherwise it will throw an error . Why does it happen ? working demo http://jsfiddle.net/Trolstover/qxd32hkk/5/
has answer: http://stackoverflow.com/a/67655639
has comment: http://stackoverflow.com/comment/44298305
type: Question

http://stackoverflow.com/q/27821147
has answer: http://stackoverflow.com/a/27821185
has answer: http://stackoverflow.com/a/27821220
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27821224
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
type: Question
has title: JQUERY hover() function not applying to its children, using bootstrap framework
has body: Right, when I hover over the class .col-lg-6 I want the div with class of .navText to hide. HTML: Home About Me JQUERY: $('.col-lg-6').hover(function () { $(this).children('.navText').hide(); }); This isn't working. However if I just put: $('.navText').hide(); It does work so why isn't my hover function working correctly. I'm a little confused as I'm 100% sure I have written to jquery correct. Could bootstrap be effecting this? Also if I use the jquery code. $('.col-lg-6').hover(function () { $('.navText').hide(); }); It will hide all the .navText classes. So its having a problem with $(this) I think

http://stackoverflow.com/q/27908666
accepted answer: http://stackoverflow.com/a/27909248
tagged with: jquery
has title: How to style an `#id` after selecting that `#id` from my dropdown menu?
favorite count: 0
has answer: http://stackoverflow.com/a/27908762
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44216701
has comment: http://stackoverflow.com/comment/44216890
has answer: http://stackoverflow.com/a/27909794
tagged with: css
has comment: http://stackoverflow.com/comment/44216697
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44217559
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27909248
type: Question
linked to: http://stackoverflow.com/q/14348233
linked to: http://stackoverflow.com/q/1720320
has comment: http://stackoverflow.com/comment/44217285
has answer: http://stackoverflow.com/a/27908860
has comment: http://stackoverflow.com/comment/44216817
tagged with: javascript
has comment: http://stackoverflow.com/comment/44216625
answer count: 6
has body: Details I have a dropdown-menu of countries Each country have an id of it's name. Ex. Australia - id="Australia" When I select on them, they will redirect/zoom-in to that country. It's work so far, but it's a little hard to tell which country that I just clicked on. So now, I want apply border to my class="country-name" Here is my dropdown-list As you can see I selected on Australia then my HTML should like this Australia Then, my view should re-direct me to Here is what I want to do , I want to put the border to Australia in the view. JSFiddle
possible better answer: http://stackoverflow.com/a/27908738
has comment: http://stackoverflow.com/comment/44216752
has comment: http://stackoverflow.com/comment/44217688
has answer: http://stackoverflow.com/a/27908738
has answer: http://stackoverflow.com/a/27909316
has comment: http://stackoverflow.com/comment/44216642
downvote count: 0

http://stackoverflow.com/q/27834362
score: 0
answer count: 1
tagged with: extjs
has body: I am looking for some ways to remove the x-form-foucs css style of StoreFilterField. I have put a storeFilterFiled and some other textfield on a formPanel, if I want to typing some word into the textField, the cursor will turn back to storeFilterField after I clicked the textField, due to storeFilterField will always get focus.. Have tried to use removeStyleName("x-form-focus");, but doesn't work. -- Updated: After having Tangent suggested, I have used chrome developer tool and breaks on attributes modification at the StoreFilterField. And when I click other field, I have got call stack. The stack as below: com_extjs_gxt_ui_client_core_El_$removeStyleName has called by com_extjs_gxt_ui_client_widget_form_TriggerField_$triggerBlur and the styleName been removed is "x-trigger-wrap-focus", TriggerField has been extended by StoreFilterField. And triggerBlur() is called by TriggerField_$mimicBlur. and mimicBlur() is called by focusEventPreview = new BaseEventPreview() { protected boolean onAutoHide(final PreviewEvent ce) { if (ce.getEventTypeInt() == Event.ONMOUSEDOWN) { mimicBlur(ce, ce.getTarget()); } return false; } }; Which is in TriggerField's onRender() The whole stack as below: com_extjs_gxt_ui_client_core_El_$removeStyleName__Lcom_extjs_gxt_ui_client_core_El_2Ljava_lang_String_2Lcom_extjs_gxt_ui_client_core_El_2 (0.js:15459) com_extjs_gxt_ui_client_widget_Component_$removeStyleName__Lcom_extjs_gxt_ui_client_widget_Component_2Ljava_lang_String_2V (0.js:3276) com_extjs_gxt_ui_client_widget_form_TriggerField_$triggerBlur__Lcom_extjs_gxt_ui_client_widget_form_TriggerField_2Lcom_extjs_gxt_ui_client_event_ComponentEvent_2V (0.js:8032) com_extjs_gxt_ui_client_widget_form_TriggerField_triggerBlur__Lcom_extjs_gxt_ui_client_event_ComponentEvent_2V (0.js:8097) com_extjs_gxt_ui_client_widget_form_TriggerField_$mimicBlur__Lcom_extjs_gxt_ui_client_widget_form_TriggerField_2Lcom_extjs_gxt_ui_client_event_PreviewEvent_2Lcom_google_gwt_user_client_Element_2V (0.js:7962) com_extjs…
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28961438
tagged with: gxt
has comment: http://stackoverflow.com/comment/45090766
type: Question
has comment: http://stackoverflow.com/comment/46254572
tagged with: gwt
has title: remove focus style of StoreFilterField in GWT
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28961438

http://stackoverflow.com/q/27820682
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27820937
has answer: http://stackoverflow.com/a/27820827
has answer: http://stackoverflow.com/a/27821310
has comment: http://stackoverflow.com/comment/44047124
tagged with: javascript
has comment: http://stackoverflow.com/comment/44047397
answer count: 6
has comment: http://stackoverflow.com/comment/44047600
has title: Display html link with javascript
has comment: http://stackoverflow.com/comment/44047535
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27820979
favorite count: 0
has comment: http://stackoverflow.com/comment/44047637
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/27842163
has body: In some part of an html page, I have a link with the following code : link-text I would like to automatically display the same link in another part of the same page by using a javascript. What would be the script to insert in my page ? Thank you in advance for any help in this matter. Patrick
has comment: http://stackoverflow.com/comment/44047519
has answer: http://stackoverflow.com/a/27820981
score: 1

http://stackoverflow.com/q/27921281
has body: I have a factory that I am passing into a directive. There is some data within the factory that gets updated via a function: app.factory('CallsDataService', function() { var factory = {}; //Contacts Handled data var data = [ { "id": "0", "handle": "A", }, { "id": "1", "handle": "B", } ]; factory.getData = function(){ return data; }; factory.updateData = function(value){ data[0].handle= value); }; .............. In the directive it gets passed in as a dependancy: app.directive('pieChart', ['CallsDataService', function(CallsDataService) { return { // use a new isolated scope restrict: 'AE', replace: 'true', scope:{ templateUrl: "@" }, link: function(scope,element,attrs){ //Draw initial chart with default data drawChart(); function drawChart() { } .... My question is: if the data in the factory gets updated in factory via a call to the factory.updateData function in some other part of the code how can I detect this in the directive? I assume there has to be some use of $broadcast or $watch but I have had no success with this so far (needless to say I am new to Angular) Any pointers would be appreciated. Many thanks.
tagged with: javascript
has title: Detecting a change in a dependancy that is passed into a directive
score: 0
has answer: http://stackoverflow.com/a/27923422
answer count: 3
has answer: http://stackoverflow.com/a/27921577
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27921584
possible better answer: http://stackoverflow.com/a/27921577
type: Question
accepted answer: http://stackoverflow.com/a/27923422

http://stackoverflow.com/q/27951910
tagged with: validation
has comment: http://stackoverflow.com/comment/44328663
tagged with: javascript
has comment: http://stackoverflow.com/comment/44341722
has body: This is what my code currently looks like: ;(function($){ $.fn.forms=function(o){ return this.each(function(){ var th=$(this) ,_=th.data('forms')||{ errorCl:'error', emptyCl:'empty', invalidCl:'invalid', notRequiredCl:'notRequired', successCl:'success', successShow:'4000', mailHandlerURL:'bat/MailHandler.php', ownerEmail:'email@email.com', stripHTML:true, smtpMailServer:'localhost', targets:'input,textarea', controls:'a[data-type=reset],a[data-type=submit]', validate:true, rx:{ ".name":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'}, ".email":{rx:/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i,target:'input'}, ".phone":{rx:/^\+?(\d[\d\-\+\(\) ]{5,}\d$)/,target:'input'}, ".date":{rx:/.{20}/,target:'input'}, ".serve":{rx:/^\+?(\d[\d\-\+\(\) ]{1,}\d$)/,target:'input'}, ".occasion":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'}, ".flavour":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'}, ".message":{rx:/.{20}/,target:'textarea'} }, All I would like to know is what I should do for: ".date":{rx:/.{20}/,target:'input'}, ".serve":{rx:/^\+?(\d[\d\-\+\(\) ]{1,}\d$)/,target:'input'}, ".occasion":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'}, ".flavour":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'}, what I mean is, what should the '/^+?(\d[\d-+() ]{1,}\d$)/', the stuff in the middle be and what are they for/do? I am 100% new at JavaScript as I am used to PHP and HTML. This is a website with will be used for my cake bakery. I want the date to work with dd/mm/yyy I want the serve to work with at least 1 number I want the occasion to work with any text and I want the flavour to work with any text e.g. Date: 08/12/2016 Server: 23 Occasion: Birthday Flavour: Chocolate
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44328558
has title: Date Validation with Javascript, ".date":{rx:.........,target:'input'},
has comment: http://stackoverflow.com/comment/44300899
has comment: http://stackoverflow.com/comment/44300755
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44328606
has comment: http://stackoverflow.com/comment/44328649
tagged with: date
type: Question
score: 0

http://stackoverflow.com/q/27807022
has comment: http://stackoverflow.com/comment/44038047
tagged with: javascript
upvote count: 11
tagged with: karma-jasmine
answer count: 1
tagged with: jasmine
favorite count: 0
has comment: http://stackoverflow.com/comment/44023009
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27822691
has comment: http://stackoverflow.com/comment/44051121
score: 11
has body: I got a problem when I tried to test my controller. When I run my test I got an error Error: [ng:areq] Argument 'MainCtrl' is not a function, got undefined http://errors.angularjs.org/1.3.8/ng/areq?p0=MainCtrl&amp;p1=not%20a%20function%2C%20got%20undefined at assertArg (/Users/tetianachupryna/project/bower_components/angular/angular.js:1577) at assertArgFn (/Users/tetianachupryna/project/bower_components/angular/angular.js:1588) at /Users/tetianachupryna/project/bower_components/angular/angular.js:8418 at /Users/tetianachupryna/project/src/spec/controllers/main-controller.spec.js:11 at /Users/tetianachupryna/project/src/spec/controllers/main-controller.spec.js:17 at /Users/tetianachupryna/project/node_modules/karma-jasmine/lib/adapter.js:184 at http://localhost:9877/karma.js:185 at http://localhost:9877/context.html:51 I know that SO is full of similar questions. But I'm a total null in Angular and JS in general, so those answers didn't help me. From similar questions on SO I discovered that my problem is in wrong definition of the controller but I still can't figure out what I did wrong. I've stack and I'm begging for your help. First of all here is my src/app/index.js file where my module is defined var app = angular.module('myModule', [ 'ngAnimate', 'ngSanitize', 'ngResource', 'ui.router', 'pascalprecht.translate', 'thing1', 'thing2']); Here is src/app/controllers/main-controller.js angular.module('myModule').controller('MainCtrl', [ '$scope', '$state', function ($scope, $state) { $scope.state = $state; //*** $scope.isBigStep = function isBigStep() { return $state.$current.step == 3; }; }]); And finally this a file with the test src/spec/controllers/main-controller.spec.js describe('MainCtrl', function() { var scope, $state, createController; beforeEach(inject(function ($rootScope, $controller) { scope = $rootScope.$new(); createController = function() { return $controller('MainCtrl', { '$scope': scope }); }; })); it('should make 3 as current step', function() { …
type: AnsweredQuestion
tagged with: karma-runner
downvote count: 0
has answer: http://stackoverflow.com/a/27822691
type: Question
has title: Karma error Argument 'Controller' is not a function, got undefined

http://stackoverflow.com/comment/44097691
type: Comment
has text: Yes, all console.log in my code work, but not inside the setTimeout.
score: 0
comment on: http://stackoverflow.com/q/27846962
type: QuestionComment

logic
tags question: http://stackoverflow.com/q/27960282
tag name: logic
type: Tag

http://stackoverflow.com/q/27924221
upvote count: 2
has body: I have created a form that allows users to enter data, users may also add a new text box if necessary or remove one. I want to be able to read all the text boxes that a user fills in but at the moment it only reads whatever is in the last text box, added by the user. Is there something more I need to add in? PHP and HTML if (isset($_POST['submit'])) { // Process the form // validations $required_fields = array("brandName", "brandCategory" , "brandKeyword"); validate_presences($required_fields); if (empty($errors)) { // Perform Create $brandName = mysql_prep($_POST["brandName"]); $brandCategory = mysql_prep($_POST["brandCategory"]); $brandKeyword = mysql_prep($_POST["brandKeyword"]); $keyword = array($brandKeyword); $count = count($keyword); for($i = 0; $i < $count; $i++){ $brandKeyword = implode(',' , $keyword); } $query = "INSERT INTO brands ("; $query .= " brandName, brandCategory, brandKeyword"; $query .= ") VALUES ("; $query .= " '{$brandName}', '{$brandCategory}', '{$brandKeyword}'"; $query .= ")"; $result = mysqli_query($connection, $query); if ($result) { // Success $_SESSION["message"] = "Brand has been stored"; redirect_to("add_brands.php"); } else { // Failure $_SESSION["message"] = "Information could not be stored"; } } } else { // This is probably a GET request } // end: if (isset($_POST['submit'])) ?> <?php $layout_context = "user"; ?> <?php include("../includes/layouts/header.php"); ?> <?php include("../includes/layouts/navigation.php"); ?> <?php echo message(); ?> <?php echo form_errors($errors); ?> Add Brand Information Brand Name: Brand Category: Select... Animation Automotive Beauty & Fashion Comedy Cooking & Health DIY Fashion Film & Entertainment Food & Drink Gaming Lifestyle Music News & Politics Science & Education Sports Technology Television Brand Keyword:1 Cancel Javascipt jQuery(document).ready(function($){ $('#manage_brands .add-box').click(function(){ var n = $('.text-box').length + 1; var box_html = $(' Brand Keyword ' + n + ' '); box_ht…
has answer: http://stackoverflow.com/a/28001895
tagged with: php
type: Question
accepted answer: http://stackoverflow.com/a/28001895
tagged with: mysql
has title: Storing data form multiple text boxes
has comment: http://stackoverflow.com/comment/44251148
has comment: http://stackoverflow.com/comment/44246163
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44245417
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/27836838
has answer: http://stackoverflow.com/a/29594360
score: 49
linked to: http://stackoverflow.com/q/22604934
downvote count: 1
has body: I have an embedded YouTube video in one page and have a slider with which I can set the player speed. I am using player.setPlaybackRate(value); The problem is that I want ranges from 0.5 to 3, but the player API restricts the values only to predefined [0.25, 0.5, 1, 1.25, 1.5, 2]. In YouTube I can easily adjust the speed with document.getElementsByTagName("video")[0].playbackRate = 3 but on the iframe I do not have such access.
type: Question
tagged with: api
has answer: http://stackoverflow.com/a/29710343
has answer: http://stackoverflow.com/a/29616802
tagged with: javascript
linked to: http://stackoverflow.com/q/21566267
has title: Embedded YouTube video with custom speed (e.g. 3)
possible better answer: http://stackoverflow.com/a/29704933
has answer: http://stackoverflow.com/a/29704933
upvote count: 50
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/29616802
tagged with: youtube-api
tagged with: youtube
tagged with: video
type: AnsweredQuestion

http://stackoverflow.com/a/27959352
answers question: http://stackoverflow.com/q/27959074
has comment: http://stackoverflow.com/comment/44314250
has body: As your comment stated, your scripts.app.js is injected just before &lt;/body&gt;. This means the script's functions are available after it is evaluated by the browser. Because you try to run your script before that has happened, it won't detect your X() function. Use the document ready to make sure all scripts are evaluated: if (String.IsNullOrEmpty(stringQueryElement) &amp;&amp; !upcoming.Any()) { &lt;script type="text/javascript"&gt; $(function() { X(); }); &lt;/script&gt; } } (Assuming you're using jQuery)
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27959074
type: Answer

http://stackoverflow.com/comment/44113756
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27854459
has text: Just having trouble with where to start

http://stackoverflow.com/q/27951560
linked to: http://stackoverflow.com/q/40620576
upvote count: 7
type: AnsweredQuestion
score: 7
has answer: http://stackoverflow.com/a/27952240
type: Question
downvote count: 0
answer count: 1
has title: Adding a horizontal line to d3 graph displays at the wrong value
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44298484
accepted answer: http://stackoverflow.com/a/27952240
tagged with: http://stackoverflow.com/tag/svg
has body: I am trying to add a horizontal line to my graph, relative to the y-axis values, the problem is that they show up at the wrong positions. The 2 lines should display at values 90 and 140 relative to the y-axis values. The code I used to add the line is below: if (before_meal !== null || after_meal !== null) { svg.append("svg:line") .attr("x1", 0) .attr("x2", width) .attr("y1", before_meal) .attr("y2", before_meal) .style("stroke", "rgb(189, 189, 189)"); svg.append("svg:line") .attr("x1", 0) .attr("x2", width) .attr("y1", after_meal) .attr("y2", after_meal) .style("stroke", "rgb(189, 189, 189)"); } Please see my working example here: JSFiddle
tagged with: angularjs
tagged with: d3.js

http://stackoverflow.com/comment/44075578
score: 0
type: Comment
type: QuestionComment
has text: please explain what is the issue
comment on: http://stackoverflow.com/q/27835422

kendo-ui
tags question: http://stackoverflow.com/q/27822565
tags question: http://stackoverflow.com/q/27948439
tags question: http://stackoverflow.com/q/27947152
tags question: http://stackoverflow.com/q/27913967
tags question: http://stackoverflow.com/q/27895544
tags question: http://stackoverflow.com/q/27865397
type: Tag
tag name: kendo-ui
tags question: http://stackoverflow.com/q/27864486
tags question: http://stackoverflow.com/q/27901838
tags question: http://stackoverflow.com/q/27911040
tags question: http://stackoverflow.com/q/27900658
tags question: http://stackoverflow.com/q/27946549
tags question: http://stackoverflow.com/q/27817258
tags question: http://stackoverflow.com/q/27858193
tags question: http://stackoverflow.com/q/27886951
tags question: http://stackoverflow.com/q/27855749
tags question: http://stackoverflow.com/q/27933006

http://stackoverflow.com/a/27938804
answers question: http://stackoverflow.com/q/27938629
accepted answer of: http://stackoverflow.com/q/27938629
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: It happens because your browser cached the page on the client. The solution is to prevent the caching of that page(s), by forcing the browser to request a new page even when pressing Back button, instead of reading the saved one. Read This and this Update : 1)You can use some authentication token which you have to get from server side and you need to validate it in each pageload event happens.So simply you can save this token in any of the browser storage spaces, and clear it once the user been log out if the token is not available then redirect the user to login page 2) Or simply create a cookie variable when user login and clear it when logout and check this cookie is available in each page load event.

http://stackoverflow.com/q/27853868
accepted answer: http://stackoverflow.com/a/27855269
has comment: http://stackoverflow.com/comment/44111975
tagged with: socket.io
type: Question
has title: node.js socket.io instead of AJAX
tagged with: javascript
has comment: http://stackoverflow.com/comment/44111716
tagged with: ajax
score: 0
answer count: 1
has body: This question is regarding improving speed and minimizing idle time.... One of my page requires 2 database calls. first db call is about user data which is fast operation. second db call is an aggregation pipeline call which takes more time to finish. So I just render the page once the first db call is complete. Then use AJAX call to perform second db op and display it on the page. Question - I know how socket.io works, but is it possible to do the following: Browser requests page Server computes db call #1 and sends the response Server continues to compute db call#2 and waits for browser to connect via socket.io Browser renders page from step #2 and connects to browser using socket.io Server sends results of db call#2 to browser. What I achieve is #3 executes while #4 is executed hence minimizing server idle time and optimizing user experience. Thanks for any input.
has comment: http://stackoverflow.com/comment/44112245
has comment: http://stackoverflow.com/comment/44111937
has answer: http://stackoverflow.com/a/27855269
has comment: http://stackoverflow.com/comment/44112092
has comment: http://stackoverflow.com/comment/44112033
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/comment/44220864
comment on: http://stackoverflow.com/q/27910618
score: 0
type: Comment
type: QuestionComment
has text: @lolio you can specify custom messages by `messages: {username: "your_message" }`

http://stackoverflow.com/comment/44191973
type: Comment
has text: ```video_id``` is a string, not a DOM element.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27895545

http://stackoverflow.com/a/27836989
accepted answer of: http://stackoverflow.com/q/27834946
answers question: http://stackoverflow.com/q/27834946
type: AcceptedAnswer
downvote count: 0
has body: You cannot set that heading in a request of that kind, the browser will block it - along with many other header types. In a Chrome extension however you can use chrome.webRequest to alter headers. This will adjust a User Agent. Change to your desired URL, following the Match Patterns guidelines. Remember to add permissions for webRequest and webRequestBlocking to your manifest. chrome.webRequest.onBeforeSendHeaders.addListener(function(details){ for(var i=0; i &lt; details.requestHeaders.length; ++i){ if(details.requestHeaders[i].name === "User-Agent"){ details.requestHeaders[i].value = "Desired User Agent Here"; break; } } return {requestHeaders: details.requestHeaders}; }, {urls: ["&lt;all_urls&gt;"]}, ["blocking", "requestHeaders"]);
type: Answer
score: 7
upvote count: 7

http://stackoverflow.com/comment/44199041
type: QuestionComment
comment on: http://stackoverflow.com/q/27899498
type: Comment
score: 1
has text: use loop. set id to 'defatar1','defatar2'... then in your selector something like 'document.getElementById("defatar" + loopindex)'

http://stackoverflow.com/a/27932183
has body: Try this window.addEventListener('keydown', keydownCallback); function keydownCallback(event) { if (event.keyCode === 191) { setTimeout(setFocusToTextBox); // setTimeout prevents insertion of slash } } function setFocusToTextBox() { document.getElementById("order_number").focus(); } &lt;input id="order_number" placeholder="Press / and I will be focused" size="60"&gt; Press Run Code Snippet Click somewhere on the area around the input Press / and the input will be focused.
answers question: http://stackoverflow.com/q/27931610
has comment: http://stackoverflow.com/comment/44263227
accepted answer of: http://stackoverflow.com/q/27931610
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27956178
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27957555
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44307512
has title: Google Maps API: InfoWindow at wrong location
downvote count: 1
type: Question
has body: My program right now takes input as a message and location, then it will change the map center to that new location and display a message there. Here's the relevant snippet (full code available upon request) function submitPosition(position){ var messageContent = $('#message').val(); var dateTime = new Date(); var px = position.coords.latitude; var py = position.coords.longitude; var newLoc = new google.maps.LatLng(px, py); db.push({ author: "Anynomous", message: messageContent, date: dateTime.toString(), location: newLoc }); map.setCenter(newLoc, 5); var infoWindow = new google.maps.InfoWindow({ content: "&lt;p&gt;" + messageContent + "&lt;/p&gt;", location: newLoc }); infoWindow.open(map); } However, only the map is put at the right center, and the message is off. I don't understand what's really going on.
has comment: http://stackoverflow.com/comment/44307205
tagged with: javascript
score: -1
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44307281

http://stackoverflow.com/comment/44029351
has text: It seems *XMLSerializer* is [*available in IE 9+*](http://blogs.msdn.com/b/ie/archive/2010/10/15/domparser-and-xmlserializer-in-ie9-beta.aspx), so maybe you only need the div hack for IE 8? Feature test for support and fallback if required.
score: 1
comment on: http://stackoverflow.com/q/27809743
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27915629
accepted answer of: http://stackoverflow.com/q/27915329
answers question: http://stackoverflow.com/q/27915329
type: Answer
has body: Try decreasing the time after which the ProgressTemplate is displayed. By default this is 5 seconds. This behaviour is controlled by the Property: DisplayAfter Specify the number of milliseconds to elapse before showing the progress control, i.e 2000 if you wish to wait for 2 seconds &lt;asp:UpdateProgress DisplayAfter="2000" AssociatedUpdatePanelID="UpdtBank" id="updateProgress" DynamicLayout="true" runat="server" /&gt;
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/27916444
has body: var latitude = document.getElementById("latitude"); var longitude = document.getElementById("longitude"); var myCenter = new google.maps.LatLng(latitude, longitude); var marker; function initialize() { var mapProp = { center: myCenter, zoom: 5, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("googleMap"), mapProp); marker = new google.maps.Marker({ position: myCenter, animation: google.maps.Animation.BOUNCE }); marker.setMap(map); } google.maps.event.addDomListener(window, 'load', initialize); var latitude didn't get the values here I get the values from below ids, &lt;div class="map" id="googleMap" style="width:100%;height:260px;overflow:hidden;"&gt;&lt;/div&gt; &lt;div id="latitude"&gt;&lt;?php echo $itemData['130']; ?&gt;&lt;/div&gt; &lt;div id="longitude"&gt;&lt;?php echo $itemData['131']; ?&gt;&lt;/div&gt; In $itemData['130'] and $itemData['130'] gets the value fine, I don't know what's the mistake I done?
has answer: http://stackoverflow.com/a/27916488
answer count: 4
favorite count: 0
has title: Dynamic markers not working using new variable
tagged with: php
has answer: http://stackoverflow.com/a/28454592
type: AnsweredQuestion
tagged with: dynamic
has answer: http://stackoverflow.com/a/27916461
type: Question
upvote count: 4
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44231832
downvote count: 0
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/28454592
has answer: http://stackoverflow.com/a/27921133
has comment: http://stackoverflow.com/comment/44231751
tagged with: google-maps-markers
possible better answer: http://stackoverflow.com/a/27916488

http://stackoverflow.com/comment/44229762
has text: You want the native `JSON.parse` to be able to parse invalid JSON? I believe that is not possible.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27906805
type: Comment

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

http://stackoverflow.com/comment/44271796
type: QuestionComment
score: 0
has text: Your server side method doesn't have return type. Exactly what your method is doing?
comment on: http://stackoverflow.com/q/27937456
type: Comment

http://stackoverflow.com/q/27810639
has title: Getting the properties of a GeoJSON data layer in Google Maps V3
tagged with: jquery
has body: When loading a geoJSON file into a Google Map as a data layer, how does one access the properties of the data layer itself? I know how to access the individual properties, like posts_here in the below example. What I'm looking to get is the properties for the layer itself- in this example, maxPosts. $.getJSON("http://example.com/posts/grid.json" + location.search, function (data) { grid = map_canvas.data.addGeoJson(data); map_canvas.data.setStyle(function(feature) { return /** @type {google.maps.Data.StyleOptions} */({ strokeWeight: Math.log(feature.getProperty('posts_here')), }); }) }); Example of the grid.json I'm loading: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [-58,-35], [-58,-34], [-57,-34], [-57,-35], [-58,-35] ] ] }, "properties": { "posts_here": "177" } } ], "properties": { "maxPosts": "177" } }
favorite count: 0
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27830109
type: Question
has answer: http://stackoverflow.com/a/27825323
tagged with: javascript
score: 6
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/27830109
answer count: 2
tagged with: google-maps
possible better answer: http://stackoverflow.com/a/27825323
downvote count: 0

http://stackoverflow.com/comment/44120264
score: 0
comment on: http://stackoverflow.com/q/27858568
type: Comment
type: QuestionComment
has text: like this ? http://stackoverflow.com/questions/2709612/using-object-create-instead-of-new?rq=1

http://stackoverflow.com/comment/44117336
type: Comment
score: 0
has text: are you using firefox or chrome dev tools?
comment on: http://stackoverflow.com/q/27857131
type: QuestionComment

http://stackoverflow.com/comment/44286650
type: Comment
has text: @dystroy, just testing, but looks promising....:) It all works, and this was the solution to the JQuery solution not working as well. So a big thank you
score: 0
comment on: http://stackoverflow.com/a/27944203
type: AnswerComment

http://stackoverflow.com/comment/44312806
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27959104
score: 1
has text: You can inspect network activity in your favorite browser's Dev Tools panel, look at what HTTP requests are made when you click on that button. When I enter "taipei" for example, I can see that there's a GET request for `https://maps.googleapis.com/maps/api/js/GeocodeService.Search?4staipei&7sUS&9sen-US&callback=_xdc_._2e312p&token=46610`, which returns some Javascript data, with an object

http://stackoverflow.com/comment/44065007
type: Comment
comment on: http://stackoverflow.com/a/27829383
has text: @DavidL thanks for pointing that out, I thought this was a WebAPI question due to the title.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27861970
downvote count: 3
upvote count: 1
has title: History API in html5
has comment: http://stackoverflow.com/comment/44147998
has body: In history API, I can use pushState() for tabbing structure to display different content based on tab clicked. When ( click on tab2, the url changes to http://localhost/mysite/tab2 But When I bookmark this url and then open this bookmark, it shows this error: The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15 What workaround can be done to enable it for bookmarking? PS: I have read about hashbang technnique but that is degrading trend now a days. So don't want to use hashbang.
type: Question
has comment: http://stackoverflow.com/comment/44147953
score: -2
has comment: http://stackoverflow.com/comment/44126134
tagged with: javascript
has comment: http://stackoverflow.com/comment/44149265
answer count: 1
has comment: http://stackoverflow.com/comment/44148079
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44156602
has answer: http://stackoverflow.com/a/27873424
tagged with: http://stackoverflow.com/tag/html
tagged with: html5-history

http://stackoverflow.com/q/27939610
has comment: http://stackoverflow.com/comment/68358109
has body: I am working on a Rails project where I am using Equation Editor plugin in CKEditor for displaying editors in text-areas The CodeCogs Latex Editor is working properly if the view contain only one CKEditor instance. When multiple instances occur in the same view the equation editor is not working properly. I found a similar issue raised here. But solution given there is not working. Update This is the error that I get on the browser console: Resource interpreted as Script but transferred with MIME type text/html: "http://latex.codecogs.com/eqneditor/editor_embedded_json.php?id=CCtoolbar1&amp;SID=&amp;design=efull". eq_editor-lite-17.js:1
answer count: 0
has title: CodeCogs Latex Editor not working properly with multiple instances of CKEditor
tagged with: javascript
tagged with: ckeditor
tagged with: jquery
type: UnansweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/68121219
favorite count: 0
has comment: http://stackoverflow.com/comment/68322299
type: Question
upvote count: 2
tagged with: ruby-on-rails

http://stackoverflow.com/comment/44160225
type: Comment
comment on: http://stackoverflow.com/q/27879257
has text: you are comparing numbers to strings
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44308380
has text: thanks for the help. that worked as is. there were other reasons I couldn't get it to work do to the fact that I am a true newbie
type: AnswerComment
comment on: http://stackoverflow.com/a/27881545
score: 0
type: Comment

http://stackoverflow.com/comment/44141744
has text: Dear Trimegistus,I will definitely mark answer as correct. However, I do want you to know that I truly appreciate your time and effort. It was bugging me for a day and I was stuck. You helped me tremendously.
comment on: http://stackoverflow.com/a/27867774
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44182715
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27890811
has text: You're probably right Paul, though there was no indication of a problem along any step of the way. No errors. Files are where they expected and look as expected. I'm tempted to remove express, node, and all of it - and start fresh.

http://stackoverflow.com/q/27918829
has comment: http://stackoverflow.com/comment/44241632
answer count: 1
has comment: http://stackoverflow.com/comment/44235571
accepted answer: http://stackoverflow.com/a/27922903
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44235851
has comment: http://stackoverflow.com/comment/44235981
tagged with: javascript
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/27922903
tagged with: gps
has body: i'm writing a mobile app with htlm5 and javascript using the phonegap build service. I try to get the geolocation but it doesn't work if the GPS is off on my smartphone. I get the alert("Sorry, no position available.") alert after maybe 30 seconds. If i turned the gps on so i get the geolocation. I tried getCurrentPosition and watchPosition both not work for me. My Code: document.addEventListener("deviceready", onDeviceReady, false); var geo_options = { enableHighAccuracy : true, maximumAge : 30000, timeout : 27000 }; function onDeviceReady() { // navigator.geolocation.getCurrentPosition(geo_success, geo_error, geo_options); navigator.geolocation.watchPosition(geo_success, geo_error, geo_options); } function geo_success(position) { alert(position.coords.latitude+" "+position.coords.longitude); } function geo_error() { alert("Sorry, no position available."); } How can i get the Geolocation when the GPS is Off on the smartphone?
tagged with: cordova
score: 0
tagged with: geolocation
has comment: http://stackoverflow.com/comment/44235776
has title: Geolocation doesn't work with GPS off

http://stackoverflow.com/comment/44177420
type: QuestionComment
comment on: http://stackoverflow.com/q/27888204
has text: What have you triead already?
score: 0
type: Comment

http://stackoverflow.com/comment/44291596
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27948319
has text: Yes, even if your code opened it. Does not matter.
score: 0

http://stackoverflow.com/q/27844553
score: 23
possible better answer: http://stackoverflow.com/a/49184108
has body: I am trying to simulate the response to this API URL http://api.myapihost.com/images?foo=bar&amp;spam=egg The URL parameter combinations can vary. I am trying to intercept this request and respond with an empty object. nock('http://api.myapihost.com') .persist() .get('/images', '*') .reply(200, {}); I get this error message when my test case runs: Uncaught Error: Nock: No match for HTTP request GET /images?height=2500 How can I configure nock to match any combination of URL parameters?
has answer: http://stackoverflow.com/a/27844948
tagged with: node.js
favorite count: 0
has title: How to match any parameter combination in a URL?
upvote count: 23
tagged with: nock.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27844948
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/49184108
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27958334
has body: In this line you find any video tags on the page and try to copy it's content into div: var $video = $('video'); ... $('.video-label').html($video.get(0).outerHTML); But if you delete video from the page there will be nothing to copy. You need to move video tag inside div in first place. Or create it dynamically, not by copying, when user clicks link.
answers question: http://stackoverflow.com/q/27957710
score: 0
type: Answer

http://stackoverflow.com/q/27953240
has comment: http://stackoverflow.com/comment/44302882
has title: Uncheck a checkbox in dat.gui
has answer: http://stackoverflow.com/a/30787446
type: Question
has comment: http://stackoverflow.com/comment/44302614
answer count: 2
linked to: http://stackoverflow.com/q/16166440
tagged with: javascript
has comment: http://stackoverflow.com/comment/44301798
favorite count: 0
upvote count: 3
has body: When I change the option of a dropdown menu, I want all the checkboxes to be unchecked. Here's the code that I put inside a function that's called when the dropdown menu changes: var inputs = document.getElementsByTagName("input"); for(var i = 0; i &lt; inputs.length; i++) { if(inputs[i].type == "checkbox") { inputs[i].checked = false; } } This does indeed uncheck the checkbox. However, to recheck the checkbox, it takes two clicks. It appears that dat.gui still thinks the checkbox is checked, so it takes one click to uncheck it, and one more to check it. How do I make dat.gui update the checkboxes? Edit: Here's the current state of the problem. gui = new dat.GUI; controllers = []; var menu = { 'This is an example': false, } controllers[0] = gui.add(menu, 'This is an example').onFinishChange( function(value) {console.log('example');} ).listen(); menu['This is an example'] = false; With this code, the checkbox is unchecked, due to the .listen() call and setting the variable to false. However, it still takes two clicks for the check to show--one to "uncheck" the checkbox, and one to check it.
tagged with: checkbox
tagged with: dat.gui
has comment: http://stackoverflow.com/comment/44302640
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44301761
has comment: http://stackoverflow.com/comment/44302621
has comment: http://stackoverflow.com/comment/44302710
has comment: http://stackoverflow.com/comment/44302753
has answer: http://stackoverflow.com/a/27953379
score: 3

http://stackoverflow.com/comment/44244221
has text: How do the divs hold the images? By css or by image-tag?
comment on: http://stackoverflow.com/q/27923635
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/71070406
downvote count: 0
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/135101895
has comment: http://stackoverflow.com/comment/135093226
answers question: http://stackoverflow.com/q/27867304
has body: Remove following line from your code: data-toggle = "modal" Then, in your function once your validation is done, write following code: $('#myModal').modal({ show: true });

http://stackoverflow.com/comment/44147445
comment on: http://stackoverflow.com/q/27872572
score: 0
type: Comment
type: QuestionComment
has text: Also can not reproduce. Tested in all latest browsers. Can you include the specific browser and version you are experiencing this in?

http://stackoverflow.com/q/27881773
type: Question
has comment: http://stackoverflow.com/comment/44165176
has title: How come my JavaScript isn't working?
has comment: http://stackoverflow.com/comment/44165187
tagged with: javascript
has comment: http://stackoverflow.com/comment/44165165
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27881798
favorite count: 0
has comment: http://stackoverflow.com/comment/44165192
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/44165162
downvote count: 4
has body: I am doing a login page for school. I have written the page, but the JavaScript does not seem to work with the form. I have checked over both the form and the JavaScript multiple times, but I see no mistake. Can anyone help me? function processInfo() { var theusername; var thepassword; theusername = document.myForm.username.value; thepassword = document.myForm.password.value; if (document.myForm.username.value = "") { alert("Please enter in the username.") return false; } else if (document.myForm.password = "") { alert("Please enter in the password.") return false; } else if (document.myForm.username.value != "andrew123") { document.myForm.txtOutput.value = "Incorrect username or password." } else if (thepassword != "abc") { document.myForm.txtOutput.value = "Incorrect username or password." } else if (theusername == "andrew123" thepassword == "abc") { document.myForm.txtOutput.value = "Correct! You have successfully logged in." } } User Name: Password:
has comment: http://stackoverflow.com/comment/44165270
has comment: http://stackoverflow.com/comment/44165181

http://stackoverflow.com/a/27850912
has comment: http://stackoverflow.com/comment/44106486
has comment: http://stackoverflow.com/comment/44106418
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44115006
score: 4
has comment: http://stackoverflow.com/comment/44108516
type: Answer
upvote count: 4
has body: $.getJSON runs asynchronously, markers will not be populated yet when you use it as argument for MarkerClusterer. Use markerCluster.addMarker(marker); instead of markers.push(marker);
downvote count: 0
answers question: http://stackoverflow.com/q/27850668
has comment: http://stackoverflow.com/comment/44109555
has comment: http://stackoverflow.com/comment/44106650
accepted answer of: http://stackoverflow.com/q/27850668

http://stackoverflow.com/a/27859799
upvote count: 1
has body: You can keep the relevant data in a dedicated service, or use native JS storage services such as sessionStorage or localStorage. Services are singletons and can be used to share data between controllers. Read about sessionStorage and localStorage here: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27859642

http://stackoverflow.com/q/27828434
has body: I guess it's basic stuff, but can't find any solution. Say, I have 2 objects and want to display only their overlapping parts (i.e. their intersection). Any hints?
tagged with: webgl
has answer: http://stackoverflow.com/a/27832297
has title: Displaying only overlapping parts
type: Question
has answer: http://stackoverflow.com/a/27828894
has answer: http://stackoverflow.com/a/27832177
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27828894
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/27832177
tagged with: three.js
type: AnsweredQuestion

http://stackoverflow.com/comment/44250811
comment on: http://stackoverflow.com/q/27926852
type: QuestionComment
has text: `} else if({` notice that lingering `(` is that supposed to be there?
type: Comment
score: 0

http://stackoverflow.com/a/27949285
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44313865
upvote count: 1
has body: There may be a better way but you could check to see if the current target is the same as the previous target. If it is, clear the interval. If it's not, set the previousTarget as the current one: if(e.target == previousTarget){ clearTimeout(timer); }else{ previousTarget = e.target; } FIDDLE
type: Answer
has comment: http://stackoverflow.com/comment/44325844
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27948823
answers question: http://stackoverflow.com/q/27948823

http://stackoverflow.com/comment/44166716
type: QuestionComment
has text: why not a.foo = function ?, but you should remove the 'new'
type: Comment
comment on: http://stackoverflow.com/q/27882464
score: 0

http://stackoverflow.com/comment/44224178
type: Comment
has text: Is `sw = Math.max((44 - .06*scrollTop), 0)` more convenient?
type: QuestionComment
comment on: http://stackoverflow.com/q/27912345
score: 0

http://stackoverflow.com/comment/44200416
comment on: http://stackoverflow.com/a/27890520
has text: @wmok no, try it in your js console. `joe.species` exists, `joe.prototype` doesn't.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27885542
accepted answer: http://stackoverflow.com/a/27885573
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44172300
has title: How to increase a value inside a dictionary
type: AnsweredQuestion
has body: Hey Guys so i have a page that displays a list inside ionic. TLDR - Basically i want a buy button that increases {{recipe.quantity}}?? That list just lists uses ng-repeat "recipe in recipes" to list them all. When i click on one it loads the details page which pulls data from a dictionary how do i make a button appear on the details page that increase the quantity of that item and make that item callable by a span? does this all make sense? is there a better way to have an amount of items that i dont have to manually code each button, just have the button check the price of the item inside the dictionary and increase it if possible updating a span? if you need further info just ask, I hope it's clear what i am asking. http://jsfiddle.net/d8dc2opm/ angular.module('starter', ['ionic', 'starter.controllers', 'starter.services']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if (window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); } if (window.StatusBar) { // org.apache.cordova.statusbar required StatusBar.styleDefault(); } }); }) .config(function($stateProvider, $urlRouterProvider) { // Ionic uses AngularUI Router which uses the concept of states // Learn more here: https://github.com/angular-ui/ui-router // Set up the various states which the app can be in. // Each state's controller can be found in controllers.js $stateProvider // setup an abstract state for the tabs directive .state('tab', { url: "/tab", abstract: true, templateUrl: "templates/tabs.html" }) // Each tab has its own nav history stack: .state('tab.main', { url: '/main', views: { 'tab-main': { templateUrl: 'templates/tab-main.html', controller: 'mainCtrl' } } }) .state('tab.dash', { url: '/dash', views: { 'tab-dash': { templateUrl: 'templates/tab-dash.html', controller: 'DashCtrl' } } }) .state('tab.recipes', { url…
type: Question
has answer: http://stackoverflow.com/a/27885573
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44172331
answer count: 1
tagged with: dictionary

http://stackoverflow.com/comment/44232553
type: QuestionComment
comment on: http://stackoverflow.com/q/27916977
has text: but I want it to be placed in a popup.
score: 0
type: Comment

http://stackoverflow.com/comment/44122722
type: Comment
comment on: http://stackoverflow.com/a/27858105
has text: I tried putting this into my script function calculateChange(amountDue, currencyValue) { function calculateChange(due, values) { var remains = due; for (var currentValue in values) { if (remains/values[currencyValue[i]]>1) { change[values[currencyValue[i]]] = Math.floor(remains/values[currencyValue[i]]); remains = remains%values[currencyValue[i]]; } } return change; }
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44292068
has text: try area instead of this
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27948564
score: 0

http://stackoverflow.com/q/27898769
tagged with: ios
tagged with: javascript
has body: I would like to develop a remote monitoring application for iOS devices. For this I need to communicate with iOS devices (iPhone/iPad) from Mac machine and get the screenshot from the device as well as send keystrokes or touch events to the device. For example, I need to send following to the device to get capture the screen: UIATarget.localTarget().captureScreenWithName("LoginScreen") How should I send this command to the device and receive the screenshot? I need some pointers to communicate with the devices. My basic requirement is - I have a iPhone application running. Now From client side (From remote machine through browser) we are controlling application. If I click on a login button then that operation should fired on on a device connected to Mac server. In this way we can fire events periodically. Any help is appreciated.
favorite count: 0
has answer: http://stackoverflow.com/a/27899089
type: UnansweredQuestion
downvote count: 2
tagged with: swift
has answer: http://stackoverflow.com/a/30341955
tagged with: ios5
score: 1
upvote count: 3
linked to: http://stackoverflow.com/q/26136429
has title: Remote Access of iOS devices
type: Question
answer count: 2
tagged with: appium

http://stackoverflow.com/q/27882676
tagged with: javascript
has title: jQuery changing elements depending on how many times the button has been clicked
answer count: 3
has answer: http://stackoverflow.com/a/27882756
downvote count: 0
has answer: http://stackoverflow.com/a/27882752
accepted answer: http://stackoverflow.com/a/27882752
tagged with: jquery
favorite count: 0
has body: I don't know if I just don't know how to use .toggle() or if I'm just writing the .click() function wrong but essentially I want two different things to happen when I click a button, depending on if it is toggled on or not. Basically if the button is clicked, I want the hidden div to show and I want the text of the button to change. Then when it's clicked again, the div is hidden again and the text changes back to what it was previously $(document).ready( function() { var count = 0; $("#dropdown-toggle-button").click(function() { count++; if (count % 2 !== 0) { // on odd clicks do this $('#dropdown-column').css('display', 'block'); $('#dropdown-toggle-button').text('Toggled Button'); } else if (count % 2 === 0) { // on even clicks do this $('#dropdown-column').css('display', 'none'); $('#dropdown-toggle-button').text('Un-toggled Button'); }; }); }); #dropdown-column { display: none; } Header Un-toggled Button Hello, Stranger
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/27882756
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27882856

http://stackoverflow.com/comment/44200262
score: 0
type: Comment
type: QuestionComment
has text: What's wrong with what you have? The value returned in the `_check` field will be the log_id, from which you can get the email, surely?
comment on: http://stackoverflow.com/q/27896780

http://stackoverflow.com/a/27917027
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/27916542
type: Answer
has body: All canvas path commands draw mono-width strokes. But here's one way to achieve your effect by repeatedly rotating an "image" of an arc around your starting point. You can create the "image" using an in-memory canvas. var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var c=document.createElement('canvas'); var cc=c.getContext('2d'); cc.beginPath(); cc.arc(0,52,50,Math.PI*6/4,Math.PI*2); cc.stroke(); for(var i=0;i&lt;10;i++){ ctx.translate(100,100); ctx.rotate(Math.PI/360*i); ctx.drawImage(c,0,0); ctx.setTransform(1,0,0,1,0,0); } body{ background-color: ivory; padding:10px; } #canvas{border:1px solid red;} &lt;canvas id="canvas" width=300 height=300&gt;&lt;/canvas&gt;
accepted answer of: http://stackoverflow.com/q/27916542

http://stackoverflow.com/comment/44804377
score: 0
has text: @KthProg either that or your {{html}} is doing something bad. Can you remove the {{html}} to make your example simpler? Any way you could get an example in a jsfiddle? You're way more likely to get your issues resolved with a jsfiddle or a plnkr.
type: Comment
comment on: http://stackoverflow.com/q/27953553
type: QuestionComment

http://stackoverflow.com/comment/44021475
score: 0
type: QuestionComment
type: Comment
has text: When Firebug tells you that you have a syntax error, it usually tells you what code triggered it.
comment on: http://stackoverflow.com/q/27806211

http://stackoverflow.com/comment/44252904
comment on: http://stackoverflow.com/q/27894056
type: Comment
type: QuestionComment
has text: Hi rfornal. I believe this is what needs to be flushed out: var newtime = x*audio.duration/barSize;
score: 0

http://stackoverflow.com/comment/44046786
type: AnswerComment
has text: Then it's not possible. You need proper CORS headers on the response. _But_ a good alternative (that does not require CORS) is to use an `img` and listen to `onLoad` on it as described in the answer here: http://stackoverflow.com/questions/9809015/image-onerror-event-never-fires-but-image-isnt-valid-data-need-a-work-around
type: Comment
comment on: http://stackoverflow.com/a/27817432
score: 0

http://stackoverflow.com/q/27898977
tagged with: sails.js
tagged with: javascript
has comment: http://stackoverflow.com/comment/48065116
linked to: http://stackoverflow.com/q/25872219
score: 0
has body: I am building a frontend using angular for a sails.js api backend. What is the best way to manage roles and rules-based routing in the angular app? I have been looking at UI Router as well, but I can't determine if UI Router has specific features to support this.
tagged with: authorization
has comment: http://stackoverflow.com/comment/44211296
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
has title: Roles Based Authentication for a sails.js web application
type: Question
tagged with: angular-ui-router

http://stackoverflow.com/q/27863874
tagged with: javascript
favorite count: 0
tagged with: angularjs
upvote count: 8
tagged with: sqlite
has title: Angular/Ionic and async SQLite - ensuring data factory initialised before return
has answer: http://stackoverflow.com/a/27948726
linked to: http://stackoverflow.com/q/16286605
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/27050496
tagged with: ionic-framework
score: 8
accepted answer: http://stackoverflow.com/a/27948726
has body: I'm writing a PhoneGap/Cordova app with Ionic, and using SQLite (with ngCordova) for persistent storage. The core of the app is a scrolling list of items which are retrieved from the SQLite database. listController.js .controller('ListCtrl', [ '$scope', 'dataFactory', function($scope, dataFactory) { var items = dataFactory.getAllItems().then(function(data){ $scope.allItems = data; }); } ]); dataFactory.js .factory('dataFactory', [function($window, $log, $q, $cordovaSQLite, dummyDataGenerator){ var db_; // ...lots of SQLite fun in here // cascading async callbacks to load the database and inject dummy data var openDB_ = function(){...}; var createTable_ = function(){...}; // etc var getAllItems = function(){ var q = $q.defer(); $cordovaSQLite.execute(db_, sqlSelectString, []).then( function(results) { $log.log("SQL SELECT successful"); var i, len, allItems = []; for(i = 0, len = results.rows.length; i &lt; len; i++) { allItems.push(results.rows.item(i)); } q.resolve(allItems); }, function (err) { q.reject(err); } ); return q.promise; }; return { getAllItems: getAllItems }; ]}); // &lt;-- factory Initially I was returning the factory straight away. The controller did getAllItems() which ran before the data was ready. The view was initially empty, only showing anything on return to the route after a second getAllItems() So I tried delaying the return of the factory by adding a factoryReady() function and only calling it once all the internal DB stuff was ready var factoryReady = function(){ return { getAllItems: getAllItems }; }; And now there's an undefined error as the entire factory is unavailable when first called, rather than getAllItems() simply returning empty-handed. I can see that the SQL database is being correctly written to in due course, but Angular throws an exception before this has finished. I realise now that this is predictable, I've read the post AngularJS : Initialize service with asynchronous data but don't quite understand how to implement the top…
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/44234918
comment on: http://stackoverflow.com/a/27917191
type: AnswerComment
score: 0
has text: Yes, Disabled inputs color should be little fad out.
type: Comment

http://stackoverflow.com/comment/44276292
comment on: http://stackoverflow.com/a/27915676
type: Comment
type: AnswerComment
has text: Nice suggestion but I don't want to go down the nested forms route. One of our clients is still on a very old version of IE and they don't work.
score: 0

http://stackoverflow.com/q/27827517
has answer: http://stackoverflow.com/a/27827763
answer count: 4
has title: Delayed closing of a javascript window
has comment: http://stackoverflow.com/comment/44060942
type: Question
has answer: http://stackoverflow.com/a/27828112
tagged with: javascript
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27828524
has answer: http://stackoverflow.com/a/27828019
has body: I'm working on a javascript window that displays ads for Google DFP. I'm a beginner in javascript, and the code I have here is adapted from another ad service. The window opens just fine on page load, and it closes when the close button is clicked, but I'd like it to close automatically after a certain amount of time (like say five seconds) has passed. Here's the code I'm using: Intestitial Test
has comment: http://stackoverflow.com/comment/44061230

http://stackoverflow.com/a/27946702
downvote count: 0
answers question: http://stackoverflow.com/q/27931142
has comment: http://stackoverflow.com/comment/44303741
has body: Here is another example that does more of what you want: 4 Videos or jwplayer("player1").onComplete(function(){ jwplayer("player2").play(); jwplayer("player1").stop(); }); etc.
has comment: http://stackoverflow.com/comment/44290629
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44300343
score: 1
accepted answer of: http://stackoverflow.com/q/27931142
type: AcceptedAnswer

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

http://stackoverflow.com/q/27856315
has comment: http://stackoverflow.com/comment/44150037
tagged with: node.js
has comment: http://stackoverflow.com/comment/44149310
type: AnsweredQuestion
has body: I am new to NodeJS and here is my routes/recom.js which is now doing a lot of logics stuffs. I will move the logics to somewhere else later. But now I need to solve the error first. exports.scrape = function(req, res) { var APIURI = 'https://www.kimonolabs.com/api/abbxqyg4?apikey=6IrCGNcorodTBSfNawS6sZkHw3LeZVIN'; var receivedJason; res.type('text/plain'); request({ url: APIURI, json: true }, function (error, response, body) { if (!error &amp;&amp; response.statusCode === 200) { console.log('API Retrieved Successfully!'); res.json(body); receivedJason = JSON.stringify(body); var node = db.createNode({hello: 'world'}); // instantaneous, but... node.save(function (err, node) { // ...this is what actually persists. if (err) { console.error('Error saving new node to database:', err); } else { console.log('Node saved to database with id:', node.id); } }); } }); }; And this is my app.js var express = require('express'); var recom = require('./server/routes/recom.js'); var app = express(); app.get('/', recom.scrape); app.listen(process.env.PORT || 2019); and I got the following error: Route.get() requires callback functions but got a [object Undefined] any help would be appreciated.
type: Question
has comment: http://stackoverflow.com/comment/44115852
tagged with: javascript
has answer: http://stackoverflow.com/a/27893078
score: 0
has comment: http://stackoverflow.com/comment/44149160
linked to: http://stackoverflow.com/q/18616074
answer count: 1
has title: NodeJS : app.get() does not operate as I exected
has comment: http://stackoverflow.com/comment/44186949
accepted answer: http://stackoverflow.com/a/27893078
has comment: http://stackoverflow.com/comment/44186956

http://stackoverflow.com/comment/44176893
score: 0
has text: At first sight, it looked like he was using the jQuery syntax which was giving errors.
type: Comment
comment on: http://stackoverflow.com/a/27887962
type: AnswerComment

http://stackoverflow.com/q/27867286
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/27867303
has title: AJAX getElementsByClassName
tagged with: xmlhttprequest
type: AnsweredQuestion
type: Question
tagged with: javascript
has body: I'm new to AJAX and have some problems understanding it. I have this code: var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { var titles = xmlhttp.responseText.getElementsByClassName('title'); document.getElementById("mydiv").innerHTML=titles; } } xmlhttp.open("GET", "index.html", true); xmlhttp.send(); This will produce the error: "Uncaught TypeError: undefined is not a function". I don't really understand why I can't get the classes, id's or anything from it. How can I do this?
has answer: http://stackoverflow.com/a/27867303

http://stackoverflow.com/comment/44257620
comment on: http://stackoverflow.com/q/27930004
has text: I see now. typeof 'foo' returns 'string'. I guess I was confused because the return value of typeof is quoted.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27807865
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44025934
has comment: http://stackoverflow.com/comment/44025158
has comment: http://stackoverflow.com/comment/45904755
type: Answer
answers question: http://stackoverflow.com/q/27807094
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27807094
has comment: http://stackoverflow.com/comment/44025556
has body: I've made a few comments already, but I think it's also worthwhile to write an answer. There are 3 big things I see after my first quick read of your code. I haven't tried to actually run or debug your code beyond a superficial reading. First, you should set the remoteVideo.src URL parameter in the same way as you do the local video stream: pc.onaddstream = function(media) { // This function runs when the remote stream is added. console.log(media); remoteVideo.src = window.URL.createObjectURL(media.stream); } Second, you should pass a constraints object to the createOffer() and createAnswer() methods of RTCPeerConnection. The constraints should/could look like this: var constraints = { mandatory: { OfferToReceiveAudio: true, OfferToReceiveVideo: true } }; And you pass this after the success and error callback arguments: pc.createOffer(..., ..., constraints); and: pc.createAnswer(..., ..., constraints); Lastly, you are not exchanging ICE candidates between your peers. ICE candidates can be part of the offer/answer SDP, but not always. To ensure that you send all of them, you should implement an onicecandidate handler on the RTCPeerConnection: pc.onicecandidate = function (event) { if (event.candidate) { socket.emit("ice candidate", event.candidate); } } You will have to implement "ice candidate" message relaying between clients in your server.js Hope this helps, and good luck!
upvote count: 2

http://stackoverflow.com/a/27848369
type: Answer
answers question: http://stackoverflow.com/q/27848259
has body: The Twitter button fires an event (documentation) you can bind to: twttr.events.bind( 'follow', function (event) { // hide the button here } );
score: 0

http://stackoverflow.com/comment/44272361
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27937898
has text: If you use `console.log(user_email[index])` you'll see the entire object listed in the console window. Does the `email` property exist as you expect?
score: 0

http://stackoverflow.com/comment/44026849
has text: i fixed it in my answer
type: AnswerComment
comment on: http://stackoverflow.com/a/27808807
type: Comment
score: 0

http://stackoverflow.com/comment/44131413
type: Comment
has text: @Hacketo I just prefer by default strict comparison. as long as the values are all strings and you pass a string as parameter then `===` is fine
score: 1
comment on: http://stackoverflow.com/a/27864431
type: AnswerComment

http://stackoverflow.com/q/27953824
tagged with: alignment
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27953948
has body: Under the Products tab I select the first option, however when I try to line up the data in vertical columns (9 check boxes in each column) it generates a space instead of align the group a and group b columns. I believe the syntax is class="ui-grid-a or class="ui-grid-b, which I used. I see other examples on various sites but that code does not seem to work with my script. How can I get these to align correctly? Thanks. FirePlace and BBQ Center Contact Information First Name * Last Name * Email Address * Telephone Number Comments * Products Please Select Fire Place Mendota DXV 35 DeepTimber Fire III Direct Vent Gas Fireplace Mendota DXV 45 DeepTimber Fire III Direct Vent Gas Fireplace Mendota DXV 35 Time Fire Direct Vent Gas Fire Place Mendota DXV 42 Direct Vent Gas Fireplace Millennia Black Millennia Classic Brass Millennia Full Brass Wellington Andover Doors & Faceplate Prairie Doors & Faceplate Deerfield (outside fit only) Victoria Black Victoria Gold Tuscany Black Tuscany Gold Bentley Black Arch Screen Doors Bentley Vintage Iron Arch Screen Doors Bentley Gold Arch Screen Doors Bentley Antique Copper Arch Screen Doors Bentley Gun Metal Arch Screen Doors Bentley Swedish Nickel Arch Screen Doors Andover/Prairie Doors & Faceplate Overlay (See Pricing Sheet) Millennia Black test Millennia Classic Brass test Millennia Full Brass test am div3 Installation I'm the expanded content. Other Tab to Be Determined Test data Here is a link http://jsfiddle.net/w22L5nyo/
tagged with: jquery
has comment: http://stackoverflow.com/comment/44302834
has comment: http://stackoverflow.com/comment/44302974
has comment: http://stackoverflow.com/comment/44302899
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Jquery div class not lining up
possible better answer: http://stackoverflow.com/a/27953948
type: Question
has answer: http://stackoverflow.com/a/27966239
accepted answer: http://stackoverflow.com/a/27966239
tagged with: jquery-mobile
has answer: http://stackoverflow.com/a/27955913
tagged with: javascript

http://stackoverflow.com/comment/44174838
has text: @Quentin block.html(' ' + 'Date: ' + datevalues); in this line datevalues is already a string..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27886889
score: 0

http://stackoverflow.com/comment/44286733
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27945553
has text: @ToastyMallows - Is an other way, but (I think) it's a `log` for the developer not an `alert` for user .
type: Comment

http://stackoverflow.com/a/27918273
has body: Try this way: DEMO $(document).ready(function () { $('#mylist li').click(function (e) { var index = +($(this).index())+1; $('#tab-content ul').hide(); $('#tab-'+index+'-list').show(); }); });
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/27918071
upvote count: 1

angularjs
tags question: http://stackoverflow.com/q/27947225
tags question: http://stackoverflow.com/q/27949549
tags question: http://stackoverflow.com/q/27858910
tags question: http://stackoverflow.com/q/27932756
tags question: http://stackoverflow.com/q/27819771
tags question: http://stackoverflow.com/q/27958163
tags question: http://stackoverflow.com/q/27914436
tags question: http://stackoverflow.com/q/27855223
tags question: http://stackoverflow.com/q/27863028
tags question: http://stackoverflow.com/q/27875999
tags question: http://stackoverflow.com/q/27916617
tags question: http://stackoverflow.com/q/27929224
tags question: http://stackoverflow.com/q/27907234
tags question: http://stackoverflow.com/q/27915421
tags question: http://stackoverflow.com/q/27815592
tags question: http://stackoverflow.com/q/27860143
tags question: http://stackoverflow.com/q/27865005
tags question: http://stackoverflow.com/q/27832486
tags question: http://stackoverflow.com/q/27896074
tags question: http://stackoverflow.com/q/27902355
tags question: http://stackoverflow.com/q/27853595
tags question: http://stackoverflow.com/q/27940604
tags question: http://stackoverflow.com/q/27812397
tags question: http://stackoverflow.com/q/27825603
tags question: http://stackoverflow.com/q/27925838
tags question: http://stackoverflow.com/q/27915355
tags question: http://stackoverflow.com/q/27954616
tags question: http://stackoverflow.com/q/27805407
tags question: http://stackoverflow.com/q/27837270
tags question: http://stackoverflow.com/q/27924033
tags question: http://stackoverflow.com/q/27859642
tags question: http://stackoverflow.com/q/27814405
tags question: http://stackoverflow.com/q/27843761
tags question: http://stackoverflow.com/q/27930543
tags question: http://stackoverflow.com/q/27932535
tags question: http://stackoverflow.com/q/27807022
tags question: http://stackoverflow.com/q/27915321
tags question: http://stackoverflow.com/q/27958359
tags question: http://stackoverflow.com/q/27929195
tags question: http://stackoverflow.com/q/27956284
tags question: http://stackoverflow.com/q/27831418
tags question: http://stackoverflow.com/q/27944440
tags question: http://stackoverflow.com/q/27814621
tags question: http://stackoverflow.com/q/27852258
tags question: http://stackoverflow.com/q/27894725
tags question: http://stackoverflow.com/q/27832022
tags question: http://stackoverflow.com/q/27862197
tags question: http://stackoverflow.com/q/27938635
tags question: http://stackoverflow.com/q/27830310
tags question: http://stackoverflow.com/q/27939447
tags question: http://stackoverflow.com/q/27857564
tags question: http://stackoverflow.com/q/27959156
tags question: http://stackoverflow.com/q/27807668
tags question: http://stackoverflow.com/q/27952180
tags question: http://stackoverflow.com/q/27946788
tags question: http://stackoverflow.com/q/27911727
tags question: http://stackoverflow.com/q/27939992
tags question: http://stackoverflow.com/q/27932837
tags question: http://stackoverflow.com/q/27936851
tags question: http://stackoverflow.com/q/27893699
tags question: http://stackoverflow.com/q/27940472
tags question: http://stackoverflow.com/q/27928230
tags question: http://stackoverflow.com/q/27876560
tags question: http://stackoverflow.com/q/27895409
tags question: http://stackoverflow.com/q/27869320
tags question: http://stackoverflow.com/q/27879327
tags question: http://stackoverflow.com/q/27912133
tags question: http://stackoverflow.com/q/27897963
tags question: http://stackoverflow.com/q/27813098
tags question: http://stackoverflow.com/q/27874750
tags question: http://stackoverflow.com/q/27901504
tags question: http://stackoverflow.com/q/27937006
tags question: http://stackoverflow.com/q/27962381
tags question: http://stackoverflow.com/q/27885542
tags question: http://stackoverflow.com/q/27941876
tags question: http://stackoverflow.com/q/27954809
tags question: http://stackoverflow.com/q/27944960
tags question: http://stackoverflow.com/q/27911303
tags question: http://stackoverflow.com/q/27855665
tags question: http://stackoverflow.com/q/27928645

http://stackoverflow.com/comment/44337357
comment on: http://stackoverflow.com/a/27948674
score: 0
type: AnswerComment
has text: Not in the context of this app. A getter function is fine as long as it is returning the same content each time it is called. What is NOT okay is if your getter is returning new objects each time it is called.
type: Comment

http://stackoverflow.com/a/28021437
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27922810
type: Answer
has body: It seems like the portal server WAS responsible, after all. After porting the project from WebSphere Portal 8.0 to 8.5, everything seems to work.
accepted answer of: http://stackoverflow.com/q/27922810
score: 1

http://stackoverflow.com/a/27907187
type: Answer
has comment: http://stackoverflow.com/comment/44214609
has comment: http://stackoverflow.com/comment/44214190
has comment: http://stackoverflow.com/comment/44213852
upvote count: 1
has comment: http://stackoverflow.com/comment/44214884
has comment: http://stackoverflow.com/comment/44214314
has body: Instead of placing JavaScript style line breaks put html style line breaks or actual line breaks (they are legal) alert(document.querySelector('input').value); &lt;input type="hidden" value="value 01: 789456123 &amp;#x0a; value 02: 547812321 &amp;#x0a; value 03: 789456423 &amp;#x0a; "&gt; alert(document.querySelector('input').value); &lt;input type="hidden" value="value 01: 789456123 value 02: 547812321 value 03: 789456423"&gt;
answers question: http://stackoverflow.com/q/27907015
has comment: http://stackoverflow.com/comment/44213982
has comment: http://stackoverflow.com/comment/44214743
has comment: http://stackoverflow.com/comment/44213875
has comment: http://stackoverflow.com/comment/44213922
downvote count: 0
score: 1

http://stackoverflow.com/a/27804663
has comment: http://stackoverflow.com/comment/44019434
answers question: http://stackoverflow.com/q/27804558
type: Answer
has comment: http://stackoverflow.com/comment/44019969
has body: Don't bother with this complicated "add 30 minutes" logic when you can simply use Date which is already good at date/time math. var d = new Date(); // ... var thirtyMinutes = 30*60*1000; var futureDate = new Date(d.getTime() + thirtyMinutes); var ntime = futureDate.getHours() + ':' + futureDate.getMinutes();
score: 0

http://stackoverflow.com/a/27853065
type: Answer
has body: Here's the code that works. HTML: &lt;div class="progress"&gt; &lt;div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow=" &lt;%= @hours_total_percentage %&gt;" aria-valuemin="0" aria-valuemax="100" style="width: &lt;%= @hours_total_percentage %&gt;%;"&gt;&lt;span style="text-align: center;"&gt; &lt;%= @hours_total_percentage %&gt;%&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; Javascript - code with default options from Minddust (as above): $(document).ready(function() { $(".progress .progress-bar-success").progressbar({ transition_delay: 0, refresh_speed: 0, display_text: 'center', use_percentage: true, percent_format: function(percent) { return percent + '%'; }, amount_format: function(amount_part, amount_total) { return amount_part + ' / ' + amount_total; }, update: $.noop, done: $.noop, fail: $.noop }); }); For the record, I'm not quite sure what wasn't working before. I had tried this approach and it didn't work. Maybe adding the default values to the javascript?
answers question: http://stackoverflow.com/q/27849237
score: 0

http://stackoverflow.com/a/27887631
upvote count: 3
has body: The code is not self-executing. It's just giving jQuery a function reference. It's jQuery that calls that function, later, when the DOM is ready (or right away if it already is). Details in the jQuery documentation. How does giving a $ variable enable self execution(jQuery lib not included)? If the function is being called, jQuery clearly is included (or something else that defines a function and attaches it to $ and calls the function you pass it). (is jQuery is playing a role here?) Yes. I know you've to use do to have self invoking functions in coffeescript If you mean immediately-invoked rather than self-invoked (a common misnomer), no, you don't: (() -&gt; alert 'Hello!' )() ...which translates to: (function() { return alert('Hello!'); })(); ...which defines a function and invokes it immediately. Or if you really meant self-invoking (e.g., recursive): (foo = (n) -&gt; alert 'Call ' + n if n &gt; 0 foo(n - 1); )(10) ...which translates to: var foo; (foo = function(n) { alert('Call ' + n); if (n &gt; 1) { return foo(n - 1); } })(10); ...which defines a function that calls itself 10 times.
accepted answer of: http://stackoverflow.com/q/27887565
has comment: http://stackoverflow.com/comment/44177390
answers question: http://stackoverflow.com/q/27887565
has comment: http://stackoverflow.com/comment/44176608
has comment: http://stackoverflow.com/comment/44176645
type: Answer
has comment: http://stackoverflow.com/comment/44177209
score: 3
has comment: http://stackoverflow.com/comment/44176826
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44115560
comment on: http://stackoverflow.com/a/27856106
has text: I fixed it, location is a member of the `window` variable.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44240815
type: QuestionComment
has text: Post related code please.
score: 5
comment on: http://stackoverflow.com/q/27921938
type: Comment

http://stackoverflow.com/comment/44179234
type: Comment
comment on: http://stackoverflow.com/q/27888998
type: QuestionComment
score: 1
has text: $.when isn't even doing anything. Nothing in your code returns promises. Trying to call mousover in a recursive function seems very unorthodox also

http://stackoverflow.com/q/27812545
score: 0
has title: calling php variable in Javascript chart
answer count: 1
tagged with: bar-chart
has comment: http://stackoverflow.com/comment/44032965
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/44036748
type: Question
has answer: http://stackoverflow.com/a/67266253
has comment: http://stackoverflow.com/comment/44032564
tagged with: javascript
has body: Hi I am trying to show value from database in a javascript chart. I tried ecoing the whole script, but it doesnt work. Here is my code. Any clue on how to do that? &lt;body&gt; &lt;div style="width: 50%"&gt; &lt;canvas id="canvas" height="450" width="600"&gt;&lt;/canvas&gt; &lt;/div&gt; &lt;script&gt; var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var barChartData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { fillColor : "rgba(220,220,220,0.5)", strokeColor : "rgba(220,220,220,0.8)", highlightFill: "rgba(220,220,220,0.75)", highlightStroke: "rgba(220,220,220,1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] }, { fillColor : "rgba(151,187,205,0.5)", strokeColor : "rgba(151,187,205,0.8)", highlightFill : "rgba(151,187,205,0.75)", highlightStroke : "rgba(151,187,205,1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] } ] } window.onload = function(){ var ctx = document.getElementById("canvas").getContext("2d"); window.myBar = new Chart(ctx).Bar(barChartData, { responsive : true }); } &lt;/script&gt; &lt;/body&gt; I want to control these values: labels : ["January","February","March","April","May","June","July"], data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]

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

http://stackoverflow.com/comment/44030350
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27810329
has text: thanks for the feedback @StefanoDalpiaz -- I still need to get a grasp of CSS to take advantage of what you suggested but your other suggestion of assign the inputs a class makes sense. thanks again

http://stackoverflow.com/a/27805842
score: 2
has body: Update: Add a global variable OUTSIDE of any function: var arrayBlob = Utilities.newBlob("dummy data"); function showList(folderID) { Code here .... }; Check that the code has access to the blob: function submit(e){ Logger.log("arrayBlob.getDataAsString(): " + arrayBlob.getDataAsString()); //More Code . . . } This solution eliminates the need of embedding a hidden element in the dialog box with a value of the blob. You won't need this line: panel.add(app.createHidden('arrayBlob', arrayBlob)); There are other changes I'd make to the code, but I simply want to show the main issue. Old Info: In the function showList(), the method getDataAsString() works on the blob named arrayBlob. Logger.log("arrayBlob #1 = " + arrayBlob.getDataAsString()); // Here it`s OK In the function, submit(), the same method does not work. var arrayBlob = e.parameter.arrayBlob; In the function showList(), the code is assigning a newBlob to the variable arrayBlob. So arrayBlob is available to have the getDataAsString() method used on it. var arrayBlob = Utilities.newBlob(arrayList); In the function, submit(), you are trying to pass the arrayBlob blob variable into the submit() function, and reference it with e.parameter. If you put a Logger.log() statement in the submit() function. function submit(e){ Logger.log('e: ' + e); Logger.log('e.parameter` + e.parameter); var arrayBlob = e.parameter.arrayBlob; Those Logger.log statements should show something in them. If there is nothing in e.parameter, then there is nothing for the .getDataAsString() to work on. It looks like you are putting the arrayBlob into a hidden panel. panel.add(app.createHidden('arrayBlob', arrayBlob)); But when the object is getting passed to the submit(e) function, the arrayBlob might not be getting put into that object. So, what I'm saying is, the: Logger.log("arrayBlob #2 = " + arrayBlob.getDataAsString()); Line may be perfectly good, but there is no arrayBlob there to work on. This hasn't fixed your problem, but do you thi…
downvote count: 0
has comment: http://stackoverflow.com/comment/44055890
has comment: http://stackoverflow.com/comment/44054457
upvote count: 2
has comment: http://stackoverflow.com/comment/44389776
has comment: http://stackoverflow.com/comment/44059722
has comment: http://stackoverflow.com/comment/44054747
has comment: http://stackoverflow.com/comment/44054588
has comment: http://stackoverflow.com/comment/44388537
type: Answer
answers question: http://stackoverflow.com/q/27805250

http://stackoverflow.com/comment/44253406
comment on: http://stackoverflow.com/a/27870477
type: AnswerComment
has text: @laur look at the source code of the webpage (you can do it using chrome for instance). Search for <a href="#" . You'll see that you have 6. All of them with the text "Go to ...". However, in your page you don't show those links. Try to get rid of them (if you don't use them) and hopefully it'll work. Good luck!
type: Comment
score: 0

http://stackoverflow.com/comment/44221754
type: Comment
has text: ID is not generated, it is known in forehand (id from a sql table) and can be a large number, like 342881
type: AnswerComment
comment on: http://stackoverflow.com/a/27911094
score: 0

http://stackoverflow.com/a/28079630
score: 0
has body: One problem: when you try to destroy the alien, the alien variable isn't actually in scope. (You've declared it in a different function.) So there's no way alien.destroy(); will work. Second problem: the function you pass to .onHit("alien", callback) will only be run when the laser hits an entity with the "alien" component. It has no idea what variable name you assigned the entity. However, the callback function will be passed information about what entities it's colliding with, and you can use that to resolve the collision.
type: Answer
answers question: http://stackoverflow.com/q/27869864

http://stackoverflow.com/comment/44032621
has text: Two possible answers. 1) Explanation of syntax: Because that's what `[]` means. 2) Explanation of intent: Because all keys start not-pressed, and `undefined` that you get through `keys[keyCode]` on an unitialised keycode is just as falsy as `false`.
comment on: http://stackoverflow.com/a/27812387
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27923635
has body: I am using bootstrap3 on a site that allows users to upload images of their own. These images are later displayed in a given page. Problem is, some users upload photos that are either bigger or smaller in respect to the div that'll hold them. I wish to resize all these images using CSS (or even JavaScript if need be) in order for them to fit in the div whilst maintaining their aspect ratio. At the same time, I want them to be responsive.
has answer: http://stackoverflow.com/a/47266804
answer count: 2
has comment: http://stackoverflow.com/comment/44250520
downvote count: 0
has comment: http://stackoverflow.com/comment/44244862
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27923809
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44244221
score: 1
has comment: http://stackoverflow.com/comment/44279588
upvote count: 1
has title: CSS resize images to fit in div and be reponsive
type: Question
has comment: http://stackoverflow.com/comment/44244355
tagged with: javascript
has comment: http://stackoverflow.com/comment/44244166
tagged with: jquery
has comment: http://stackoverflow.com/comment/44244178

http://stackoverflow.com/a/27914578
answers question: http://stackoverflow.com/q/27862620
has comment: http://stackoverflow.com/comment/44283415
has comment: http://stackoverflow.com/comment/44236818
has comment: http://stackoverflow.com/comment/44247863
has comment: http://stackoverflow.com/comment/44243686
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44244218
has body: I've done this in the particle vertex shader for my Cubes, probably in an unnecessarily verbose way. // Compute pixel scale for points vec4 testPosition = eyePosition; testPosition.x = uPixelsPerClipUnit.x / uTileSize * 1.2/*appearance fudge factor*/; testPosition.y = 0.0; testPosition = uPMatrix * testPosition; gl_PointSize = testPosition.x / testPosition.w * animationScale; These are the variables you need to provide (the ones which start with u I had as uniforms): eyePosition is the location of the point in eye space (i.e. just before the projection matrix is applied, and after the model/view matrix/matrices are applied). The only part of it we actually care about is the z axis. uPixelsPerClipUnit is a vec2 which is set up to be half the viewport pixel dimensions — it's just a conversion factor from &minus;1-to-1 clip space scale to pixels. uTileSize and animationScale are just parameters specific to my game about how big the points should be. They don't need to be in two different places. uPMatrix is the projection matrix. What we're actually doing here is getting the product of the eye-space-to-clip-space scale set by the projection matrix, at the z-depth of the point, and the clip-space-to-pixels scale and using that to set the point size. (I'd like to provide a self-contained working example, but I don't think I'll get around to it, so you get the snippet and half-baked explanation.)
accepted answer of: http://stackoverflow.com/q/27862620
has comment: http://stackoverflow.com/comment/44235172
type: Answer

http://stackoverflow.com/q/27963018
has comment: http://stackoverflow.com/comment/44320045
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44320028
answer count: 0
has comment: http://stackoverflow.com/comment/44319241
tagged with: jquery-chosen
type: Question
has body: I got a chosen selectbox in a frame, and another frame almost exactly below it. Now my selectbox is cut, but I have to make it work! I guess it's something in the chosen js, because a normal selectbox can overlap between different frames. Example: Please help me, I'm struggling with this for a long time and I really need to solve it. I wish I could cut out all of the frames, but I'm afraid that isn't possible.
tagged with: javascript
tagged with: jquery
tagged with: frames
score: 0
has comment: http://stackoverflow.com/comment/44320773
linked to: http://stackoverflow.com/q/24880385
has comment: http://stackoverflow.com/comment/44319253
has title: Chosen plugin cuts between different frames. (Js jquery)

http://stackoverflow.com/comment/44266744
has text: glad OP found useful. As a note, `$(element).each()` is designed for DOM manipulation, whereas `$.each()` is a "generic iterator function, which can be used to seamlessly iterate over both objects and arrays." http://api.jquery.com/jquery.each/
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27932620
type: AnswerComment

http://stackoverflow.com/q/27903491
downvote count: 0
type: Question
tagged with: jquery-ui
score: 1
has title: How to make a left and right panel, and be able to slide a divider between them?
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27903666
accepted answer: http://stackoverflow.com/a/27903666
favorite count: 0
tagged with: css
has body: I have a page that has a left div and a right div. The divs are organized using display:table and associated tags. The right div is resizable using jquery-ui's resizable facility. I would like to be able to drag the divider to the left and right, and change the relative size of the panes. But it's not quite right. For one thing, the right pane can only be resized by its right edge and by the bottom right corner, not by the left edge. How does one really make a splitter in this js/html/css world? http://jsfiddle.net/rhedin/xhaxme4c/
tagged with: splitter
type: AnsweredQuestion

http://stackoverflow.com/comment/44076288
score: 2
comment on: http://stackoverflow.com/q/27835851
type: QuestionComment
type: Comment
has text: works fine here http://jsfiddle.net/xu3gLw2g/

http://stackoverflow.com/q/27941191
has body: I'm trying to display an image, but revert to a default image if it doesn't exist. But the image can have any image extension. So how can I add a wildcard to the $.get() function below to make it look for any file with the right filename? $.get('path/to/file.*') .done(function() { }).fail(function() { });
possible better answer: http://stackoverflow.com/a/27941812
has answer: http://stackoverflow.com/a/27941812
has title: Find out if image exists at url with wildcard
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44278387
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44278389
type: Question
has answer: http://stackoverflow.com/a/27941265
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27941265
answer count: 2
has comment: http://stackoverflow.com/comment/44278418
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/27914148
has body: I have a list of users in the Parse database. Each user has his/her own rating, but that rating is in a different class since you can't write to the user class unless you are that user whose data is being modified. (The rated user's rating should change each time the reviewer submits the review.) var current = Parse.User.current(); var relation = current.relation("FriendRelations"); relation.query().find({ success: function (results) { for (var i = 0; i < results.length; i++) { $('ul').prepend(' ' + results[i].getUsername() + ' '); * * //Get friend's rating. var Rating = Parse.Object.extend("Rating"); var query = new Parse.Query(Rating); query.equalTo("user", results[i].getUsername()); query.find({ success: function (results) { for (var y = 0; y < results.length; y++) { var object = results[y].get("Rating"); $("#frienditems").append(' ' + object + ' '); } }, error: function (error) {} }); * * $('#frienditems').prepend(' '); $('#friendname').on('click', function () { var username = $(this).text(); var replaced = username.split(' ').join('+'); window.location = "profile.html?firstname=" + replaced; }); } } }); ** This part is the most important. Ideally, I would like to be able to do this: var relation = current.relation("FriendRelations"); relation.query().find({ success: function (results) { for (var i = 0; i < results.length; i++) { $('ul').prepend(' ' + results[i].getUsername() + results[i].get("Rating") + ' '); This way, it would be clear that the current list item gets the rating attached to it. But since I can't use the User class to update the rating, it's out of the question. The problem is essentially that I have two different classes, one with the User and the other with the username and his/her rating. If I append the rating to the list item, Javascript isn't going to know which list item gets what, so it's just all going to be appended to the first one. Putting a query in a query hasn't helped because of variable scope problems. What's the best way to sol…
has answer: http://stackoverflow.com/a/27915357
tagged with: javascript
has title: How do I assign each its respective data?
has comment: http://stackoverflow.com/comment/44227544
has comment: http://stackoverflow.com/comment/44228474
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44227709
tagged with: parse-platform
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/27841362
has comment: http://stackoverflow.com/comment/44086474
downvote count: 3
type: Question
has body: In Javascript, why is var myArray = new Array(3); different from: var otherArray = [null, null, null]; ? Obs: (myArray == otherArray) returns false. And also, how can I get a variable like otherArray, which is an array full of 'nulls`, but with whatever size i'd like? Obs [undefined, undefined, undefined] is also not equal to myArray.
has comment: http://stackoverflow.com/comment/44086558
upvote count: 48
has answer: http://stackoverflow.com/a/67589840
has answer: http://stackoverflow.com/a/41070699
has answer: http://stackoverflow.com/a/27841403
tagged with: arrays
has answer: http://stackoverflow.com/a/76749590
has comment: http://stackoverflow.com/comment/44086443
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/44086610
has comment: http://stackoverflow.com/comment/107193642
score: 45
has answer: http://stackoverflow.com/a/27841598
favorite count: 0
has comment: http://stackoverflow.com/comment/44086653
has title: Javascript - Initialize array with nulls
possible better answer: http://stackoverflow.com/a/27841403
has comment: http://stackoverflow.com/comment/44086692
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44086735
has answer: http://stackoverflow.com/a/67343899
accepted answer: http://stackoverflow.com/a/41070699
has comment: http://stackoverflow.com/comment/44086327
has comment: http://stackoverflow.com/comment/44086394
linked to: http://stackoverflow.com/q/24038939

http://stackoverflow.com/comment/44189573
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27883392
has text: @torazaburo wow, why didn't I think of that? thanks!

http://stackoverflow.com/comment/119352885
comment on: http://stackoverflow.com/a/28060922
has text: This library seems to be deprecated now. What do you suggest to use in chrome-extensions now? The HTTP API: https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/27805598
has comment: http://stackoverflow.com/comment/44020745
tagged with: algorithm
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44022612
has comment: http://stackoverflow.com/comment/44021604
accepted answer: http://stackoverflow.com/a/27806973
possible better answer: http://stackoverflow.com/a/27806228
has answer: http://stackoverflow.com/a/27806228
has comment: http://stackoverflow.com/comment/44020590
has title: Is there a pattern for a "matrix style" comparison?
has comment: http://stackoverflow.com/comment/44021194
has answer: http://stackoverflow.com/a/27806973
has body: Is there a canonical algorithm or pattern for the following style of decision: You have n resources (let's say two for now, resource 1 and resource 2). Consider the pseudo code: Request for X units, requiring resources 1 and 2 { If (enough of resource 1) if (enough of resource 2) fulfill request for X units. else (not enough of resource 2) partially fulfill, to max of resource 2 else (not enough of resource 1) if (there is enough of resource 2) partially fulfill, to max of resource 1. else (not enough of resource 2) partially fulfill, to max of resource 2 } Things get out of hand very quickly with n > 2, and there is a lot of duplicated code. Is there a more efficient way to implement this algorithm? I'm programming in Javascript for this problem, if that matters.
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/44075834
type: Comment
has text: Consider to use Google App Engine instead of Google Sites https://cloud.google.com/appengine/docs/whatisgoogleappengine?csw=1
comment on: http://stackoverflow.com/a/27835449
type: AnswerComment
score: 0

http://stackoverflow.com/q/27918591
type: Question
tagged with: average
has answer: http://stackoverflow.com/a/27919548
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27919548
linked to: http://stackoverflow.com/q/15776940
answer count: 1
has body: I have seen this - Horizontal line to show average in dygraph - and it doesn't quite answer my question. I have the following simple dygraph: g2 = new Dygraph( document.getElementById("graphdiv2"), "../newDataFile.csv", { ... } ); where newDataFile.csv has two columns. What I would like to show is the average of the points plotted (as a line or just a number), and for this average to change as I zoom in to different parts of the graph. Any ideas?
type: AnsweredQuestion
tagged with: dygraphs
has title: Show average of dygraph points, which dynamically amends as the user zooms

http://stackoverflow.com/q/27940443
tagged with: jquery
has body: This is my java script &lt;script&gt; $(document).ready(function () { $('#btnSubmit').on('click', function (e) { var cnt = $("input[name='technologies']:checked").length; var cnt1 = $("input[name='technologies']:checked").val(); alert(cnt1); if (cnt &lt; 3) { for (i = 0; i &lt; $("input[name='technologies']:checked").length; i++) { var cnt2 = cnt1.val(i); alert(cnt2) } alert(cnt); e.preventDefault(); } else alert('Well Done!!!!'); }); }); &lt;/script&gt; My html code &lt;input type="checkbox" name="technologies" value="JavaScript" /&gt;JavaScript &lt;br /&gt; &lt;input type="checkbox" name="technologies" value="Prototype" /&gt; Prototype&lt;br /&gt; &lt;input type="checkbox" name="technologies" value="Dojo" /&gt; Dojo&lt;br /&gt; &lt;input type="checkbox" name="technologies" value="Mootools" /&gt; Mootools &lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; I need the values of checked in forloop statement. Unable to get the checked values, i am getting only one checked value
type: Question
has answer: http://stackoverflow.com/a/27940485
score: 0
answer count: 1
has title: how to get the value of checkboxselected in javascript
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/65818531
type: Answer
has body: If you're using the latest JavaScript SDK from Here Maps, you can set a position for your custom marker through the anchor property(by default the position is set to bottom-center). Let's suppose the size of your custom icon is markerWidth x markerHeight and you're looking to center it. Then you'll need to create the marker sending the H.map.Icon.Options property when you're creating the icon. See the following example: const centeredMarker = new H.map.Marker( { lat: latitude, lng: longitude, }, { icon: new H.map.Icon(imageElement, { anchor: new H.math.Point(markerWidth / 2, markerHeight / 2), crossOrigin: false, }), } );
answers question: http://stackoverflow.com/q/27817654
score: 0

http://stackoverflow.com/comment/44174118
comment on: http://stackoverflow.com/q/27886516
has text: Move the link inside the first li element?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27954327
has comment: http://stackoverflow.com/comment/44304201
has comment: http://stackoverflow.com/comment/44304100
score: 0
answers question: http://stackoverflow.com/q/27953587
has body: I was working with this as a string... idk what approach you're taking, but this should help. you aren't closing your title tag, is one thing. xml fix: News Title Goes Here js var xml = (new DOMParser()).parseFromString(xml, "text/xml").querySelectorAll('[url]'), mediaEls = ([].slice.call(xml)).filter(function(a) { return a.tagName == 'media:thumbnail'}), urls = mediaEls.map(function(a, i) { return a.getAttribute('url') }); console.log(urls); // ["http://news.bbcimg.co.uk/media/images/80270000/jpg/_80270552_mjadzelics_cleared_07.jpg"]
type: Answer

http://stackoverflow.com/a/27843341
score: 2
answers question: http://stackoverflow.com/q/27843286
upvote count: 2
has comment: http://stackoverflow.com/comment/44091284
downvote count: 0
type: Answer
has body: Well, you can always use Array.prototype.map(): var sources = arrayOfObjects.map(function(obj) { return obj.src; }); ... but for your specific case, I'd rather choose a bit different approach - checking against array directly with Array.prototype.some(): function doesSourceExist(source) { return arrayOfObjects.some(function(obj) { return obj.src === source; }); }

http://stackoverflow.com/q/27938447
tagged with: asp.net-mvc
has title: How to avoid inline javascript with generated content and CSS inline performance comparison
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27938613
downvote count: 0
answer count: 1
has body: So I read that inline javascript is bad (not cacheable), so I try to put all my script in separate file, but how do you avoid inline javascript if it is generated based on content, for example in ASP.NET-MVC. $('#id').showPopUp({ text: @Model.Message //Dynamic value from controller }) I also have question about inline CSS, I understand that it is best to use class if you need more than 1 style, but what if I only need one style, for example : .width100 {width: 100%;} //CSS stylesheet &lt;table class="width100"&gt;&lt;/table&gt; VS &lt;table style="width: 100%;"&gt;&lt;/table&gt; which one is better in performance? Sorry for bad english. Any help will be appreciated. UPDATE: And how do I avoid inline for dynamic generated js? For example : @{ if (flag = true) } &lt;script type="text/javascript"&gt; $('#id').getIn(); &lt;/script&gt; @{ else } &lt;script type="text/javascript"&gt; $('#id').getOut(); &lt;/script&gt;
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44273611
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/27953432
score: 1
accepted answer of: http://stackoverflow.com/q/27952889
upvote count: 1
answers question: http://stackoverflow.com/q/27952889
type: AcceptedAnswer
downvote count: 0
has body: You probably need to iterate over the array and delete each record individually: remove: function() { var allSelectedItems = this.get("model.transactions").filterBy("isChecked", true); this.get('model.transactions').removeObjects(allSelectedItems) allSelectedItems.forEach(function(item) { item.deleteRecord(); }); } Also, actions never return anything so no need for the return.
type: Answer

http://stackoverflow.com/q/27888704
has comment: http://stackoverflow.com/comment/44179138
tagged with: google-chrome-extension
answer count: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/20077487
has comment: http://stackoverflow.com/comment/44179718
linked to: http://stackoverflow.com/q/20077487
has comment: http://stackoverflow.com/comment/44179920
type: Question
has title: Chrome extension: sendResponse vs chrome.tabs.sendMessage
has comment: http://stackoverflow.com/comment/44179702
tagged with: javascript
has body: I'm a bit confused by the usage of sendResponse (as in chrome.runtime.onMessage.addListener) and chrome.tabs.sendMessage. What I'm trying to do is that I want to send a message from the content script to the background, and the background will respond with some appropriate message. The code that I have is as follows. In content script: var currentHost = window.location.host; chrome.runtime.sendMessage({ type: 'getUsageTime', host: currentHost }, function (res) { console.log(res); }); In background: function onMessage (message, sender, sendResponse) { if (message.type === 'getUsageTime') { console.log('Getting the usage time for ' + message.host); sendResponse({ usageTime: usageTime }); return true; } } chrome.runtime.onMessage.addListener(onMessage); What this does is that the content script will send a message to request the usage time of that particular host. According to my current understanding of what sendResponse does, the code above (in particular, the line console.log(res)) should be able to log the response message. However, this is not as expected and that line of code does nothing (and probably isn't even reached). Moreover, if I try to send a message in the background by chrome.tabs.sendMessage and supplying the appropriate tab id, that works (as expected) but it's too troublesome to fire another sendMessage in the background this way. What exactly is happening here? What are the differences between sendResponse and chrome.tabs.sendMessage? Why is my code not working? Any help very much appreciated.
score: 0

http://stackoverflow.com/comment/48979928
type: AnswerComment
comment on: http://stackoverflow.com/a/28182069
type: Comment
has text: Reminder to self: To fix this example `Simple javascript error. nsIInputStream.read() requires an array to read into, not an undefined variable. Try declaring with "var buffer[1024]". That read loop doesn't look right either, I think it will skip the last chunk of the file. The for loop condition might need to be "i > 0".` from: http://forums.mozillazine.org/viewtopic.php?p=14169473#p14169473
score: 0

http://stackoverflow.com/a/27812966
downvote count: 0
type: Answer
has body: You should be able to pass params to the calc() function using the following syntax: ScriptManager.RegisterClientScriptBlock(Page,typeof(Page),"func","Calc('" &amp; param1 &amp; "','" &amp; param2 &amp; "');",true)
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27812887
has comment: http://stackoverflow.com/comment/44033264

http://stackoverflow.com/comment/44057008
type: QuestionComment
comment on: http://stackoverflow.com/q/27825493
score: 1
has text: Try: `2*(x>3)+(x==3)`
type: Comment

http://stackoverflow.com/a/27865178
has comment: http://stackoverflow.com/comment/44135464
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27865035
has comment: http://stackoverflow.com/comment/44135585
has body: Every DOM element is represented as an object in JavaScript, whether it is in the document or not. The difference between a DOM element in the document and a DOM element not in the document is the effect that mutations to the DOM element have. If the DOM element is not in the document, it cannot impact the current view and thus the browser does not have to perform reflows if you mutate it. Reflows are expensive, so not having to do them is faster. A DOM element is in the document if there is a path from the element to the document root (document.documentElement).
upvote count: 2
has comment: http://stackoverflow.com/comment/44132998

http://stackoverflow.com/comment/44119210
score: 0
has text: Could you set up an example we could see? That way I could provide a working solution.
type: Comment
comment on: http://stackoverflow.com/a/27856106
type: AnswerComment

http://stackoverflow.com/a/27971771
has comment: http://stackoverflow.com/comment/119460590
has comment: http://stackoverflow.com/comment/63291315
score: 22
has comment: http://stackoverflow.com/comment/44344150
answers question: http://stackoverflow.com/q/27951843
type: Answer
has comment: http://stackoverflow.com/comment/119459588
has body: Using the idea of plain text eml files, I came up with this: http://jsfiddle.net/CalvT/un3hapej/ This is an edit of something I found - to create a .txt file then download it. As .eml files are practically .txt files, I figured this would work. And it does. I've left the textarea with the sample email in so you can easily test. When you click on create file, it then gives you a download link to download your .eml file. The only hurdle I can see is making the browser open the .eml file after it has been downloaded. EDIT: And thinking about it, as you have access to the client machines, you could set the browser to always open files of that type. For instance in Chrome, you can click on the arrow beside the download and select always open files of this type. Here's the code HTML: (function () { var textFile = null, makeTextFile = function (text) { var data = new Blob([text], {type: 'text/plain'}); if (textFile !== null) { window.URL.revokeObjectURL(textFile); } textFile = window.URL.createObjectURL(data); return textFile; }; var create = document.getElementById('create'), textbox = document.getElementById('textbox'); create.addEventListener('click', function () { var link = document.getElementById('downloadlink'); link.href = makeTextFile(textbox.value); link.style.display = 'block'; }, false); })(); To: User <user@domain.demo> Subject: Subject X-Unsent: 1 Content-Type: text/html Test message Create file Download
has comment: http://stackoverflow.com/comment/119429628
has comment: http://stackoverflow.com/comment/58218887
upvote count: 22
downvote count: 0

http://stackoverflow.com/comment/44026395
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27807599
has text: @Justin, the moment you call the `onSongEndWrapper` it wants to call the property `this.onSongEnd` of the `this` object (PlayList). But that property hasn't been defined at that moment. Functions are parsed first, but properties aren't. So you need to call `onSongEndWrapper` after the declaration of `onSongEnd`.

http://stackoverflow.com/q/27812638
has body: I have a select element with an ng-model and ng-options on it. ng-options makes the possible selections dynamic however I have noticed that when ng-options updates the options ng-model is not also getting updated. For example if the select element has the value of "foo" selected then the ng-options model is updated and "foo" is no longer an option the selector updates to blank but ng-model still shows "foo" as its value. I would expect that ng-model would update as well to equal null. The only thing I can think of is to add a watch on items but that seems kind of lame. What is the best way to get ng-model to stay in sync with the select element in this scenario? Selected Item: {{foo}} option Select Something Remove Second Item Option {{items}} Here is the jsfiddle to illustrate the issue. http://jsfiddle.net/dberringer/m2rm8Lh6/2/ Note: I'm aware I could manually update the foo value with the delete method. This method is just to illustrate the issue. Thanks for your feedback. Update: I fixed a typo where referred to ng-options as ng-select.
score: 2
has answer: http://stackoverflow.com/a/27812892
type: Question
upvote count: 2
answer count: 2
tagged with: ng-options
has answer: http://stackoverflow.com/a/27812781
downvote count: 0
has title: How can I keep ng-model in sync with a select element after ng-options removes the selected option
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44102711
tagged with: angularjs
type: UnansweredQuestion

browser
tags question: http://stackoverflow.com/q/27844230
tags question: http://stackoverflow.com/q/27907236
tags question: http://stackoverflow.com/q/27828804
tags question: http://stackoverflow.com/q/27914809
tags question: http://stackoverflow.com/q/27864233
tags question: http://stackoverflow.com/q/27880985
tags question: http://stackoverflow.com/q/27806402
tags question: http://stackoverflow.com/q/27843499
tags question: http://stackoverflow.com/q/27865608
tags question: http://stackoverflow.com/q/27960841
tag name: browser
tags question: http://stackoverflow.com/q/27957766
tags question: http://stackoverflow.com/q/27904757
type: Tag
tags question: http://stackoverflow.com/q/27913043

http://stackoverflow.com/a/27929300
has comment: http://stackoverflow.com/comment/44255722
score: 4
accepted answer of: http://stackoverflow.com/q/27929287
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27929287
type: Answer
has body: You simply have not defined select function anywhere in your source code (all your custom js-code is currently in your index.html, so it is easy to figure it out), but you are trying to use it as onSelect event handler.
has comment: http://stackoverflow.com/comment/44255766
upvote count: 4
has comment: http://stackoverflow.com/comment/44255769

http://stackoverflow.com/comment/52070313
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27894771
type: Comment
has text: @ImHappy does it helped?

http://stackoverflow.com/q/27846766
has comment: http://stackoverflow.com/comment/44098763
upvote count: 1
has answer: http://stackoverflow.com/a/27846848
type: Question
score: 1
has answer: http://stackoverflow.com/a/27846937
has title: add page section id to the address bar on scrolling the page
has answer: http://stackoverflow.com/a/27846871
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27846901
has body: I want to add page section ID to the end of the URL in address bar while scrolling: for example &lt;section id="home"&gt;&lt;/section&gt; &lt;section id="about"&gt;&lt;/section&gt; &lt;section id="works"&gt;&lt;/section&gt; http://example.com/about/ or http://example.com/works/ and of course when it's the home page remove the uri string. and On page load I want the page scroll to the section requested, and I do not want it to just jump to that section. Are there any jQuery written codes?! How can I do that?!
linked to: http://stackoverflow.com/q/6677035
answer count: 5
has comment: http://stackoverflow.com/comment/44097506
has answer: http://stackoverflow.com/a/41579270
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion

http://stackoverflow.com/q/27944396
tagged with: javascript
has title: How to get .json file in folder structure
answer count: 2
downvote count: 3
favorite count: 0
accepted answer: http://stackoverflow.com/a/27944523
score: -3
possible better answer: http://stackoverflow.com/a/27944687
has body: A pretty simple question here. My project is set up like this: dist - js - app.js - profile - profile.html - tab1.json The script below is looking for the .json file in the js folder but I need it to be kept in the profile folder and just want to amend the JavaScript below: var jsonFile='tab'+(tabIndex +1)+'.json' What is the correct way to do this?
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27944523
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/27944687

http://stackoverflow.com/q/27877888
has comment: http://stackoverflow.com/comment/44157473
type: AnsweredQuestion
has title: Can angular $timeout be used as a reliable dom ready?
accepted answer: http://stackoverflow.com/a/27878185
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/44157824
answer count: 1
downvote count: 0
tagged with: javascript
has body: Working with a library which need to be called after dom ready. And I just used the init function with $timeout from the controller's init. Can $timeout be used as a reliable dom ready event ? Thanks.
score: 4
has comment: http://stackoverflow.com/comment/44157652
favorite count: 0
has answer: http://stackoverflow.com/a/27878185
tagged with: angularjs

http://stackoverflow.com/comment/56358594
has text: Edit made, i removed the link then i copy/past my post. I do not have enough reputation at all to do that. It's really hard to get reputation
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/34154856
type: Comment

http://stackoverflow.com/a/29579184
answers question: http://stackoverflow.com/q/27930702
type: Answer
score: 4
upvote count: 4
has body: At controller which you want to return HomeCtrl: .controller('SavedCtrl', function($scope,...,$ionicHistory) { ... $ionicHistory.nextViewOptions({ disableBack: true }); $state.go('app.home'); }) .controller('HomeCtrl', function($scope,...,$ionicHistory) { $ionicHistory.clearHistory(); })
downvote count: 0

http://stackoverflow.com/comment/44198481
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27899189
type: Comment
has text: You may use Gson for parsing Json in Java: https://sites.google.com/site/gson/gson-user-guide

http://stackoverflow.com/comment/44170821
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27884231
type: AnswerComment
has text: sorry i dont understand again, what is the purpose or objective for the settimeout?

http://stackoverflow.com/q/27834801
has body: I don't know why my JQuery code doesn't work if I use it on my child page to transfer text of the rows selected from the table to the parent or opener page. Rows on the table is loaded using AJAX. If I try to create a table, set its rows and td on the HTML file itself, and use the the JQuery code, it works. How is that? Here are my codes of HTML, AJAX, Scripts HTML Products PHP echo ' Image Brand Model Price Terms Class '; try { $dbh = new PDO('mysql:host=localhost;dbname=mfcwebsitedb', 'root', 'pass@word1'); foreach($dbh->query('SELECT * from products') as $row) { echo ' '.' '.' '.$row['brand'].' '.$row['model'].' '.$row['price'].' '.$row['terms'].' '.$row['class'].' Select '; } $dbh = null; } catch (PDOException $e) { print "Error!: " . $e->getMessage() . " "; die(); $dbh = null; } JQUERY $(document).ready(function(){ $('#products-table .selectbtn').click(function() { var td = $(this).closest('tr'); var f; var s; var t; var q; var w; var g; $(td).each(function(){ f = $(this).find(".class").html(); s = $(this).find(".brand").html(); t = $(this).find(".model").html(); q = $(this).find(".price").html(); w = $(this).find(".terms").html(); g = $(this).find(".img").html(); }); var x = 'Class: ' + f + '\n' + 'Brand: ' + s + '\n' + 'Model: ' + t + '\n' + 'Price: ' + q + '\n' + 'Terms: ' + w; var z = g + ' ' + 'Class: ' + f + ' \n' + 'Brand: ' + s + ' \n' + 'Model: ' + t + ' \n' + 'Price: ' + q + ' \n' + 'Terms: ' + w; opener.document.motorappform.productdesc.value = x; opener.document.motorappform.productdeschidden.value = z; self.close(); }); });
accepted answer: http://stackoverflow.com/a/27834831
upvote count: 1
downvote count: 0
tagged with: javascript
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27834831
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Script doesn't work on child page
tagged with: php
answer count: 1

http://stackoverflow.com/q/27810521
has answer: http://stackoverflow.com/a/27810563
answer count: 1
has body: var imageCanvas = document.getElementById("imageCanvas"); var imageContext = imageCanvas.getContext("2d"); var board = new Image(); board.onload = function() { imageContext.drawImage(board, 0, 0, 400, 400); }; board.src = "image/board.png"; imageContext.clearRect(0, 0, imageCanvas.width, imageCanvas.height); So here is the code that I have. I loaded an image by its path and started testing how the canvas clears with the clearRect() function. The canvas does not clear with this command. But if I were to put a line of alert before the line where clearRect() is used, the canvas would be cleared successfully. var imageCanvas = document.getElementById("imageCanvas"); var imageContext = imageCanvas.getContext("2d"); var board = new Image(); board.onload = function() { imageContext.drawImage(board, 0, 0, 400, 400); }; board.src = "image/board.png"; alert(imageCanvas.width + " " + imageCanvas.height); imageContext.clearRect(0, 0, imageCanvas.width, imageCanvas.height); The second fragment of code works - it clears the canvas after I hit okay on the alert window. Does anyone understand why it behaves this way?
score: 0
accepted answer: http://stackoverflow.com/a/27810563
tagged with: canvas
type: AnsweredQuestion
tagged with: javascript
has title: JavaScript line not executing - clearing the Canvas
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44179653
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27888637
type: QuestionComment
has text: had you tried using jQuery.ajaxTransport( dataType, handler ) functionality? http://api.jquery.com/jQuery.ajaxTransport/

http://stackoverflow.com/q/27915523
tagged with: javascript
has title: RadioButtonList selected value in javascript
linked to: http://stackoverflow.com/q/579597
tagged with: radiobuttonlist
has answer: http://stackoverflow.com/a/27915585
has comment: http://stackoverflow.com/comment/54524180
has answer: http://stackoverflow.com/a/37270334
has body: I just want to ask how can I select the value of my radiobuttonlist here is my code. function CheckRadioButton(rdbRemarks){ document.getElementByID(rdbRemarks).SelectedValue = "1"; } Here is the code of my button onclick &lt;asp:Button ID="CheckRadioButton" CssClass="ButtonCalibri" Width="80px" runat="server" Text="Save" onclick="CheckRadioButton('&lt;%=rdbRemarks.ClientID%&gt;')" /&gt; Here is the code of my radiobuttonlist in case you need a reference &lt;asp:RadioButtonList ID="rdbRemarks" CssClass="LabelCalibri" runat="server" onselectedindexchanged="rdbRemarks_SelectedIndexChanged"&gt; &lt;asp:ListItem Value="1" Text="Charge to Utilization"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="2" Text="Charge to Operating Expense"&gt;&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; What I want is when I click the button, one of the radio button in the list will be selected, for example the selected value is "1" the first radio button will be selected. I currently have no idea how to do that now, Please help me on this one.
downvote count: 0
tagged with: asp.net
favorite count: 0
answer count: 5
type: UnansweredQuestion
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/34764672
type: Question
has answer: http://stackoverflow.com/a/27915764
has answer: http://stackoverflow.com/a/33504627

http://stackoverflow.com/a/27825024
score: -1
type: Answer
answers question: http://stackoverflow.com/q/27824768
has comment: http://stackoverflow.com/comment/44122755
has body: Try this: $($("td[class=ms-list-addnew*] a")[2]).prev().text("") $($("td[class=ms-list-addnew*] a")[2]).text("")
has comment: http://stackoverflow.com/comment/44123018
downvote count: 1
has comment: http://stackoverflow.com/comment/44055896
upvote count: 0

http://stackoverflow.com/comment/80811657
score: 14
comment on: http://stackoverflow.com/a/34749873
type: AnswerComment
has text: Why write this: `Object.assign(target, { [key]: {} })` if it could simply be `target[key] = {}`?
type: Comment

http://stackoverflow.com/q/27804154
has body: I'm building a web app using Backbone and Marionette with Ruby on Rails on the server. The app works great, except for the back button of back browser (FF, Chrome, IE11) that breaks everything. Here is a really simple example that reproduce the problem: var TestApp = new Marionette.Application(); TestApp.addRegions({ mainRegion: "#main-region" }); TestApp.navigate = function(route, options){ options || (options = {}); Backbone.history.navigate(route, options); }; TestApp.getCurrentRoute = function(){ return Backbone.history.fragment }; TestApp.on("start", function(){ if(Backbone.history){ Backbone.history.start(); if(this.getCurrentRoute() === ""){ this.navigate("foo"); TestApp.MyApp.Show.Controller.ShowFoo(); } } }); TestApp.module("MyApp", function(App, TestApp, Backbone, Marionette, $, _) { App.Router = Marionette.AppRouter.extend({ appRoutes: { "foo": "ShowFoo", "bar": "ShowBar", "baz": "ShowBaz" } }); var API = { ShowFoo: function(){ App.Show.Controller.ShowFoo(); }, ShowBar: function(){ App.Show.Controller.ShowBar(); }, ShowBaz: function(){ App.Show.Controller.ShowBaz(); } }; TestApp.addInitializer(function(){ new App.Router({ controller: API }); }); }); TestApp.module("MyApp.Show", function(Show, App, Backbone, Marionette, $, _) { Show.FooLayoutView = Backbone.Marionette.LayoutView.extend({ template: "#templates-foo", tagName: "span" }); Show.BarLayoutView = Backbone.Marionette.LayoutView.extend({ template: "#templates-bar", tagName: "span" }); Show.BazLayoutView = Backbone.Marionette.LayoutView.extend({ template: "#templates-baz", tagName: "span" }); var ContactsShowController = Marionette.Controller.extend({ ShowFoo: function() { this.fooView = new Show.FooLayoutView(); App.mainRegion.show(this.fooView); }, ShowBar: function() { this.barView = new Show.BarLayoutView(); App.mainRegion.show(this.barView); }, ShowBaz: function() { this.bazView = new Show.BazLayoutView(); App.mainRegion.show(this.bazView); } }); Show.Controller = new ContactsShowController; });…
tagged with: marionette
score: 1
tagged with: backbone.js
has title: Browser's back button break my Backbone / Marionette app
has answer: http://stackoverflow.com/a/27831759
upvote count: 1
answer count: 1
tagged with: backbone-routing
accepted answer: http://stackoverflow.com/a/27831759
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question

http://stackoverflow.com/q/27846116
accepted answer: http://stackoverflow.com/a/27846171
downvote count: 1
has title: AngularJS: How to update $scope after a promise response?
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44096152
tagged with: javascript
has body: Disclaimer: I'm a beginner with AngularJS. I'm trying to update $scope after a promise has returned, but it does not work. Here's the simplified code: .controller('ChooseRewardCtrl', ['$scope', ..., function($scope, ...) { // scope data $scope.points = CardModel.points; // function called to refresh points $scope.refresh_points = function() { return CardModel.refresh_points() // This is a promise that changes CardModel.points value .then(function(data){ $scope.$apply() // Throw error (cf. above) }) } } I get a Error: [$rootScope:inprog] $digest already in progress I saw lots of post about this error, but nothing that I can directly link to my problem. Thanks!
has comment: http://stackoverflow.com/comment/44096217
score: 0
favorite count: 0
tagged with: angularjs
tagged with: angular-promise
has answer: http://stackoverflow.com/a/27846279
upvote count: 1
has answer: http://stackoverflow.com/a/27846171
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27846279

http://stackoverflow.com/q/27943392
has answer: http://stackoverflow.com/a/27943885
has answer: http://stackoverflow.com/a/27943697
answer count: 3
has comment: http://stackoverflow.com/comment/44282473
has comment: http://stackoverflow.com/comment/44282205
favorite count: 0
has comment: http://stackoverflow.com/comment/44282279
has comment: http://stackoverflow.com/comment/44282616
type: UnansweredQuestion
downvote count: 2
linked to: http://stackoverflow.com/q/27481526
upvote count: 1
has body: I need to retrieve nth weekday of the current date in js. like 1st Sunday, 2nd Sunday var d=new Date(); var weekDay=d.getDay(); here weekDay gives me 4 that means its Wednesday(3rd Wednesday). So far its good. from weekDay i can say that its wednesday. how to calcuate the "3rd" index of this wednesday? Thank you
score: -1
has comment: http://stackoverflow.com/comment/44282918
has answer: http://stackoverflow.com/a/27943655
type: Question
has comment: http://stackoverflow.com/comment/44282614
has comment: http://stackoverflow.com/comment/44282508
has title: How to get nth Weekday of Current date in javascript
tagged with: javascript

http://stackoverflow.com/q/27959336
has body: I'm new to JS and I have a scenario like this. Clicking on the button will bring up a div content (written in jQuery). Now say I want to test the scenario, how should I do this? People prefer Jasmine. But I wonder, how that make sense, because if we test like this: Test: emulate click on button and check the div content is visible. If we follow this pattern aren't we testing the onClick of the jquery and not testing our behaviour? Am I missing something here?
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27959493
has title: How to test the onClick events
tagged with: jquery
tagged with: jasmine
favorite count: 0
upvote count: 3
type: UnansweredQuestion
score: 3
type: Question

http://stackoverflow.com/q/27835996
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/44076803
has answer: http://stackoverflow.com/a/27836038
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44078282
favorite count: 0
type: Question
has title: How do I get the ID using jquery
downvote count: 2
score: -2
has comment: http://stackoverflow.com/comment/44076575
has answer: http://stackoverflow.com/a/27836068
has answer: http://stackoverflow.com/a/27836097
has body: I want to be able to get the value of the id after clicking the button, so that i can use it to reference a particular table. &lt;input type="button" id="&lt;?php echo $id; ?&gt;" onclick="delBtn(&lt;?php echo $id; ?&gt;)"&gt; &lt;script&gt; function delBtn(btnX){ var itemId = btnX; alert(itemId); var x; var y =confirm('Are you sure you want to delete this item ?'); if(y == true){ x = 'You pressed Ok'; console.log(x); `$`("button[id='"+itemId+"']").closest("tr").effect("highlight", { color:'#4BADF5'}, 400); $("button[id='"+itemId+"']").closest("tr").fadeout();` } } &lt;/script&gt;
answer count: 7
has answer: http://stackoverflow.com/a/27836052
has answer: http://stackoverflow.com/a/27836072
has answer: http://stackoverflow.com/a/27836237
has answer: http://stackoverflow.com/a/27836015
upvote count: 0

http://stackoverflow.com/comment/44272480
type: AnswerComment
comment on: http://stackoverflow.com/a/27937793
score: 0
has text: i wanted the value of check box , `alert($(this).val());`
type: Comment

http://stackoverflow.com/comment/44343095
type: Comment
type: AnswerComment
has text: hi slime, i have used the following code to display the total: however it fails to display, tried this on both page2.php that the form posts to and also on the page hosting the above script and form, both fail to show the total.. am i doing something wrong?
comment on: http://stackoverflow.com/a/27971142
score: 0

http://stackoverflow.com/comment/44056211
has text: Thanks, I did a quick google after your explanation I found out you can affect the parent scope by including `$parent` , so the solution is `$parent.show_menu = !$parent.show_menu;`
score: 0
comment on: http://stackoverflow.com/a/27825067
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27880964
upvote count: 1
has answer: http://stackoverflow.com/a/27882000
type: Question
has body: I am making a page in which you select sandwich toppings with checkboxes, and after you click submit those sandwich option divs containing images will show. By default they are all hidden. I want the first div that is shows to be fixed while the rest of the toppings layer on top of the first one. I'll eventually set it up so that while you scroll down, the toppings appear to move up and over the previous topping. So, if you select bagel-bottom and bacon, you scroll down to see a bagel bottom and keep scrolling for the bacon to move up on top of the bagel bottom. The first topping div in the HTML order is bagel-bottom, but even though I select "bacon" the only div that shows is bagel-bottom. I have the jsfiddle here: http://jsfiddle.net/3kgnkh4w/ $(document).ready(function() { $('#sandwich-option-submit').click(function() { var checkedTopping = $('.sandwich-option').val(); var divCheckedTopping = $('#'+ checkedTopping); var optionsContainer = $('#sandwich-selection-container'); if($('.sandwich-option').is(':checked')) { $(divCheckedTopping).show().addClass('display'); $(divCheckedTopping).eq(0).addClass('first-checked-topping'); } else { $(divCheckedTopping).hide(); }; }); });
tagged with: javascript
tagged with: show-hide
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27882000
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44163628
tagged with: checkbox
tagged with: css
type: AnsweredQuestion
has title: Jquery, show and layer divs when their checkboxs are selected
score: 1

http://stackoverflow.com/comment/44209255
type: QuestionComment
comment on: http://stackoverflow.com/q/27904913
has text: Have you tried not passing the `next` parameter to your function?
score: 0
type: Comment

http://stackoverflow.com/comment/44278070
type: QuestionComment
has text: Where are the quotes in your attributes??
score: 0
comment on: http://stackoverflow.com/q/27941075
type: Comment

android
tags question: http://stackoverflow.com/q/27866004
tags question: http://stackoverflow.com/q/27951506
tags question: http://stackoverflow.com/q/27901767
tags question: http://stackoverflow.com/q/27882086
tags question: http://stackoverflow.com/q/27844979
tags question: http://stackoverflow.com/q/27957163
tags question: http://stackoverflow.com/q/27938209
tags question: http://stackoverflow.com/q/27947044
tags question: http://stackoverflow.com/q/27890818
tags question: http://stackoverflow.com/q/27876749
tags question: http://stackoverflow.com/q/27820855
tags question: http://stackoverflow.com/q/27943433
tags question: http://stackoverflow.com/q/27835448
tags question: http://stackoverflow.com/q/27831345
tags question: http://stackoverflow.com/q/27854377
tags question: http://stackoverflow.com/q/27804574
tags question: http://stackoverflow.com/q/27961662
tags question: http://stackoverflow.com/q/27838869
tags question: http://stackoverflow.com/q/27817873
tags question: http://stackoverflow.com/q/27892761
tags question: http://stackoverflow.com/q/27901757
tags question: http://stackoverflow.com/q/27848458
tags question: http://stackoverflow.com/q/27907024
tags question: http://stackoverflow.com/q/27893080
tags question: http://stackoverflow.com/q/27908670
tags question: http://stackoverflow.com/q/27922112
tags question: http://stackoverflow.com/q/27919698
tags question: http://stackoverflow.com/q/27845287
tags question: http://stackoverflow.com/q/27855806
tags question: http://stackoverflow.com/q/27957533
tags question: http://stackoverflow.com/q/27914668
tags question: http://stackoverflow.com/q/27873528
tags question: http://stackoverflow.com/q/27875190
tags question: http://stackoverflow.com/q/27933033
tag name: android
tags question: http://stackoverflow.com/q/27859870
tags question: http://stackoverflow.com/q/27955613
tags question: http://stackoverflow.com/q/27815166
type: Tag
tags question: http://stackoverflow.com/q/27809330
tags question: http://stackoverflow.com/q/27916253
tags question: http://stackoverflow.com/q/27844214

http://stackoverflow.com/comment/44319069
type: AnswerComment
comment on: http://stackoverflow.com/a/27962464
score: 0
type: Comment
has text: There's lots of other issues. I fixed the one you posted in the question. I'd suggest you read some tutorials before posting a question like this.

http://stackoverflow.com/q/27914840
has body: &lt;form id="search" onSubmit="go()"&gt; &lt;input autofocus autocomplete="off" type="text" class="searchbar" id="searchbar" placeholder="Search Keywords: search, navigate, weather" required&gt; &lt;input type="button" value="Go" class="go" id="go" onclick="go()"&gt; &lt;/form&gt; I have the function in an external javascript document that I have sourced at the bottom of my webpage, the function works when I click the submit button, just not when I hit enter. My go function: function go() { var input = document.getElementById('searchbar').value; var words = input.split(" "); var wordsLength = words.length; var searchWords = ''; if(words[0] == 'search' || words[0] == 'Search') { for(var x = 1; x &lt; wordsLength; x++) { searchWords += words[x]; if(x == wordsLength-1) { } else { searchWords += '+'; } } window.location.replace("http://www.google.com/#q=" + searchWords); } else if(words[0] == 'navigate' || words[0] == 'Navigate') { for(var x = 1; x &lt; wordsLength; x++) { searchWords += words[x]; if(x == wordsLength-1) { } else { searchWords += '+'; } } window.location.replace("http://www.google.com/maps/place/" + searchWords); } }
has answer: http://stackoverflow.com/a/27914877
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27914936
has comment: http://stackoverflow.com/comment/44228913
has comment: http://stackoverflow.com/comment/44228793
has comment: http://stackoverflow.com/comment/44229362
answer count: 5
type: UnansweredQuestion
tagged with: input
has answer: http://stackoverflow.com/a/27914937
has answer: http://stackoverflow.com/a/27915016
tagged with: forms
has title: Form won't call javascript function when I press enter
type: Question
has comment: http://stackoverflow.com/comment/44228992
has answer: http://stackoverflow.com/a/27914969
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/44258266
comment on: http://stackoverflow.com/q/27930502
type: Comment
type: QuestionComment
score: 8
has text: That nested ternary makes my eyes bleed :(

http://stackoverflow.com/q/27960568
has answer: http://stackoverflow.com/a/27961171
favorite count: 0
tagged with: aggregation-framework
tagged with: node.js
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/27961171
possible better answer: http://stackoverflow.com/a/27961071
type: Question
has answer: http://stackoverflow.com/a/27961071
tagged with: mongodb
downvote count: 0
has body: i am trying to toggle a boolean value inside a object, which is a subdocument, i am having hard time to update a particular object within an array. Document: "_id" : ObjectId("54afaabd88694dc019d3b628") "Invitation" : [ { "__v" : 0, "ID" : ObjectId("54af6ce091324fd00f97a15f"), "__t" : "USER", "_id" : ObjectId("54b4ceb50fc380001bea1752"), "Accepted" : false }, { "__v" : 0, "ID" : ObjectId("54afac5412f5fdcc007a5c4d"), "__t" : "USER", "_id" : ObjectId("54b4cebe0fc380001bea1753"), "Accepted" : false } ], Controller: User.aggregate([{$match: {_id: ObjectId(54afaabd88694dc019d3b628)}},{$unwind: '$Invitation'},{$project: {_id: '$_id',Invitation: '$Invitation'}}],function(err,results){ function updateInvitation(_id){ var query = {'_id': _id, 'Invitation.ID': ObjectId("54af6ce091324fd00f97a15f")}; var operator = {$inc: {'Invitation.Accepted': 1}}; User.update(query,operator,{multi:true},function(err,updated){ if(err){ console.log(err); } console.log('updating'+updated); }); } res.jsonp(results); updateInvitation(results[0]._id); }); i tried using $set but it didnt worked out as whole Invitation array got replaced with 'Accepted = 1' How can i toggle 'Accepted' field of the document with particular 'ID'. Invitation.$.Accepted Positional operator doesnot apply to field containing array so can't iterate to Accepted field EDIT: User.find({_id: req.user._id},'Invitation',function(err,docs){ if(err){ console.log(err); } console.log(docs); var results = []; async.each(docs,function(doc,err) { if(err){ console.log('error'+ err); } async.each(docs.Invitation,function(invite,callback) { console.log('second async'); User.update( { '_id': doc._id, 'Invitation._id': invite._id }, { '$set': {'Invitation.$.Accepted': !invite.Accepted}}, function(err,doc) { results.push(doc); console.log('updated'+doc); callback(err); } ); }); },function(err) { if (err) console.log(err); console.log(results); }); }); The control is not getting inside second async.each, error is thrown on first async here is…
tagged with: mongoose
tagged with: javascript
has title: Update on Aggregate in Mongodb
answer count: 2

http://stackoverflow.com/q/27936884
tagged with: javascript
tagged with: jquery
has body: I have an area on my Wordpress theme where I am showing info about a random taxonomy. Basically, the taxonomy is "playwrights" and I am featuring a random one on the home page. Here is the HTML: <?php $allpw = get_terms( 'playwrights', 'hide_empty=0' ); $randpw = $allpw[ array_rand( $allpw ) ]; $randpw = get_term($randpw->term_id, 'playwrights'); $pwlink = get_term_link($randpw->term_id, 'playwrights'); ?> Playwright Spotlight <?php if (get_field('image', 'playwrights_'.$randpw->term_id)) { ?> <?php $imageid = get_field('image', 'playwrights_'.$randpw->term_id); ?> <a href="<?php echo $pwlink; ?>"> <?php echo wp_get_attachment_image($imageid, 'pwthumb'); ?> <?php } ?> <a href="<?php echo $pwlink; ?>"><?php echo $randpw->name; ?> <?php echo print_excerpt('', '200'); ?> I want to be able to click a button (in the code, it is the tag) and reload just that section (not the whole page) with a new random taxonomy term (playwright). I'm not great at JS/jquery and I'm not able to find a tutorial online that gets me where I need to go, especially considering the exchange between post data and the js function. How should I go about this?
type: UnansweredQuestion
tagged with: wordpress
has answer: http://stackoverflow.com/a/27942263
has title: Refresh to show new/random taxonomy
type: Question
score: 0
tagged with: random
answer count: 1

http://stackoverflow.com/q/27836363
upvote count: 3
linked to: http://stackoverflow.com/q/2844565
has answer: http://stackoverflow.com/a/27836789
tagged with: javascript
has comment: http://stackoverflow.com/comment/44077344
favorite count: 0
answer count: 3
linked to: http://stackoverflow.com/q/4950199
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44077455
tagged with: css
has title: How to detect change in a div or body?
tagged with: dojo
has answer: http://stackoverflow.com/a/27836549
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27836585
accepted answer: http://stackoverflow.com/a/27836549
downvote count: 0
possible better answer: http://stackoverflow.com/a/27836789
has body: I have a following script, I need to detect: content element has change (size/position for example) or body element has change (size/position for example) I cannot this logic on the button itself. What are the event available? Could you please provide a sample of code? http://jsbin.com/sewerumive/1/ Add content! Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
type: Question
score: 3
has comment: http://stackoverflow.com/comment/44077702
has comment: http://stackoverflow.com/comment/44077263

http://stackoverflow.com/comment/44089530
type: Comment
has text: You really need to show a sample of the HTML as it is not obvious what the `$parent`'s relationship is to the item clicked. There are much easier ways to do this, but you need to show your layout HTML first :)
comment on: http://stackoverflow.com/q/27842562
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44304726
type: Comment
has text: Sorry, this **is** required in 1.3 unless you set `allowGlobals` on the `controllerProvider` as mentioned above in the comments
comment on: http://stackoverflow.com/a/27954620
score: 0
type: AnswerComment

http://stackoverflow.com/q/27896360
linked to: http://stackoverflow.com/q/24555370
has answer: http://stackoverflow.com/a/27897590
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/25359247
tagged with: phantomjs
linked to: http://stackoverflow.com/q/18453993
type: Question
has body: I have the following RequestURL.js file. var webPage = require('webpage'); var system = require('system'); var page = webPage.create(); page.customHeaders = {"pragma": "akamai-x-feo-trace"}; page.settings.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" if (system.args.length === 1) { console.log('Try to pass some args when invoking this script!'); } else { page.open(system.args[1], function (status) { var content = page.content; console.log(content); phantom.exit(); }); } Now I am executing the following command to get the HTML source (generated HTML after execution of JS on the page). phantomjs --ignore-ssl-errors=yes --ssl-protocol=any RequestURL.js #my_url_here &gt; body.html Now the problem is the page source does not get generated if JS errors are there on the page. Is there a way in phantoms to basically ignore any errors and get the full generated page source.
tagged with: ssl
tagged with: javascript
score: 0
has title: Phantomjs need the page source in spite of JS errors
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/27841792
tagged with: jquery
has answer: http://stackoverflow.com/a/27841902
has comment: http://stackoverflow.com/comment/44087449
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44087486
has answer: http://stackoverflow.com/a/27842075
tagged with: css
answer count: 4
possible better answer: http://stackoverflow.com/a/27841902
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27842106
has answer: http://stackoverflow.com/a/27841993
accepted answer: http://stackoverflow.com/a/27841993
type: Question
has comment: http://stackoverflow.com/comment/44088246
has title: Yellow box should be fixed while scrolling in html
has body: Untitled Document fixed box Diploma in Film Making | Duration : 2Years Fee Program Duration: 2 years (4 Semester) Admission Fee: 42,000 Program Tuition Fee (Per Semester): 48,000 Examination Fee (Per Semester): 5,000 Security Deposit (Refundable): 10,000 Notes / Benefits / Penalties / Refunds: All amounts are payable, unless mentioned otherwise to ‘Creo College’ by cheque / demand draft / NEFT / RTGS / online transfers. Details for online transfer of funds can be collected from the admission desk Of the amounts payable in each installment, certain payments will need to be made to parties representing the University that is granting the degrees. Appropriate intimation of such party names and the split in payments for each semester will be given. Examination Fees, payable on an annual or semi-annual basis, to the University are additional. You will be intimated of the same as well. The Semester 1 installment includes security deposit, wherever applicable. This is non-interest bearing and refundable on course completion or withdrawal, subject to deductions. All amounts are listed in Indian Rupees. The same amounts are payable by both Indian and International students. All payments made by Indian nationals must be accompanied by the Permanent Account Number (PAN) of the payee, without which fees will not be accepted. Transfer of fees across / between courses is subject to management approval, on a case-by-case basis, and will involve a re-calculation of fees based on the existing fees in the new course, the amount already paid by the student and where in the course (which semester) the student chooses to transfer. Once a Semester has commenced, all fees paid / payable upto that date are non-refundable. Should a student leave his/her course mid-semester, any fees paid in advance for future semesters will be refunded, along with the security deposit paid, subject to deductions. If a student wishes to withdraw from the course between 2 semesters, he / she has to convey the…
tagged with: javascript

http://stackoverflow.com/comment/44287186
has text: It's and "update" statement. Last time I checked, the peron writing the code was in control of the logic. Check the length of `keywords`. Your fault. Don't rely on the database to correct your mistakes.
comment on: http://stackoverflow.com/q/27945897
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/27906663
has body: Instead of getting the html content and attaching the element content, just append the spinner to the content and make css changes to show at the top, once the loading completed, just remove the spinner element as like the below. app.directive('ngLoading', function ($compile) { var loadingSpinner = ' ' + ' ' + ' ' + ' ' + ' ' + ' '; return { restrict: 'A', link: function (scope, element, attrs) { scope.$watch(attrs.ngLoading, function (val) { if (val) { element.append(loadingSpinner); } else { element.find('div.spinner').detach(); } }); } }; });
score: 0
answers question: http://stackoverflow.com/q/27906125
type: Answer

http://stackoverflow.com/q/27815432
has answer: http://stackoverflow.com/a/27815475
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44037217
accepted answer: http://stackoverflow.com/a/27815458
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44037206
favorite count: 0
has body: My h1 tag link appear a blue underline that I did not add.I already set text-decoration to none,but it still appear a blue line when hover.Here is my code. CSS h1{ font-family:'Oxygen'; color:#000; font-size:100px; text-align:center; margin-top:80px; font-weight:50; border:5px black solid; text-decoration:none; } h1:hover{ color:#fff; border:5px solid white; text-decoration:none; } #h1{ height:100px; width:600px; margin:auto; } HTML Joomgame Front-End Devoloper
upvote count: 2
has title: My h1 tag link appear a underline when hover that I didn't add
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27815475
has answer: http://stackoverflow.com/a/27815458
score: 1

http://stackoverflow.com/a/27854242
answers question: http://stackoverflow.com/q/27853781
has body: Try RegExp, below example allows alpha-numeric & spaces only: $(function() { $('#profile_pstate').on('input', function() { this.value = this.value.replace(/[^\da-zA-Z\s]/g, ''); }); });
score: 0
type: Answer

http://stackoverflow.com/comment/44136369
type: Comment
type: QuestionComment
has text: Can you provide the HTML (not PHP) so we can test? A JSFiddle, Snippet, or Plunk would be really helpful.
comment on: http://stackoverflow.com/q/27866619
score: 0

http://stackoverflow.com/a/27852175
has body: Add the following in your controller $scope.left = function(){ var totalLength = 255; if($scope.name){ totalLength -= $scope.name.length; } if($scope.email){ totalLength -= $scope.email.length; } if($scope.textarea){ totalLength -= $scope.textarea.length; } return totalLength; }; Add this to render the output of the function in your HTML. You have {{left()}} characters left
score: 0
has comment: http://stackoverflow.com/comment/44108511
type: Answer
answers question: http://stackoverflow.com/q/27851150

http://stackoverflow.com/comment/44134047
comment on: http://stackoverflow.com/a/27865685
score: 0
type: AnswerComment
type: Comment
has text: how about using your the ajax call directly in your change event handler?

http://stackoverflow.com/q/27928600
accepted answer: http://stackoverflow.com/a/27929531
has comment: http://stackoverflow.com/comment/44254362
possible better answer: http://stackoverflow.com/a/27928780
score: -2
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
has title: Javascript only Not selector
has answer: http://stackoverflow.com/a/27929531
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44254672
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44254302
has body: I have a question. How can I can I apply a effect to this span ("infoTexts") with Javascript without touching the "phoneClose"?? (Give a example, not answer please) I know it's with the nth-child but i'm not being able to do anything at all) Thank you and sorry for my kinda bad english :P &lt;span id="infoTexts"&gt; &lt;span style="padding-right:10px;padding-left:370px;"&gt; &lt;i class="fa fa-envelope"&gt;&lt;/i&gt;&amp;nbsp; Info@tpc.com&lt;/span&gt; &lt;i id="phoneClose" class="fa fa-phone" style="position:relative" onclick="hideForm();"&gt;&lt;/i&gt; &amp;nbsp;(+351) &lt;b&gt;913937014&lt;/b&gt; &lt;/span&gt;
downvote count: 2
has answer: http://stackoverflow.com/a/27928780
has comment: http://stackoverflow.com/comment/44255041
type: Question

http://stackoverflow.com/q/27818947
has answer: http://stackoverflow.com/a/27819105
tagged with: http://stackoverflow.com/tag/html
answer count: 4
type: AnsweredQuestion
has body: I'm a beginner of Javascript and html. I want to output 10 "Hi" but following code doesn't work. What should I do? index.html and app.js is in a same folder. index.html app.js var main = function(){ for(var i = 0; i<10; i++){ var f = document.createElement('p'); f.innerText = "Hi."; var div = document.getElementByClass('test'); div.appendChild(f); }; $(document).ready(main);
upvote count: 3
has comment: http://stackoverflow.com/comment/44043851
has answer: http://stackoverflow.com/a/27818983
type: Question
score: 3
has title: How do I use javascript for html?
tagged with: javascript
has answer: http://stackoverflow.com/a/27819116
accepted answer: http://stackoverflow.com/a/27818983
downvote count: 0
possible better answer: http://stackoverflow.com/a/27818982
favorite count: 0
has comment: http://stackoverflow.com/comment/44047011
has answer: http://stackoverflow.com/a/27818982

http://stackoverflow.com/a/27995335
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/110456854
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/110459440
has comment: http://stackoverflow.com/comment/71882777
accepted answer of: http://stackoverflow.com/q/27960868
upvote count: 2
has comment: http://stackoverflow.com/comment/44423658
has body: So what I did was: in eventRender: function... i would do element.attr('data-event-id', event.id); element.addClass('context-class'); then in a document ready function attached the context menu to all .context-class elements. inside the context menu code, you get the element and can pull the 'data-' attributes out for what you need
answers question: http://stackoverflow.com/q/27960868

http://stackoverflow.com/comment/44176432
score: 0
type: Comment
type: QuestionComment
has text: So, you basically want it to stay active after a click, even if unhovered?
comment on: http://stackoverflow.com/q/27887739

http://stackoverflow.com/comment/44051970
type: Comment
has text: But then it's obviously inserted into the dom, given the problem description :) I'm combing through other js on the page to see if there's a name conflict or something. Interestingly, if I type #approvedTab into the url (e.g. localhost/home/#approvedTab) all of the tabs work perfectly. Any idea what that changes about things to make it work?
comment on: http://stackoverflow.com/q/27822075
score: 0
type: QuestionComment

http://stackoverflow.com/q/27847742
has comment: http://stackoverflow.com/comment/44099630
tagged with: twitter-card
has comment: http://stackoverflow.com/comment/44099180
has comment: http://stackoverflow.com/comment/44099587
type: Question
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13467730
score: 0
has comment: http://stackoverflow.com/comment/44099445
upvote count: 1
downvote count: 1
duplicate of: http://stackoverflow.com/q/13467730
has comment: http://stackoverflow.com/comment/44099553
has title: Trouble inserting a javascript variable into an HTML tag
has comment: http://stackoverflow.com/comment/44099191
has comment: http://stackoverflow.com/comment/44099561
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: I have a URL for my site that looks like this: http://mysite.co/twittercard.html#johnsmith I need to grab the text after the hash(#) in the URL, and use it in a meta tag. I have been trying to insert the text into the meta tag like this: document.write(' '); I have even tried using an extra javascript variable instead of just using window.location.hash: document.write(' '); var username = window.location.hash But that doesn't work either. Any time I test this, the text that is displayed to the user is "'+username+' test sentence goes here!" or "'+window.location.hash+' test sentence goes here!". If my URL is http://mysite.co/twittercard.html#johnsmith, then I need the sentence to be displayed as: "johnsmith test sentence goes here!". EDIT: I have added the script tags, and it is still not working:
favorite count: 0

http://stackoverflow.com/q/27843769
has answer: http://stackoverflow.com/a/30074247
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/32959527
score: 2
upvote count: 2
type: Question
has title: angular bootstrap popover hide after few seconds : tt_isOpen variable removed in ui-bootstrap-tpls-0.12.0.js
tagged with: javascript
answer count: 2
downvote count: 0
linked to: http://stackoverflow.com/q/25219493
favorite count: 0
has body: I've tried to used the excellent directive code of runTarm about angular-bootstrap-popover-hide-after-few-seconds. There's no problem with ui-bootstrap 0.11.0.js but in ui-bootstrap-0.12.0 tt_isOpen is removed and replaced by a property : isOpen of an isolated scope : var ttScope = scope.$new(true). I didn't succeed to access the right variable to watch to in place of tt_isOpen. All this is very frustrating. Any help ?
tagged with: angularjs

http://stackoverflow.com/comment/44194831
score: 0
has text: What result are you getting in the html template?FYI: you are returning a cursor in the helper, try fetching the as an array `QuestionList.find({acitve:true}).fetch()`
comment on: http://stackoverflow.com/q/27897142
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27876492
has comment: http://stackoverflow.com/comment/44154815
has body: You can add url as 4th parameter to your locations array. For example: var locations = [ ['Rome', 41.9100711,12.5359979, 4, 'example.com'], ... ]; And when you creating Marker object, put it as url param. e.g.: marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, clickable: true, url: locations[i][4]}); And in the event listener: google.maps.event.addListener(marker, 'click', function() { window.location.href = this.url; ... });
type: Answer
answers question: http://stackoverflow.com/q/27876422
has comment: http://stackoverflow.com/comment/44162483
score: 0

jquery
tags question: http://stackoverflow.com/q/27857628
tags question: http://stackoverflow.com/q/27885187
tags question: http://stackoverflow.com/q/27845676
tags question: http://stackoverflow.com/q/27896993
tags question: http://stackoverflow.com/q/27939471
tags question: http://stackoverflow.com/q/27961813
tags question: http://stackoverflow.com/q/27902728
tags question: http://stackoverflow.com/q/27911364
tags question: http://stackoverflow.com/q/27805861
tags question: http://stackoverflow.com/q/27889508
tags question: http://stackoverflow.com/q/27814418
tags question: http://stackoverflow.com/q/27844640
tags question: http://stackoverflow.com/q/27840448
tags question: http://stackoverflow.com/q/27889698
tags question: http://stackoverflow.com/q/27883115
tags question: http://stackoverflow.com/q/27834079
tags question: http://stackoverflow.com/q/27833564
tags question: http://stackoverflow.com/q/27947688
tags question: http://stackoverflow.com/q/27922030
tags question: http://stackoverflow.com/q/27807110
tags question: http://stackoverflow.com/q/27895544
tags question: http://stackoverflow.com/q/27867432
tags question: http://stackoverflow.com/q/27936919
tags question: http://stackoverflow.com/q/27809539
tags question: http://stackoverflow.com/q/27950892
tags question: http://stackoverflow.com/q/27921922
tags question: http://stackoverflow.com/q/27954419
tags question: http://stackoverflow.com/q/27826445
tags question: http://stackoverflow.com/q/27829624
tags question: http://stackoverflow.com/q/27846389
tags question: http://stackoverflow.com/q/27925596
tags question: http://stackoverflow.com/q/27831418
tags question: http://stackoverflow.com/q/27850728
tags question: http://stackoverflow.com/q/27961647
tags question: http://stackoverflow.com/q/27938544
tags question: http://stackoverflow.com/q/27937898
tags question: http://stackoverflow.com/q/27853842
tags question: http://stackoverflow.com/q/27810292
tags question: http://stackoverflow.com/q/27959007
tags question: http://stackoverflow.com/q/27886614
tags question: http://stackoverflow.com/q/27942508
tags question: http://stackoverflow.com/q/27955417
tags question: http://stackoverflow.com/q/27826050
tags question: http://stackoverflow.com/q/27899601
tags question: http://stackoverflow.com/q/27837889
tags question: http://stackoverflow.com/q/27934581
tags question: http://stackoverflow.com/q/27846751
tags question: http://stackoverflow.com/q/27825760
tags question: http://stackoverflow.com/q/27915253
tags question: http://stackoverflow.com/q/27912738
tags question: http://stackoverflow.com/q/27876824
tags question: http://stackoverflow.com/q/27831772
tags question: http://stackoverflow.com/q/27952951
tags question: http://stackoverflow.com/q/27893889
tags question: http://stackoverflow.com/q/27863731
tags question: http://stackoverflow.com/q/27872483
tags question: http://stackoverflow.com/q/27940691
tags question: http://stackoverflow.com/q/27833175
tags question: http://stackoverflow.com/q/27962419
tags question: http://stackoverflow.com/q/27937994
tags question: http://stackoverflow.com/q/27847533
tags question: http://stackoverflow.com/q/27896322
tags question: http://stackoverflow.com/q/27953215
tags question: http://stackoverflow.com/q/27951005
tags question: http://stackoverflow.com/q/27939608
tags question: http://stackoverflow.com/q/27930613
tags question: http://stackoverflow.com/q/27857564
tags question: http://stackoverflow.com/q/27947044
tags question: http://stackoverflow.com/q/27896641
tags question: http://stackoverflow.com/q/27905741
tags question: http://stackoverflow.com/q/27878757
tags question: http://stackoverflow.com/q/27841387
tags question: http://stackoverflow.com/q/27888145
tags question: http://stackoverflow.com/q/27938332
tags question: http://stackoverflow.com/q/27933188
tags question: http://stackoverflow.com/q/27829736
tags question: http://stackoverflow.com/q/27885849
tags question: http://stackoverflow.com/q/27946652
tags question: http://stackoverflow.com/q/27881235
tags question: http://stackoverflow.com/q/27818618

http://stackoverflow.com/q/27951144
type: UnansweredQuestion
score: -4
tagged with: href
has comment: http://stackoverflow.com/comment/44297771
has title: JavaScript changes a href link url based on user's IP address
has comment: http://stackoverflow.com/comment/44297665
type: Question
downvote count: 4
upvote count: 0
answer count: 1
tagged with: hyperlink
tagged with: javascript
has answer: http://stackoverflow.com/a/28007802
linked to: http://stackoverflow.com/q/6016120
tagged with: http://stackoverflow.com/tag/html
has body: Hopefully someone can assist with this question. I am looking for simple JavaScript code that will update the a href link url and display it on a static HTML page, based on IP address from which the access request came. The good thing is – the IP will be static and fixed, it will be the same number, which I already have. In other words, if I access the same page from different IP addresses, the page will display different link url based on that. While I might be wrong, my understanding is this can be scripted using ‘if else’ logic – if a specific IP address is detected and matched, the JS rewrites the link address. Here is my logic below. Sorry, I don’t know much of the JavaScript syntax and used the construct below as a hypothetical example (its probably a total wreck since I didn't use the right syntax and whatnot), but this should give the general idea: **if (location.referrer.ip('123.45.67.89.00') &gt; -1)** **document.write.href = 'xxx.com';** **else if (location.referrer.ip('123.98.76.54.00') &gt; -1)** **document.write.href = 'yyy.com';** **else** **document.write.href = 'zzz.com';** It is my understanding that since I will be using a single IP address in the formula, the following code can be omitted: **else if (location.referrer.ip('123.98.76.54.00') &gt; -1)** **document.write.href = 'yyy.com/';** Leaving only something like this **if (location.referrer.ip('123.45.67.89.00') &gt; -1)** **document.write.href = 'xxx.com';** **else** **document.write.href = 'zzz.com';** Again, this might not be the correct approach altogether and a way more sophisticated solution will be needed, therefore I hope that some of you with coding expertise can provide some assistance. Just to be clear - the script should NOT redirect the page but only update the url behind the link displayed on it instead. I know there are several technologies already out there that can offer the solution, but my task is to get this running on the client side in the browser; I am not allowed to use…
favorite count: 0

http://stackoverflow.com/q/27913722
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44228119
has comment: http://stackoverflow.com/comment/44227033
has title: Express.js Problems with response.json and querying
tagged with: node.js
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44228065
has body: I followed a tutorial for a RESTful web app with express: http://cwbuecheler.com/web/tutorials/2014/restful-web-app-node-express-mongodb/ It showed me how to issue get requests like this: router.get('/userlist', function(req, res) { var db = req.db; db.collection('userlist').find().toArray(function (err, items) { res.json(items); }); }); And that makes sense to me. It renders in the jade template, too which is fantastic. Now I'm writing my own app, and it's restful as well. I've come up with the following for my get request /budget router.get('/', stormpath.loginRequired, function(req, res, next) { var db = req.db; var user_id = req.user.customData["mongo_id"]; var collection = db.get('usercollection'); collection.find({'_id' : user_id}, function (err, user_data) { res.render('budget', user_data); }); }); And this renders the template, but I don't think that this will allow me to retrieve JSON from this path later. Is this correct? I have tried putting res.json(user_data); inside the collection.find callback, but it literally only renders json on the page, and I cannot figure out why. I need the JSON data to be 'GETable' because my other REST methods will be asynchronous, and I will need to use $.getJSON( '/budget', function( data )
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44227993
tagged with: javascript
tagged with: express
type: Question
score: 0

http://stackoverflow.com/comment/44239545
type: QuestionComment
type: Comment
has text: @user3771837 But the requirement says that if the difference is less or equal to 2 hrs, then make them in same group...which means [8:00 AM,10:00 AM, 12:00PM, 2:00 PM] should be in the same group as the difference between the timings is 2 hrs. Why the discrepancy?
score: 0
comment on: http://stackoverflow.com/q/27914871

xmlhttprequest
tags question: http://stackoverflow.com/q/27924902
tags question: http://stackoverflow.com/q/27946147
tag name: xmlhttprequest
tags question: http://stackoverflow.com/q/27896953
tags question: http://stackoverflow.com/q/27867286
tags question: http://stackoverflow.com/q/27842706
tags question: http://stackoverflow.com/q/27848431
tags question: http://stackoverflow.com/q/27881071
tags question: http://stackoverflow.com/q/27954413
type: Tag
tags question: http://stackoverflow.com/q/27834946
tags question: http://stackoverflow.com/q/27908661
tags question: http://stackoverflow.com/q/27897836
tags question: http://stackoverflow.com/q/27894492

http://stackoverflow.com/comment/44306676
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27955881
type: QuestionComment
has text: You can use `$('body').css({ width: $(window).innerWidth() + 'px', height: $(window).innerHeight() + 'px' });` hide overflow in CSS then set some media queries to make it resposive.

http://stackoverflow.com/a/28137578
type: Answer
has body: ok you need a link when user click on it it save the screenshot var clickToSave= document.getElementById('linkeId'); function saveCanvas(link, filename) { link.href = game.canvas.toDataURL(); link.download = filename; }; clickToSave.onclick = function(){ var name = "name."+"png"; saveCanvas(this, name); };
accepted answer of: http://stackoverflow.com/q/27869544
answers question: http://stackoverflow.com/q/27869544
type: AcceptedAnswer
score: 0

http://stackoverflow.com/q/27877705
tagged with: object
has answer: http://stackoverflow.com/a/27877730
type: AnsweredQuestion
has title: JS "for (var key in arr)" > throws my own Array.prototypes, but not the inherent ones. Why?
score: 1
type: Question
answer count: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27877730
tagged with: iteration
tagged with: prototype
possible better answer: http://stackoverflow.com/a/27877728
has body: I accidently used an iteration like for (var key in arr) { alert(key); } and got an output that rose some questions. (I wanted to iterate through a JSON, so I used 'key' - an 'i' for index would be more suitable in this case, no question :-) The first outputs were the indeces (like '0', '1' etc.) - still no question - but at last it throws the names of my Array.prototypes, I declared somewhere else in the code. Prototypes like Array.prototype.lastIndex = function(){ return this.length - 1; } and it throws just 'lastIndex'. What I don't understand: Are my own, non-inherent prototypes distinct from the JS-inherent ones like splice(), slice() ... ? And: Why does it throw them at all? They are part of the Array.prototype, but not of a particular Array object!? Thx in advance!
has answer: http://stackoverflow.com/a/27877728
favorite count: 0
upvote count: 1

http://stackoverflow.com/comment/44653850
score: 0
type: Comment
has text: Hold on.. My code contains a button which when clicked starts drawing video.. Did you add that. Let me update my code a little.. Then try
type: AnswerComment
comment on: http://stackoverflow.com/a/28025770

http://stackoverflow.com/comment/44295314
comment on: http://stackoverflow.com/q/27949820
score: 3
type: Comment
type: QuestionComment
has text: Is there a reason `counts` can't be an array? e.g. `[{range: '680-700', count: 30}, {range: '620-640', count: 41}, {range: '640-660', count: 24}, {range: '660-680', count: 10}]`

http://stackoverflow.com/comment/44308502
score: 1
type: AnswerComment
type: Comment
has text: If you are using PHP, you can use PHP's csv function. http://php.net/manual/en/function.fgetcsv.php OR PHPExcel. https://github.com/PHPOffice/PHPExcel
comment on: http://stackoverflow.com/a/27955464

http://stackoverflow.com/a/27875144
has body: You get Object object because the thing you are alerting is object. You would need to read it's appropriate attributes such as e.result. If you want to see what all the object contains, you can use this for (var i in e) { alert(i + ": " + e[i]); } to iterate through all attributes of object e.
answers question: http://stackoverflow.com/q/27875109
score: 0
has comment: http://stackoverflow.com/comment/44152018
type: Answer
has comment: http://stackoverflow.com/comment/44151964

http://stackoverflow.com/q/27874834
upvote count: 1
has answer: http://stackoverflow.com/a/27883222
accepted answer: http://stackoverflow.com/a/27883222
tagged with: javascript
has comment: http://stackoverflow.com/comment/44167914
has body: I am using multer (^0.1.6) in a Nodejs Kraken application to upload a file. I looked at the multer documentation on npm and it seemed it's pretty straightforward to use this module for file upload. But I have been facing issues while uploading file on my local machine. Interestingly, I notice the file gets uploaded but my server hangs and the control never goes to the next middleware in the application which is responsible for rendering the next page. I also noticed that when the server is hung, it tried to upload the file again and finally times out saying "No data received". As a result of multer's retry, I see two copies of same file uploaded. Here is my kraken application code using multer module: index.js (root leve index.js at same level as package.json) ... ..... app = module.exports = express(); app.use(kraken(options)); app = module.exports = express(); app.use(kraken(options)); app.on('start', function () { console.log('Application ready to serve requests.'); console.log('Environment: %s', app.kraken.get('env:env')); }); app.use(multer({ dest: '/Users/abc/temp/fileuploads', limits: { fieldNameSize: 500, files: 2, fields: 5 }, rename: function (fieldname, filename) { return fieldname + filename + Date.now(); }, onFileUploadStart: function (file) { console.log('Upload starting for filename: ' + file.originalname); }, onFileUploadData: function (file, data) { console.log(data.length + ' of ' + file.fieldname + ' arrived') }, onParseStart: function () { console.log('Form parsing started at: ', new Date()) }, onParseEnd: function (req, next) { console.log('Form parsing completed at: ', new Date()); next(); }, onFileUploadComplete: function (file) { console.log(file.fieldname + ' uploaded to ' + file.path); }, onFileSizeLimit: function (file) { console.log('Failed: ', file.originalname) fs.unlink('./' + file.path) // delete the partially written file }, onFilesLimit: function () { console.log('Crossed file limit!') }, onFieldsLimit: function () { console.log('Cr…
has answer: http://stackoverflow.com/a/28260059
tagged with: file-upload
tagged with: node.js
favorite count: 0
downvote count: 0
possible better answer: http://stackoverflow.com/a/28260059
type: AnsweredQuestion
has title: File Upload hangs with Multer in Krakenjs application
score: 1
tagged with: kraken.js
type: Question
tagged with: multer
answer count: 2

http://stackoverflow.com/comment/44263580
type: QuestionComment
comment on: http://stackoverflow.com/q/27932544
has text: can you show `_Partial_Item_Tab` view?
score: 0
type: Comment

http://stackoverflow.com/a/27850868
has comment: http://stackoverflow.com/comment/44112527
accepted answer of: http://stackoverflow.com/q/27849843
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27849843
has comment: http://stackoverflow.com/comment/44113434
type: Answer
has comment: http://stackoverflow.com/comment/44112954
has body: If you want the output element to contain the degree sign (°), just append it to its value: 0° (Although id attribute values can be used as global variables, if they satisfy the syntax rules for identifiers, this easily creates confusion and risks. This is why the example uses document.getElementById('degree') and not degree.)
score: 0

http://stackoverflow.com/comment/44286100
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27943460
has text: Good, glad you figured it out!
type: AnswerComment

http://stackoverflow.com/comment/44309819
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27957418
has text: here is a shorter regex var re = /\(\[((?:\d{1,3}\.?){4})\]\)/g;

http://stackoverflow.com/comment/44175988
type: Comment
has text: @SecondRikudo Great. than we agree.
type: QuestionComment
comment on: http://stackoverflow.com/q/27887461
score: 0

http://stackoverflow.com/q/27848321
has title: jqGrid - Setting database record nested property as row id
has body: In my grid, I configured jsonReader "id" property to get my database record as row id. Like this: JSON: { id: 1, price: 99.99, data: { dataId: 2 } } JSON READER ... jsonReader: { root: 'list', total: 'count', id: 'id' }, ... What if I want to set "dataId" as the row id? I tried to define it by using dot notation in a string, but it doesn't work. Here's my grid options: var gridOptions = { height: 250, colNames: ['Nome', 'Preço'], colModel: [{ name:'ipvodAsset.title', index:'ipvodAsset.title', width: 200, sorttype:'string', searchoptions: { sopt:['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'] } }, { name:'price', index:'price', width:200, sorttype:'currency', formatter: 'currency', searchoptions: { sopt:['eq','ne','gt','ge','bw','bn','cn','nc'] } }], jsonReader: { id: 'data.data.id' }, prmNames: {'order': 'order'}, gridView: true, sortorder: 'asc', sortname: 'title', viewrecords : true, rowNum: 10, rowList:[10,20,30], altRows: true, dataType="local", data = [ { "id": 1, "price": 99.99, "data": { "dataId": 2 } }, { "id": 2, "price": 99.99, "data": { "dataId": 3 } }, { "id": 3, "price": 99.99, "data": { "dataId": 4 } }, { "id": 4, "price": 99.99, "data": { "dataId": 5 } } ] };
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44123719
type: Question
tagged with: jqgrid
tagged with: javascript
has comment: http://stackoverflow.com/comment/44104221
score: 0
accepted answer: http://stackoverflow.com/a/27863166
answer count: 1
has answer: http://stackoverflow.com/a/27863166

http://stackoverflow.com/comment/44213673
score: 0
has text: Yeah, you would think that the creator of SeleniumBuilder could detect a browser window onfocus event and then translate that into a switchTo method in the builder script. Not sure the reason why it doesn't already support that.
comment on: http://stackoverflow.com/q/27838606
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44270229
comment on: http://stackoverflow.com/q/27936483
has text: @RobG , Thanks alot for your answer. Yes it is simply hiding and showing since I didnt know how to sort. Will follow your answer after I have more practice with working with dom.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27882342
type: Question
has answer: http://stackoverflow.com/a/27882580
has title: Share PHP session with Javascript
tagged with: session
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27882580
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44166452
has answer: http://stackoverflow.com/a/27882643
tagged with: ajax
has comment: http://stackoverflow.com/comment/44184186
tagged with: php
has body: I have a PHP app that renders HTML pages for a social media application that I'm creating. Then, JavaScript initializes and makes things interactive. The PHP side of things logs into a separate webservice with curl. Now, I can't figure out a way to share the session started in PHP with JavaScript, so when I make a AJAX request in JavaScript to the data server, its authenticated. Is there a way to share a PHP session with JavaScript? Or to share authentication initially created with PHP with JavaScript?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27882643

http://stackoverflow.com/comment/44072747
has text: I can see it works when I run the code on this website, however on mine the boxes now do not expand. Here's my html, css and js http://jsfiddle.net/5sde40wx/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27833420

http://stackoverflow.com/comment/44139888
comment on: http://stackoverflow.com/q/27868721
has text: I suppose, my actual task itself is just have the image fade into the background color
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44212348
comment on: http://stackoverflow.com/q/27906274
score: 1
type: Comment
has text: Please use the search: [`[javascript] "||"`](http://stackoverflow.com/search?q=%5Bjavascript%5D+%22%7C%7C%22)
type: QuestionComment

http://stackoverflow.com/comment/44291373
has text: how I can do this ? @Spoke44
score: 0
comment on: http://stackoverflow.com/q/27947738
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44119459
comment on: http://stackoverflow.com/q/27830758
type: Comment
type: QuestionComment
has text: So problem is solved, right ?
score: 0

http://stackoverflow.com/comment/44078890
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27837096
has text: event handeler is attached to html see onclick=""

http://stackoverflow.com/a/27896866
has comment: http://stackoverflow.com/comment/44194176
accepted answer of: http://stackoverflow.com/q/27896844
has comment: http://stackoverflow.com/comment/44194107
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44194135
score: 1
has body: Try to using this instead of $(".chs") $("#qs").find(".chs").each(function(i,obj){ $(this).removeClass("chs"); //Remove class .chs $(this).addClass("chs"+i); //Add new class .chs+i }); Demo
upvote count: 1
answers question: http://stackoverflow.com/q/27896844

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/27956157
tags question: http://stackoverflow.com/q/27826052
tags question: http://stackoverflow.com/q/27867307
tags question: http://stackoverflow.com/q/27847747
tags question: http://stackoverflow.com/q/27893029
tags question: http://stackoverflow.com/q/27908789
tags question: http://stackoverflow.com/q/27806383
tags question: http://stackoverflow.com/q/27921326
tags question: http://stackoverflow.com/q/27891302
tags question: http://stackoverflow.com/q/27813584
tags question: http://stackoverflow.com/q/27883044
tags question: http://stackoverflow.com/q/27924964
tags question: http://stackoverflow.com/q/27843397
tags question: http://stackoverflow.com/q/27922535
tags question: http://stackoverflow.com/q/27806574
tags question: http://stackoverflow.com/q/27873313
tags question: http://stackoverflow.com/q/27864011
tags question: http://stackoverflow.com/q/27880672
tags question: http://stackoverflow.com/q/27885451
tags question: http://stackoverflow.com/q/27873609
tags question: http://stackoverflow.com/q/27955323
tags question: http://stackoverflow.com/q/27936632
tags question: http://stackoverflow.com/q/27941660
tags question: http://stackoverflow.com/q/27871123
tags question: http://stackoverflow.com/q/27846849
tags question: http://stackoverflow.com/q/27877681
tags question: http://stackoverflow.com/q/27912435
tags question: http://stackoverflow.com/q/27898600
tags question: http://stackoverflow.com/q/27938988
tags question: http://stackoverflow.com/q/27870053
tags question: http://stackoverflow.com/q/27836673
tags question: http://stackoverflow.com/q/27856721
tags question: http://stackoverflow.com/q/27829147
tags question: http://stackoverflow.com/q/27840172
tags question: http://stackoverflow.com/q/27825459
tags question: http://stackoverflow.com/q/27873095
tags question: http://stackoverflow.com/q/27919910
tags question: http://stackoverflow.com/q/27876109
tags question: http://stackoverflow.com/q/27858047
tags question: http://stackoverflow.com/q/27848462
tags question: http://stackoverflow.com/q/27850153
tags question: http://stackoverflow.com/q/27806252
tags question: http://stackoverflow.com/q/27804460
tags question: http://stackoverflow.com/q/27870493
tags question: http://stackoverflow.com/q/27879237
tags question: http://stackoverflow.com/q/27874988
tags question: http://stackoverflow.com/q/27897014
tags question: http://stackoverflow.com/q/27848972
tags question: http://stackoverflow.com/q/27848564
tags question: http://stackoverflow.com/q/27807944
tags question: http://stackoverflow.com/q/27901443
tags question: http://stackoverflow.com/q/27911999
tags question: http://stackoverflow.com/q/27931261
tags question: http://stackoverflow.com/q/27840222
tags question: http://stackoverflow.com/q/27952571
tags question: http://stackoverflow.com/q/27825208
tags question: http://stackoverflow.com/q/27851773
tags question: http://stackoverflow.com/q/27822291
tags question: http://stackoverflow.com/q/27934153
tags question: http://stackoverflow.com/q/27841959
tags question: http://stackoverflow.com/q/27890097
tags question: http://stackoverflow.com/q/27912035
tags question: http://stackoverflow.com/q/27928340
tags question: http://stackoverflow.com/q/27827412
tags question: http://stackoverflow.com/q/27931760
tags question: http://stackoverflow.com/q/27930580
type: Tag
tags question: http://stackoverflow.com/q/27904836
tags question: http://stackoverflow.com/q/27923445
tags question: http://stackoverflow.com/q/27822487
tags question: http://stackoverflow.com/q/27924356
tags question: http://stackoverflow.com/q/27821389
tags question: http://stackoverflow.com/q/27915909
tags question: http://stackoverflow.com/q/27884103
tags question: http://stackoverflow.com/q/27848321
tags question: http://stackoverflow.com/q/27898762
tags question: http://stackoverflow.com/q/27914668
tags question: http://stackoverflow.com/q/27849391
tags question: http://stackoverflow.com/q/27955104
tags question: http://stackoverflow.com/q/27913722

http://stackoverflow.com/comment/44051825
score: 0
type: Comment
has text: To echo SLaks: That would work, but likely by running the downloads in parallel, they would complete more quickly. (Or that's my hope anyway)
comment on: http://stackoverflow.com/a/27822923
type: AnswerComment

http://stackoverflow.com/comment/44279734
score: 0
type: AnswerComment
has text: `sort()` indexes the array's contents from smallest to largest, ie `["DEDCCCCDDDD" , "DEDCCCCDDDDC"]`, and the `[0]` grabs the value at index 0. basically we find the shortest array and take its length; this gives us the index at which difference occurs (in this case, 11). Note, this works only in a few use cases, but perfectly well for those like the example code.
comment on: http://stackoverflow.com/a/27933223
type: Comment

http://stackoverflow.com/comment/44285188
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27942644
has text: because you are under _same domain_ `fiddle.jshell.net`

http://stackoverflow.com/a/27957264
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/44335325
accepted answer of: http://stackoverflow.com/q/27953338
has body: You really dont need to start the socket.io server in the front end for this use case. The way you can get it to work is : Keep the backend as it is, which acts as a Socket.IO server In the font end connect to the server using a Socket.IO client. You can install the client by calling npm install socket.io-client and then connect to the server using : var io = require('socket.io-client'), socket = io.connect('localhost', { port: 3100 }); socket.on('connect', function () { console.log("socket connected"); }); socket.emit('messageFromClient', { user: 'someuser1', msg: 'i am online' }); You can then create a map of socket objects with their corresponding username and send a message to that user based on your business logic. More Information : You may have to add cases like client disconnection etc. You can read more about the call backs for that here : https://github.com/Automattic/socket.io-client
has comment: http://stackoverflow.com/comment/44340047
answers question: http://stackoverflow.com/q/27953338
has comment: http://stackoverflow.com/comment/44347824
type: AcceptedAnswer
downvote count: 0
upvote count: 8

http://stackoverflow.com/a/27947792
type: Answer
has body: If you want to call a callback function when the user clicks on a button: var buttons = document.querySelectorAll('.btn-click-me'); for (var i = 0; i &lt; buttons.length; i++) { var self = buttons[i]; self.addEventListener('click', function (event) { // prevent browser's default action event.preventDefault(); // call your awesome function here MyAwesomeFunction(this); // 'this' refers to the current button on for loop }, false); }
score: 8
answers question: http://stackoverflow.com/q/27946703
downvote count: 0
upvote count: 8

http://stackoverflow.com/comment/44123719
type: Comment
type: QuestionComment
has text: @Oleg Sorry, the "root" in "jsonReader" wasn't supposed to be there. I updated the question, my grid options are there now. Can you have a look, please?
comment on: http://stackoverflow.com/q/27848321
score: 0

http://stackoverflow.com/comment/44177209
score: 1
has text: @VivekChandra: That's right, it's the CoffeeScript website that has it, a fairly outdated version. Try `alert typeof jQuery` in it (shows "object"), or `alert jQuery.fn.jquery` which will show you (at present) `"1.6.4"`. :-)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27887631

http://stackoverflow.com/comment/44145153
comment on: http://stackoverflow.com/q/27871292
score: 0
type: Comment
type: QuestionComment
has text: simple, select data from an object where the elements match the filter criteria, similar to SQL SELECT * FROM TABLE WHERE aaa ='aaa' and bbb = 'bbb' and....

http://stackoverflow.com/a/27899251
upvote count: 4
has comment: http://stackoverflow.com/comment/44201518
downvote count: 0
has comment: http://stackoverflow.com/comment/44201343
type: AcceptedAnswer
score: 4
accepted answer of: http://stackoverflow.com/q/27893300
has body: Gmail website is dynamic. readyState / DOMContentLoaded and friends are all rather useless, since most of the UI is built on the fly and is not in the "initial" DOM. This is exactly what you're observing. You need to either poll for the compose button as RobW mentioned, or watch for it being added with MutationObserver events. Also of note is the mutation-summary library.
has comment: http://stackoverflow.com/comment/44201392
answers question: http://stackoverflow.com/q/27893300
has comment: http://stackoverflow.com/comment/44225244
type: Answer
has comment: http://stackoverflow.com/comment/44225316

http://stackoverflow.com/comment/44202483
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27897083
type: QuestionComment
has text: Then that's your issue. Check directory relative path is correct and it has permission.

http://stackoverflow.com/comment/44092326
type: AnswerComment
has text: Thank you! This appears to be the answer. Give me a few minutes to verify and I will mark it as so, or not, depending :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27844202

http://stackoverflow.com/a/28374531
has body: ...also keep in mind that having an ellipsis for overflown elements may force the ellipsis to appear because it might be larger in width than the last character. I have encountered some times where without ellipsis the whole text could be shown, while using ellipsis removed my last character.
score: 0
answers question: http://stackoverflow.com/q/27941779
type: Answer
has comment: http://stackoverflow.com/comment/45103074

http://stackoverflow.com/comment/90800635
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27867610
has text: In my example ( see the fiddle ) it will be achieved by setting the form-action ( to `javascript:void(0) ` )
type: AnswerComment

http://stackoverflow.com/comment/44121964
type: QuestionComment
has text: @RaviDhoriya can you please write the script for me ? I know next to nothing about ajax. Sorry.
score: 0
comment on: http://stackoverflow.com/q/27859671
type: Comment

http://stackoverflow.com/q/27876259
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27876327
has answer: http://stackoverflow.com/a/27876327
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44154010
score: 1
favorite count: 0
has title: How to get one iframe from group of iframes in div tags using jQuery
type: Question
has answer: http://stackoverflow.com/a/27876291
answer count: 2
upvote count: 1
has body: How to get one iframe from group of iframe in div tags. Here's the code: How to get one iframe from those for suppose I want so how can I get from group of iframes using jQuery?
has comment: http://stackoverflow.com/comment/44154087
accepted answer: http://stackoverflow.com/a/27876291

http://stackoverflow.com/comment/44284137
comment on: http://stackoverflow.com/q/27944108
score: 0
type: Comment
type: QuestionComment
has text: You should make an attempt to convert the code yourself and then return with specific issues in your implementations.

http://stackoverflow.com/comment/44148678
score: 0
type: Comment
type: QuestionComment
has text: Why are you not just using addEventListener?
comment on: http://stackoverflow.com/q/27873269

http://stackoverflow.com/a/27874864
has body: I recommend using a promise library and a memoization function to solve the task of handling multiple asynchronous operations that run in parallel. For the following example I'm using bluebird. Your entire loop, including result caching, can be reduced to this rather clearly arranged piece of code: var db = Promise.promisifyAll(db); var lookup = memoize(db.getLookupAsync, db); entries.forEach(function (entry) { lookup(entry.someOtherId).then(function (value) { writeData(entry, value); }); }); where memoize is a generic helper function that caches function results: function memoize(func, thisArg) { var cache = {}; return function memoize(id) { if (!cache.hasOwnProperty(id)) { cache[id] = func.apply(thisArg || this, arguments); } return cache[id]; }; } So lookup() is a function that calls the promisified version of db.getLookup() (bluebird's .promisifyAll() creates ...Async() versions of all the functions in an object) and memoizes the respective result. A promisified function returns a promise that resolves (i.e. calls its .then() callback) as soon as data is available, or immediately (if it already has resolved before). In other words, we can cache a promise and call .then() on it as often as we want. With this setup we have all we need to solve your task of handling asynchronous function calls while caching their results to keep the process as fast as possible. Plus it is pleasant, straight-forward to read, as opposed to "callback hell". Have a look at http://jsfiddle.net/Tomalak/91bdb5ns/, where you can see it work. Note that there is no error handling in my code. You should read into the bluebird docs and add it yourself.
has comment: http://stackoverflow.com/comment/44152307
answers question: http://stackoverflow.com/q/27855951
accepted answer of: http://stackoverflow.com/q/27855951
type: Answer
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44152097
type: AcceptedAnswer

http://stackoverflow.com/comment/44152910
score: 1
comment on: http://stackoverflow.com/a/27875418
has text: @acecloudsmaps: You should check the status of the response. It's very possible that the `geocode` can't find any address for some of the coordinates.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27932273
type: Answer
has comment: http://stackoverflow.com/comment/44291524
answers question: http://stackoverflow.com/q/27932170
has body: You can either call a function with thisLunch as a parameter like: var thisLunchQuery = new Parse.Query(Lunch); var lunchIdTemp = this.model.get("lunchId"); thisLunchQuery.equalTo("objectId", lunchIdTemp); var thisLunch = thisLunchQuery.find().then(function(results) { funcName(results[0]) }); or put it in the global/window object like: var thisLunchQuery = new Parse.Query(Lunch); var lunchIdTemp = this.model.get("lunchId"); thisLunchQuery.equalTo("objectId", lunchIdTemp); var thisLunch = thisLunchQuery.find().then(function(results) { window.myLunch = results[0]; });
score: 0

http://stackoverflow.com/q/27936840
has title: Rendering blank screen when trying to play animation in threejs
answer count: 1
has comment: http://stackoverflow.com/comment/44283885
accepted answer: http://stackoverflow.com/a/27956664
tagged with: 3dsmax
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/44294080
has body: I'm trying to animate an exported model(from 3dsmax -> dae file -> json) with animations using three.js. I am not getting any console errors but rather just a blank screen. Anyone have any ideas on why this is happening? I'm happy to also include json, png's, max file, dae file or any other resource that may be of help. Any help would be much appreciated. I'm stuck...here is the javascript: &lt;script&gt; var camera, scene, renderer, animmesh; var clock = new THREE.Clock(); function init() { camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); camera.position.z = 5; scene = new THREE.Scene(); scene.add(camera); renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); var loader = new THREE.JSONLoader(); loader.load("../../assets/model-threejs.json", function (model, material) { createScene(model, material); }); } function createScene(model, material) { material[0].skinning = true; animmesh = new THREE.SkinnedMesh(model, material[0]); scene.add(animmesh); } function render() { renderer.render(scene, camera); } init(); render(); &lt;/script&gt;
has answer: http://stackoverflow.com/a/27956664
type: Question
has comment: http://stackoverflow.com/comment/44305208
tagged with: three.js
tagged with: animation
has comment: http://stackoverflow.com/comment/44305314
score: 0

http://stackoverflow.com/comment/44131144
type: QuestionComment
has text: just put them all into a list iterate through them until you find it or use map.
comment on: http://stackoverflow.com/q/27864387
type: Comment
score: 0

http://stackoverflow.com/q/27948042
has body: Hello, I am new to xml, xsl, but I want to use node_xslt to Transform XML documents. I have seen the nodejs page for this https://www.npmjs.com/package/node_xslt and https://developer.mozilla.org/en-US/docs/XSLT/PI_Parameters, but it does not contains any example, so can someone provide me some link or examples through which I can understand about this..
has answer: http://stackoverflow.com/a/27960431
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44292624
tagged with: node.js
has comment: http://stackoverflow.com/comment/44309307
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27960431
has title: node_xslt documentation or examples not available
score: 0
upvote count: 1
downvote count: 1
tagged with: xslt
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44298849
comment on: http://stackoverflow.com/a/27951792
score: 0
has text: @redress So use `$(this).parent()`
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44119169
type: Comment
type: QuestionComment
has text: The button click will post back to the server and reload the page. Do you _want_ the page to be submitted or just have the popup show?
comment on: http://stackoverflow.com/q/27858174
score: 0

http://stackoverflow.com/comment/44126381
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27861603
has text: Wow, I changed the span in the Plnkr to a div and everything worked fine. So if I do ng-repeat in the div instead of the span, it works...
type: Comment

http://stackoverflow.com/q/27820925
type: Question
has answer: http://stackoverflow.com/a/29784669
tagged with: javascript
upvote count: 2
has body: Currently the timezone for the east coast is appearing as "EST", which is technically correct, but we need to update it to display as "ET". Any advice in how to do this with moment js? I tried replacing strings like this in moment-timezone.js, but it didn't appear to change it: "America/Detroit|EST EDT|50 40|01010101010101010101010|1BQT0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0", Any help is greatly appreciated in advance.
answer count: 1
favorite count: 0
tagged with: timezone
type: UnansweredQuestion
tagged with: momentjs
score: 2
downvote count: 0
has title: Moment JS update timezone abbreviation

http://stackoverflow.com/comment/44111085
type: AnswerComment
has text: You're welcome. Mine is basically the same as yours, except I introduced some variables to avoid repeating `this.nextElementSibling` and `this.querySelector` - of course this isn't *necessary* but it makes it easier to read...
type: Comment
comment on: http://stackoverflow.com/a/27853351
score: 0

http://stackoverflow.com/comment/44250189
has text: First W3 School is not good resource to study, try [MDN] (https://developer.mozilla.org/en-US/)
type: Comment
comment on: http://stackoverflow.com/q/27926562
score: 3
type: QuestionComment

http://stackoverflow.com/a/52485539
has comment: http://stackoverflow.com/comment/134472228
score: 11
upvote count: 11
answers question: http://stackoverflow.com/q/27824948
has body: EventSource API Update EventSource API now has three event handlers: onerror onmessage onopen These should be enough to handle everything you need on the client side. Something like this: const ssEvent = new EventSource( eventUrl ); ssEvent.onopen = function (evt) { // handle newly opened connection } ssEvent.onerror = function (evt) { // handle dropped or failed connection } ssEvent.onmessage = function (evt) { // handle new event from server } Ref: mozilla.org : EventSource : Event handlers Browser support for EventSource API: onopen - caniuse.com
type: Answer
downvote count: 0

http://stackoverflow.com/q/27925073
tagged with: javascript
has title: angularjs ng-options with formate date delete duplicates
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44247897
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44247236
possible better answer: http://stackoverflow.com/a/27925443
tagged with: angularjs
has answer: http://stackoverflow.com/a/27926825
accepted answer: http://stackoverflow.com/a/27926825
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27926442
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/27925443
has body: I made a filter for the field DataIscr on this json : [ { "IdPers": "1067", "CognNome": "JANE SMITH", "Sex": "F", "DataIscr": "1949-12-29T00:00:00+01:00" }, { "IdPers": "1093", "CognNome": "JOHN SMITH", "Sex": "M", "DataIscr": "1969-12-02T00:00:00+01:00" }, { "IdPers": "1093", "CognNome": "JANE SMITH", "Sex": "F", "DataIscr": "1969-06-17T00:00:00+01:00" } ] and I used the format date: 'yyyy' to display only the year: DataIscr: plunker:http://plnkr.co/edit/ED1v7czBosNSpCYxKW7n?p=preview How can I delete the duplicates?? I want to filter object with the same year and the filter 'unique' from angular Ui doesn't work. How can I do??

http://stackoverflow.com/comment/44135128
has text: how can i change the key-frame rule ? should i use .css(); and write the entire animation on it ?? @ chipChocolate.py
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27866288

http://stackoverflow.com/q/27909441
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to use Javascript to add event listeners to several links that are created via Javascript. I thought that I am probably calling it before it is created but looked at some other examples (such as add event listener on elements created dynamically and Google Map Event Listener does not seem to work) on here and thought that if those work I should probably be fine as well. If anyone could point out where I'm going wrong it would be greatly appreciated. *It seems like it would be way easier for everyone to just put the whole snippet in. Also as of right now I'm getting "P1 [object HTMLParagraphElement]" for when I console.log("P1 " + precinct1 JS Snippet: function initialize() { var myOptions = { zoom: 10, center: new google.maps.LatLng(123, 123), mapTypeId: google.maps.MapTypeId.ROADMAP } /* Creating Map - Do not create with Fusion Tables directly so that you have control of how the polygons are drawn. */ map = new google.maps.Map(document.getElementById('map-canvas'), myOptions); //Initialize JSONP request var script = document.createElement('script'); var url = ['https://www.googleapis.com/fusiontables/v1/query?']; url.push('sql='); var query = 'SELECT COMMISH, geometry, Website FROM ' + tableId; var encodedQuery = encodeURIComponent(query); url.push(encodedQuery); url.push('&callback=drawMap'); url.push('&key=' + key); script.src = url.join(''); var body = document.getElementsByTagName('body')[0]; body.appendChild(script); } function createPolygon(precinct, url, comPrecinct){ google.maps.event.addListener(precinct, 'mouseover', function() { this.setOptions( { fillOpacity: 0.5, strokeOpacity: 1, } ); }); google.maps.event.addListener(precinct, 'mouseout', function() { this.setOptions( { fillOpacity: 0.3, strokeOpacity: 0, } ); }); google.maps.event.addListener(precinct, 'click', function(){ window.location = url; }); } function drawMap(data) { var rows = data['rows']; console.log(rows); /*Create Legend*/ var legend = document.createElement('div'); legend.i…
linked to: http://stackoverflow.com/q/14258787
score: 0
has answer: http://stackoverflow.com/a/27909602
has title: Event listeners to html elements created by javascript for Google Maps Legend is not working
has answer: http://stackoverflow.com/a/27909653
tagged with: javascript
type: UnansweredQuestion
tagged with: event-listener
linked to: http://stackoverflow.com/q/21799572
tagged with: dom-events
type: Question
answer count: 2

http://stackoverflow.com/a/27944200
has body: Use Jquery and it will work for all textarea elements. $('textarea').blur(function(){ // code from cleanWordClipboard }); Or simply $('textarea').blur(cleanWordClipboard);
type: Answer
answers question: http://stackoverflow.com/q/27944164
has comment: http://stackoverflow.com/comment/44284940
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44290965
has comment: http://stackoverflow.com/comment/44288794
downvote count: 0

http://stackoverflow.com/comment/44288571
score: 0
type: AnswerComment
has text: Thanks for your efforts. In the course of the day i came to the same conclusion and i don't know why this happens.
type: Comment
comment on: http://stackoverflow.com/a/27946815

http://stackoverflow.com/q/27916145
has answer: http://stackoverflow.com/a/27916321
has title: Session variables is not getting printed
has comment: http://stackoverflow.com/comment/44239648
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44231190
has comment: http://stackoverflow.com/comment/44231073
tagged with: php
has body: I have a PHP backend script where I am creating a PHP Session variable: if(!isset($_SESSION)) session_start(); if(isset($_SESSION['uid'])) unset($_SESSION['uid']); $_SESSION['uid']=$this-&gt;_out; In my HTML Script I am using the following way to access it: editor = new $.fn.dataTable.Editor( { ajax: {url:"euseradd.php",complete : function(){var uid='&lt;?php if(!isset($_SESSION)) session_start();if(isset($_SESSION["uid"])){echo $_SESSION["uid"];unset($_SESSION["uid"]);}?&gt;';alert(uid)}}, ...................... } ); But I am not getting the value - my alert prints empty value. However when I try to echo the session variable output in WAMP server Apache logs by below way: echo 'Value is ' . $_SESSION['uid'] I get an error that 'Notice: Array to string conversion' - my intention is to log the value in some logs to see whats the value backend is also assigning. EDIT: I modified the echo statement by below way: echo 'Hello ' . serialize($this-&gt;_out); And Now I get the data at browser side like: Hello a:5:{s:2:"id";i:-1;s:11:"fieldErrors";a:0:{}s:5:"error";s:0:"";s:4:"data";a:0:{}s:3:"row";a:11:{s:8:"DT_RowId";s:7:"row_135";s:2:"id";s:3:"135";s:9:"last_name";s:6:"sdfdsf";s:10:"first_name";s:3:"dsf";s:8:"homeaddr";s:21:"sdfdsfsdfdsfdsfdsfdsf";s:5:"email";s:8:"s@jj.com";s:10:"officeaddr";s:24:"wwwwwwwwwwwwwwwwwwwwwwww";s:6:"mobile";s:8:"11111111";s:3:"age";s:2:"11";s:9:"chargeamt";s:2:"11";s:10:"start_date";s:10:"11/11/2011";}}{"row":{"DT_RowId":"row_135","id":"135","last_name":"sdfdsf","first_name":"dsf","homeaddr":"sdfdsfsdfdsfdsfdsfdsf","email":"s@jj.com","officeaddr":"wwwwwwwwwwwwwwwwwwwwwwww","mobile":"11111111","age":"11","chargeamt":"11","start_date":"11\/11\/2011"}} I am in need to extract the value "id":"135" from it. Actually I cannot use success function for my operation due to some constraint. And cause I am fixing an issue I am writing the code for the issue that I have EDIT: I tried printing the values like below: echo 'Hello ' . serialize($this-&gt;_out…
has comment: http://stackoverflow.com/comment/44232395
has comment: http://stackoverflow.com/comment/44231643
has comment: http://stackoverflow.com/comment/44231748
has comment: http://stackoverflow.com/comment/44231726
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27916319
tagged with: javascript
has comment: http://stackoverflow.com/comment/44231127
score: 0
has comment: http://stackoverflow.com/comment/44233414

http://stackoverflow.com/a/27910657
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/44223460
type: Answer
has body: Add required attribute to your password input field &lt;input type="password" id="password" name="password" placeholder="Password" required&gt;
answers question: http://stackoverflow.com/q/27910618
score: 1

http://stackoverflow.com/a/27846671
answers question: http://stackoverflow.com/q/27846474
type: Answer
upvote count: 3
has body: You can pass the title with hash and get it on another page, if this another page is yours and you can modify its code. 1st page: ... open me ... 2nd page - modify the body opening tag like this: If the page you are linking to isn't yours, you can use window.open method: open me
has comment: http://stackoverflow.com/comment/65823101
score: 3
has comment: http://stackoverflow.com/comment/44097315
downvote count: 0

http://stackoverflow.com/comment/44193127
score: 0
type: Comment
type: QuestionComment
has text: They invalidate the JSON. Where do they come from?
comment on: http://stackoverflow.com/q/27896132

http://stackoverflow.com/comment/44302400
type: QuestionComment
comment on: http://stackoverflow.com/q/27953587
score: 0
has text: I was trying to parse the document as an xml document using the following call: var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET",'http://feeds.feedburner.com/engadget/Dnjv',false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML;
type: Comment

http://stackoverflow.com/a/27848081
has comment: http://stackoverflow.com/comment/44134097
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27845696
has comment: http://stackoverflow.com/comment/44134045
score: 1
answers question: http://stackoverflow.com/q/27845696
has comment: http://stackoverflow.com/comment/44134206
has comment: http://stackoverflow.com/comment/44133782
has body: The issue here is with ng-if - ng-if causes Angular to add/remove the element from the DOM, and so (my guess) the element is added last when the data driving ng-if comes from an asynchronous operation. The solution is to use ng-show instead of ng-if: {{option.placeholder}} Here's a plunker that illustrates the differences
has comment: http://stackoverflow.com/comment/44134972
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44134549
type: Answer
has comment: http://stackoverflow.com/comment/44132794

http://stackoverflow.com/comment/44121734
type: AnswerComment
score: 0
type: Comment
has text: I can see now that in your case its because you have `href` in cancel incorrectly set to `javascript:;`. Change it to `javascript:void(0)` instead and try once again. You don't need $scope.$apply() anymore as it will be triggered by ng-click.
comment on: http://stackoverflow.com/a/27857885

http://stackoverflow.com/a/27873604
has body: Have you considered using django-pipeline? https://django-pipeline.readthedocs.org/en/latest/usage.html With it's template tag to pull in JS files, you may be able to replace both RequireJS and Django-Compressor.
upvote count: 1
answers question: http://stackoverflow.com/q/27868602
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/44092846
comment on: http://stackoverflow.com/q/27843673
has text: And you have `A === '*'` which is comparing an array to a string?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44029255
comment on: http://stackoverflow.com/q/27810215
has text: Sorry, what exactly is your question? Its hard to discern from the current wording.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44163561
type: AnswerComment
comment on: http://stackoverflow.com/a/27880722
score: 0
type: Comment
has text: Adding the / sign worked out for me. Thanks! But your solution with the single quotes did not work. I still get the message that id does not exists in the current context. I prefer the linq option because the data is already loaded in the page. Can you help me out with the quotes? Am I missing some special libraries??

http://stackoverflow.com/q/27857235
tagged with: arrays
has answer: http://stackoverflow.com/a/27857488
tagged with: javascript
tagged with: sorting
type: UnansweredQuestion
has body: I have the following data being returned from a server (the structure of this data is something that I do not have control over)... var data = { "TrackingResults": [ { "Name": "Pack One", "Products": { "Product": [ { "ProductName": "Soccer Ball" }, { "ProductName": "Tennis Racket" }, { "ProductName": "Gold Putter" } ] }, "status": "Despatched", "Location": "Alabama", "Type": "Parcel" }, { "Name": "Pack Two", "Products": { "Product": [ { "ProductName": "Backet Ball Hoop" }, { "ProductName": "Base Ball Glove" } ] }, "status": "Despatched", "Location": "Florida", "Type": "Parcel" } ] }; I would like to be able to sort each Tracking Result by the first Product Name. I can't find any code that will sort by a sub array property/value.
has comment: http://stackoverflow.com/comment/44117568
type: Question
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27857407
score: 0
answer count: 2
has title: Sorting an array of JavaScript objects by sub array property/value

http://stackoverflow.com/comment/44237389
comment on: http://stackoverflow.com/q/27918843
has text: provide your html code.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44033101
type: QuestionComment
has text: does it work by itself without having to run it inside a bookmarklet?
comment on: http://stackoverflow.com/q/27812173
score: 0
type: Comment

http://stackoverflow.com/comment/44311780
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27958853
score: 0
has text: Are you running the jQuery code on DOMReady? Is the `.test-test` div available at that point? Are there any errors in the console?

http://stackoverflow.com/comment/68320006
type: Comment
score: 0
has text: Ramda's about 3 years old. But the first public announcement was in May, 2014. Not having the array parameter is very much intentional. If you want to see a long contentious discussion about the reason for it, there's one at https://github.com/ramda/ramda/issues/452. I don't think of it much like Python. More like Haskell, LISP, ML, F#, OCaml and other FP languages.
comment on: http://stackoverflow.com/a/27895389
type: AnswerComment

http://stackoverflow.com/q/27895906
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/27896020
tagged with: javascript
tagged with: html5shiv
has title: Modernizr - html5shiv w/printshiv
answer count: 1
accepted answer: http://stackoverflow.com/a/27896020
has body: When make one's own build of Modernizr you're given an option for html5shiv 3.7 or html5shiv 3.7.1 w/printshiv. Can anyone explain the difference between these two options? I couldn't find it in the documentation for Modernizr and had little luck searching Google.
tagged with: http://stackoverflow.com/tag/html
tagged with: modernizr

http://stackoverflow.com/q/27931921
has comment: http://stackoverflow.com/comment/44261627
answer count: 1
accepted answer: http://stackoverflow.com/a/27931984
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has body: I'm dreaming of a form who is clever. Example: i'm choosing in a select box option 1 then it will appear a second select box with optionen 1a or 1b or similar. But Maybe if you are using option 2 in the first one, so maybe a textarea appears to help to get the information who matches to the option 2. I'm new to javascript an i asked google and found a lot of small examples. I did now something like that. But i'm not sure if this is a good idear to work on this way, because that means i have to write my html code for the second select oder textarea in the value part of the first one. Does anyone know where i should start or how i should sort my functions an vars? Stiefmütterchen Primeln Tulpen
has comment: http://stackoverflow.com/comment/44261480
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44261798
favorite count: 0
upvote count: 1
type: AnsweredQuestion
has title: Javascript onchange Form
has comment: http://stackoverflow.com/comment/44261828
tagged with: forms
has answer: http://stackoverflow.com/a/27931984
type: Question

http://stackoverflow.com/a/27871772
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27871593
has body: Install this to your dev dependencies https://www.npmjs.com/package/gulp-sourcemaps gulp.src(app) .pipe(concat("app.min.js")) .pipe(sourcemaps.init()) .pipe(uglify()) .pipe(sourcemaps.write("./")) .pipe(gulp.dest("js")) Make sure the generated JavaScript file, example.js, has the source mapping url at the end as follows: //# sourceMappingURL=example.js.map
upvote count: 1
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27871593

http://stackoverflow.com/comment/44180243
has text: ok i see, but when i turn it to sass what do i need to type in css just this? .top-bar-section li:not(.has-form) a:not(.button) { background: transparent; }
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27888588
score: 0

http://stackoverflow.com/q/27867912
tagged with: twitter-bootstrap
has body: I am applying bootstrap popover with ember cli. works great but when I use another action to filter the page, the popovers do not work anymore. To bind the popover I'm using the following: views/restaurants/search-results.js import Ember from 'ember'; export default Ember.View.extend({ jqueryEvents: function(){ Ember.$('[data-toggle="popover"]').popover(); }.observes('controller.filteredRestaurants').on('didInsertElement') }); my application.js controller has an action that transitionsToRoute search-results.js which updates the filteredRestaurants property and when it does, the popover stops working. One thing that could be adding complexity is that search-results template loops the restaurants that are filtered and each restaurant has a partial with the button that is bound to the tooltip inside the partial for each restaurant.
has answer: http://stackoverflow.com/a/27876831
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/27876831
has title: tooltip stops working after filter action
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ember.js
tagged with: ember-cli
favorite count: 0

http://stackoverflow.com/q/27830192
type: AnsweredQuestion
has title: JS app with crawlable content (detect search bots server side)?
score: 0
type: Question
has answer: http://stackoverflow.com/a/27830250
has comment: http://stackoverflow.com/comment/44067041
tagged with: server-side-scripting
tagged with: javascript
tagged with: seo
answer count: 1
has body: I am building a Blog as a JS app. The JS app will consume an Api for content. I am considering having a server side script that detects search bots and if found responds with plain crawlable HTML from the Api, otherwise loads the JS app which then does a XHR request to get the content from the Api and update the DOM. Basically, if the request comes from a bot we consume the API on the server and respond with plain HTML, or, if the request come from a 'normal' user agent, the JS App consumes the API to get the content and serve it to the user. Are there any caveats in using this approach?
accepted answer: http://stackoverflow.com/a/27830250
has comment: http://stackoverflow.com/comment/44067437

http://stackoverflow.com/comment/44040738
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27814898
type: Comment
has text: @Jeroen...I want the image to be draggable in x direction only and it is not draggable after center of box...

http://stackoverflow.com/a/27884527
has comment: http://stackoverflow.com/comment/44170696
type: Answer
answers question: http://stackoverflow.com/q/27884507
has body: The difference between the two methods is almost certainly trivial unless you're dealing with a VERY large array. My suggestion would be to go with what is cleaner, and in this case it looks like the one-time data binding is going to be the cleanest implementation (and arguably faster).
has comment: http://stackoverflow.com/comment/44170675
score: 0

http://stackoverflow.com/comment/44247328
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27898650
has text: I've updated the init() and zoomPostal() according to your suggestions. Help me take a look when you free. Thanks :)
type: AnswerComment

http://stackoverflow.com/comment/44085182
type: AnswerComment
has text: the toLowerCase has nothing to do here, read the tutorial instructions. 'If userAnswer is "yes"'.
type: Comment
comment on: http://stackoverflow.com/a/27840597
score: 0

http://stackoverflow.com/comment/44127152
score: 0
has text: it is nearly perfect, i see. thank you very much. the opacity will be maybe another issur, but i will try to deal with it. it looks cool and this is the only think that matters.
type: AnswerComment
comment on: http://stackoverflow.com/a/27862476
type: Comment

http://stackoverflow.com/comment/44287263
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27945969
has text: It's extra overhead but depending on your limitations you can add a CSS reset **after** their files are loaded. [Example](http://meyerweb.com/eric/tools/css/reset/)
score: 0

http://stackoverflow.com/a/27894887
answers question: http://stackoverflow.com/q/27894755
type: Answer
upvote count: 1
has body: Another way to make sure you get the height of the element is to use watch. angular.module('heightApp').directive('reportMyHeight', function($timeout) { return function (scope, el, attrs) { scope.$watch('lbl', function(newval, oldval){ alert(newval + '\n\n' + 'offsetHeight = ' + el[0].offsetHeight); }); } }) It will only be triggered once since you use ::.
score: 1
downvote count: 0

http://stackoverflow.com/comment/44191898
has text: Well, `setTimeout()` expects a function as the first argument. It looks like you are passing it a jQuery selection (`$('#clock')`). That will not work. Also, why are you using `clearInterval()`? You are not using any intervals (timeouts are not the same as intervals).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27895490
score: 0

http://stackoverflow.com/comment/44112346
has text: Thanks! But I'm not sure what you mean. If the container changes size the video will stay centered. I'm not real familiar with bg-size:cover though.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27853940

http://stackoverflow.com/comment/44192539
type: QuestionComment
has text: Check if this helps http://jsfiddle.net/TV8f4/
comment on: http://stackoverflow.com/q/27895619
score: 0
type: Comment

http://stackoverflow.com/q/27860240
score: 0
answer count: 1
has body: I'm trying to use Semantic-ui Search Module's local search. I can make it show no result. But when it has results, I got an error as blow: Search Module: A valid template name was not specified. false html code: &lt;div class="ui search"&gt; &lt;div class="ui input"&gt; &lt;input class="prompt" type="text" placeholder="Search..."&gt; &lt;/div&gt; &lt;div class="results"&gt;&lt;/div&gt; &lt;/div&gt; javascript code: var content = [ { title: 'Horse', description: 'An Animal' }, { title: 'Cow', description: 'Another Animal' } ]; $('.ui.search').search({ type : 'simple', source : content, searchFields : [ 'title' ], searchFullText: false });
tagged with: semantic-ui
type: UnansweredQuestion
has title: Semantic-ui Search Module: A valid template name was not specified
has answer: http://stackoverflow.com/a/27867132
type: Question
tagged with: javascript

http://stackoverflow.com/a/29784669
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27820925
has body: Unfortunately, moment doesn't have generic forms of the abbreviations. It only has abbreviations from the underlying TZ database. Generic abbreviations for some time zones can be found in CLDR, but there's currently no easy way to use these with Moment. If you know the value is ET, you could always just format without the time zone abbreviation, then append it to the string afterwards. var s = moment.tz("America/Detroit").format("YYYY-MM-DD h:mm:ss a") + " ET";

http://stackoverflow.com/comment/44174344
has text: in this only code1 linked to show detail but i want whole div linked to show detail expect Code:2654321
comment on: http://stackoverflow.com/q/27886516
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27880821
has comment: http://stackoverflow.com/comment/44163279
has answer: http://stackoverflow.com/a/27883661
downvote count: 2
upvote count: 1
has title: How to draw karaoke-like text with javascript?
type: AnsweredQuestion
has body: I would like to display some text with javascript and highlight it like karaoke - i.e. after some time, additional symbols to be highlighted. If I would like to have it smooth enough (i.e. highlight one symbol partially), what should I do and how? Should I use HTML5 canvas? Don't know what to start with.
score: -1
type: Question
accepted answer: http://stackoverflow.com/a/27883661
tagged with: canvas
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44163535
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44163493
has comment: http://stackoverflow.com/comment/44163621
favorite count: 0

http://stackoverflow.com/comment/44173215
comment on: http://stackoverflow.com/q/27886021
has text: Have you tried without stringify?
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/q/27862580
answer count: 1
type: UnansweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/27862758
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/44127580
has body: as you'll see in a sec, im new to angular. i want each object in the users array to have a value (difference) which is a result returned from a function calculating the difference between the user's score to top score. * in my code harry will have difference of 1 for example. how can i achieve that? HTML: Name Score Difference {{user.name}} {{user.score}} {{user.difference}} JS: var myApp = angular.module("myApp",[]); myApp.controller ('firstCtrl', function($scope, PersonService){ $scope.users = PersonService.list(); $scope.difference = function (id) { PersonService.difference(id); } }) myApp.service('PersonService',function(){ var uid = 1; var users = [{ id: 0, 'name': 'John', 'score': '46', 'difference': 'diff from top' },{ id: 0, 'name': 'Harry', 'score': '45', 'difference': 'diff from top' },{ id: 0, 'name': 'Sam', 'score': '43', 'difference': 'diff from top' }]; //simply returns the contacts list this.list = function () { return users; } this.difference = function(id){ for (i in users) { if (users[i].id == id) { return (Math.max.apply(Math, users.score) - users[i].score); } } } })
tagged with: http://stackoverflow.com/tag/html
score: 0
has title: array object's variable to equal value returned from a function using angularJS

http://stackoverflow.com/q/27860121
has comment: http://stackoverflow.com/comment/44122680
has answer: http://stackoverflow.com/a/27860189
type: Question
has comment: http://stackoverflow.com/comment/44122719
has title: Replacing vowels in a string with "i"...could you please explain this expression? someText.replace(/[aAeEoOuU]/ig,"i")
tagged with: javascript
has comment: http://stackoverflow.com/comment/44122784
tagged with: replace
has comment: http://stackoverflow.com/comment/44122636
score: 0
has body: Below is the complete code which will change any vowel in the user's input to an "i". Just curious to what the characters mean in the expression? what is the difference between using a / and ". What does the ig mean. var someText = prompt("What is Lance trying to say?"); var noVowels = someText.replace(/[aAeEoOuU]/ig,"i"); console.log (noVowels);
answer count: 1
linked to: http://stackoverflow.com/q/12993629
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44124892

http://stackoverflow.com/q/27861936
type: UnansweredQuestion
has title: WordPress Error: Warning Illegal Offset
type: Question
has answer: http://stackoverflow.com/a/27862333
tagged with: php
answer count: 1
has body: I'm working on a directory website on wordpress, when I try the search option I'm getting this error: Warning: Illegal string offset 'field' in /home/dalilouk/public_html/wp-content/themes/directory/header.php on line 27 Warning: Illegal string offset 'field' in /home/dalilouk/public_html/wp-content/themes/directory/header.php on line 33 And the result of the search is always "nothing found". This is the code of the header.php from line 27: &lt;script type="text/javascript"&gt; #line 27 jQuery(document).ready(function($) { {ifset $themeOptions-&gt;search-&gt;searchCategoriesHierarchical} var categories = [ {!$categoriesHierarchical} ]; {else} var categories = [ #line 33 {foreach $categories as $cat} { value: {$cat-&gt;term_id}, label: {$cat-&gt;name} }{if !($iterator-&gt;last)},{/if} {/foreach} ]; {/ifset} {ifset $themeOptions-&gt;search-&gt;searchLocationsHierarchical} var locations = [ {!$locationsHierarchical} ]; {else} var locations = [ {foreach $locations as $loc} { value: {$loc-&gt;term_id}, label: {$loc-&gt;name} }{if !($iterator-&gt;last)},{/if} {/foreach} ]; {/ifset} var catInput = $( "#dir-searchinput-category" ), catInputID = $( "#dir-searchinput-category-id" ), locInput = $( "#dir-searchinput-location" ), locInputID = $( "#dir-searchinput-location-id" ); catInput.autocomplete({ minLength: 0, source: categories, focus: function( event, ui ) { var val = ui.item.label.replace(/&amp;amp;/g, "&amp;"); val = val.replace(/&amp;nbsp;/g, " ").replace(/&amp;#039;/g, "'"); catInput.val( val ); return false; }, select: function( event, ui ) { var val = ui.item.label.replace(/&amp;amp;/g, "&amp;"); val = val.replace(/&amp;nbsp;/g, " ").replace(/&amp;#039;/g, "'"); catInput.val( val ); catInputID.val( ui.item.value ); return false; } }).data( "ui-autocomplete" )._renderItem = function( ul, item ) { return $( "&lt;li&gt;" ) .data( "item.autocomplete", item ) .append( "&lt;a&gt;" + item.label + "&lt;/a&gt;" ) .appendTo( ul ); }; var catList = catInput.autocomplete( "wid…
score: 0
tagged with: warnings
tagged with: wordpress
tagged with: javascript

http://stackoverflow.com/q/27859751
upvote count: 8
possible better answer: http://stackoverflow.com/a/27867183
has answer: http://stackoverflow.com/a/27867183
has comment: http://stackoverflow.com/comment/44123713
has answer: http://stackoverflow.com/a/45673537
tagged with: node.js
answer count: 4
has answer: http://stackoverflow.com/a/27860757
has body: It's trivial to test if an element is clickable with Protractor, but I'm stuck scratching my head trying to figure out how to check if an element is not clickable. I've attempted to wrap the click function in a try/catch so that when an error is thrown when trying to click it should catch it and let the test pass; however, this does not work. Here is my code for the method that does the check: return this.shouldSeeDisabledFunds() .then(function() { var clickable = true; try { fundsElem.first().click(); } catch (e) { clickable = false; console.log(clickable); } finally { console.log(clickable); } console.log(clickable); // All the way through, clickable is still true, and the console log in the // catch is not called. I believe this is because click is asynchronous. }) ;
tagged with: functional-testing
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/56870134
tagged with: protractor
has comment: http://stackoverflow.com/comment/44123691
type: Question
has title: How to check if an element is not clickable with Protractor?
score: 8
accepted answer: http://stackoverflow.com/a/27860757
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/27898907
tagged with: javascript
favorite count: 0
tagged with: documentum
has title: paging toolbar showing incorrect total number of pages(afterPageText)
tagged with: extjs
tagged with: pagingtoolbar
has answer: http://stackoverflow.com/a/27899679
has comment: http://stackoverflow.com/comment/44198266
has comment: http://stackoverflow.com/comment/44198827
has comment: http://stackoverflow.com/comment/44197969
downvote count: 0
has body: I am trying to add one paging toolbar in my existing toolbar and hide the first, previous, next, last and refresh button by using following code. My problem is that I am unable to fetch correct afterPageText value(total number of pages). I m doing this for resultlist in xCP Designer. Plz help. CODE: Ext.define('Override.toolbar.Paging', { override: 'Ext.toolbar.Paging', hideFirstButton: false, hidePrevButton: false, hideBeforePageText: false, hidePageNumberField: false, hideAfterPageText: false, hideNextButton: false, hideLastButton: false, hideRefreshButton: false, getPagingItems: function() { var me = this; return [{ itemId: 'first', tooltip: me.firstText, overflowText: me.firstText, iconCls: Ext.baseCSSPrefix + 'tbar-page-first', hidden: me.hideFirstButton, disabled: true, handler: me.moveFirst, scope: me }, { itemId: 'prev', tooltip: me.prevText, overflowText: me.prevText, iconCls: Ext.baseCSSPrefix + 'tbar-page-prev', hidden: me.hidePrevButton, disabled: true, handler: me.movePrevious, scope: me }, { xtype: 'tbseparator', hidden: me.hideFirstButton &amp;&amp; me.hidePrevButton }, { xtype: 'tbtext', text: me.beforePageText, hidden: me.hideBeforePageText }, { xtype: 'numberfield', itemId: 'inputItem', name: 'inputItem', hidden: me.hidePageNumberField, cls: Ext.baseCSSPrefix + 'tbar-page-number', allowDecimals: false, minValue: 1, hideTrigger: true, enableKeyEvents: true, keyNavEnabled: false, selectOnFocus: true, submitValue: false, isFormField: false, width: me.inputItemWidth, margins: '-1 2 3 2', listeners: { scope: me, keydown: me.onPagingKeyDown, blur: me.onPagingBlur } }, { xtype: 'tbtext', itemId: 'afterTextItem', hidden: me.hideAfterPageText, text: "of {0}" }, { xtype: 'tbseparator', hidden: me.hideNextButton &amp;&amp; me.hideLastButton }, { itemId: 'next', tooltip: me.nextText, overflowText: me.nextText, iconCls: Ext.baseCSSPrefix + 'tbar-page-next', hidden: me.hideNextButton, disabled: true, handler: me.moveNext, scope: me }, { itemId: 'last', tooltip: …
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44198997
type: Question
has comment: http://stackoverflow.com/comment/44197941
score: 1
has comment: http://stackoverflow.com/comment/44198523
has comment: http://stackoverflow.com/comment/44198475
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/44133733
score: 0
type: AnswerComment
type: Comment
has text: The downside of this approach is of course that the relative path has to be known in advance (how many levels back before drilling down) and the page depth it is used from cannot change or it will break. e.g. it will fail from `/` or `/home/` but work from `/home/index` even though they are the same page.
comment on: http://stackoverflow.com/a/27864643

http://stackoverflow.com/comment/44159923
type: QuestionComment
has text: Code injection is where you find an input on the page that normally just takes a number or a string, and stick some actual Javascript code in there. If it executes, hilarity ensues.
comment on: http://stackoverflow.com/q/27879131
score: 1
type: Comment

http://stackoverflow.com/comment/44192072
comment on: http://stackoverflow.com/q/27895544
type: QuestionComment
type: Comment
has text: You probably want something like `$(".parametersNumericbox:first input").focus();` to specify textbox within the **first** td.
score: 1

http://stackoverflow.com/q/27914976
has body: I want to disable the drop down options based on the condition. I want to disable all the other options except the option which has the text "Java". Ex: C# VB.NET jQuery Java In this case Only java option should be enable and others should be disable.
has comment: http://stackoverflow.com/comment/44229061
downvote count: 0
accepted answer: http://stackoverflow.com/a/27915024
has answer: http://stackoverflow.com/a/27915033
tagged with: jquery
has title: Disable the Drop down options
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/27915018
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27915018
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27915024
type: Question
has answer: http://stackoverflow.com/a/27915038
linked to: http://stackoverflow.com/q/7450370
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/27915140
tagged with: javascript

http://stackoverflow.com/comment/44304246
has text: Yes! Thank you. That might be the problem. Unfortunately, I'm using Java to write JavaScript and may be getting my syntax mixed up. I'll test that out.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27954557

http://stackoverflow.com/comment/44137784
has text: Note: you should use .on() instead of bind as of jQuery 1.7+
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27867577
score: 1

http://stackoverflow.com/comment/129694904
type: Comment
comment on: http://stackoverflow.com/a/50218084
has text: is this only work for android?
type: AnswerComment
score: 0

http://stackoverflow.com/q/27819756
has comment: http://stackoverflow.com/comment/44045596
tagged with: javascript
tagged with: jquery
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/27819899
has answer: http://stackoverflow.com/a/27819943
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44045190
downvote count: 0
has comment: http://stackoverflow.com/comment/44045426
favorite count: 0
possible better answer: http://stackoverflow.com/a/27819905
answer count: 5
has answer: http://stackoverflow.com/a/27819905
tagged with: php
has answer: http://stackoverflow.com/a/27820053
accepted answer: http://stackoverflow.com/a/27819899
has title: Validation not working for dynamically created values
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/65867744
type: Question
has comment: http://stackoverflow.com/comment/44045241
has body: I have created a form along with dynamically created form fields (name, age). While trying to validate my age field using javascript, only the first record of the age field is validating - the other ones aren't. The code is: function formValidator(){ var age = document.getElementById('age'); if(isNumeric(age, "Please enter a valid Age")){ return true; } return false; } function isNumeric(elem, helperMsg){ var numericExpression = /^[0-9]+$/; if(elem.value.match(numericExpression)){ return true; }else{ alert(helperMsg); elem.focus(); return false; } } HTML code is: < body> Name Age Only the first field is validating. How can I validate the dynamically generated fields?

http://stackoverflow.com/comment/44076067
type: QuestionComment
has text: In your sample the attribute is in no namespace, it is an attribute of an `a` element being in the XHTML namespace but the attribute itself is certainly in no namespace. So I don't understand why you say "The attribute ... must be in a [X]HTML namespace".
comment on: http://stackoverflow.com/q/27831795
score: 0
type: Comment

http://stackoverflow.com/a/27832149
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27832121
answers question: http://stackoverflow.com/q/27832121
score: 1
has body: There sure is, the original event contains information about the property being transitioned $('#menu-sets').on('transitionend', function(event) { if ( event.originalEvent.propertyName === 'left' ) { alert('done'); $('#menu-sets').off('transitionend'); } }); As one() only fires once, you'll have to use on() and unbind instead FIDDLE
has comment: http://stackoverflow.com/comment/44070154
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44070143

http://stackoverflow.com/a/27833301
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27833091
has body: Volar has a javascript API where you can listen to events. Add an ID in your iframe: and then include volarvideo.js in your page and call: var i = document.getElementById('my-video'); var v = new Volarvideo(); v.on('onComplete', function() { window.location.href = "<desired url>"; } v.connect(i); v.play();

http://stackoverflow.com/q/27905135
has title: Build.Phonegap Facebook SDK
tagged with: cordova
tagged with: phonegap-build
tagged with: facebook
has body: I am using the Build.Phonegap utility to zip up my HTML, CSS, &amp; JS in order to create an app on my Android phone. I know my code is fully correct as it renders no problem in my browser, but when I zip it up the JS doesn't render at all. My question is: Can Build.Phonegap render third party Javascript SDKs? i.e. Facebook I am attempting to use the Facebook JS SDK and do not wish at all to use the Facebook.Connect plugin for Phonegap. Please do not mix this up the Phonegap/Cordova platform. Thanks!
has answer: http://stackoverflow.com/a/27934109
type: AnsweredQuestion
type: Question
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27934109
tagged with: sdk

http://stackoverflow.com/q/27956789
has answer: http://stackoverflow.com/a/27956796
type: Question
tagged with: javascript
answer count: 2
has body: var fruit = {apple:"1", banana:"2"}; var w = "apple"; console.log(fruit.w); //this is problematic I am trying to use this logic in my code to display the value "1" in the console. This doesn't work. Intuitively, this makes sense, as console.log(fruit.w); is equivalent to console.log(fruit."apple");, which because of the quote symbols is non-sense. So how can I modify this code to work?
linked to: http://stackoverflow.com/q/20736758
downvote count: 0
has title: Using the value of a variable to access a property of an object
favorite count: 0
duplicate of: http://stackoverflow.com/q/20736758
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44308151
has answer: http://stackoverflow.com/a/27956800
score: 1
upvote count: 1

http://stackoverflow.com/comment/44086394
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27841362
has text: Two objects are only equal if they are the same object. Since in your case `otherArray` is not the same array as `myArray` they can't be equal.
score: 0

http://stackoverflow.com/comment/44248446
type: QuestionComment
has text: Well it's a question just out of curiosity .. I know it can easily be achieved by the use of JQuery.. Is it possible to achieve the same using only Javascript too?
comment on: http://stackoverflow.com/q/27925420
score: 0
type: Comment

http://stackoverflow.com/comment/44281035
type: QuestionComment
has text: Is this not what vanilla "Last-Modified" header based caching does?
comment on: http://stackoverflow.com/q/27942658
score: 0
type: Comment

angularjs-http
tags question: http://stackoverflow.com/q/27878430
tag name: angularjs-http
tags question: http://stackoverflow.com/q/27952049
type: Tag

http://stackoverflow.com/q/27937366
has comment: http://stackoverflow.com/comment/44271476
has title: How to print JSON from .getJSON
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/44271601
has comment: http://stackoverflow.com/comment/44271602
has comment: http://stackoverflow.com/comment/44272341
has comment: http://stackoverflow.com/comment/44283313
answer count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: I am totally new to jQuery and AJAX and I am having trouble viewing an AJAX call that I am making. The JSON response shows up in the browser when I make the call by typing it into the address bar but I'm having trouble viewing it using something like an alert. Is there a way to view everything that is coming back like some sort of print line command that I can use? I've been able to get this example to work var url = "https://graph.facebook.com/zombies"; $(document).ready(function(){ $.getJSON(url, function(results){ //alert("got here"); alert(results.about); }); }); The JSON file I am trying to return has file has many nested arrays and won't return anything into my alert box. (or I dont know how to make it return anything ) Thanks ahead of time for any help anyone can lend!!
type: Question
has comment: http://stackoverflow.com/comment/44272284
tagged with: javascript
score: 0

http://stackoverflow.com/comment/44178889
type: Comment
type: QuestionComment
score: 0
has text: @Billy it has to be a php function
comment on: http://stackoverflow.com/q/27888785

http://stackoverflow.com/a/27823096
answers question: http://stackoverflow.com/q/27823064
downvote count: 0
score: 4
has body: You need to give the reference to the search() function to the handler, not the result of the function. Remove the brackets after the search call: $('#search').click(search);
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27823064
type: Answer
upvote count: 4

http://stackoverflow.com/q/27840497
answer count: 2
has title: addClass and then removeClass the same class
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44084522
has body: $(".CSS3-Animation").addClass('on'); This apples a set of CSS3 animation lines to the .CSS3-Animation. Now what I'm trying to do is to remove this class name right after it's loaded. CSS: .CSS3-Animation.on{ animation:grow 0.5s both 0.3s } @keyframes grow{ 0%{transform:scale(.8);opacity:0} 100%{transform:scale(1);opacity:1} } I need to removeClass("on") after the animation is done so the following CSS will work: .CSS3-Animation{ transition-timing-function: ease-out; transition-duration: 250ms; } .CSS3-Animation:hover{ transform: scale(1.02) translate(0,2px); } Obviously the below doesn't work: $(".CSS3-Animation").addClass('on'); $(".CSS3-Animation").removeClass('on'); What are the ways to get around this? Thanks in advance.
tagged with: css
has comment: http://stackoverflow.com/comment/44084493
favorite count: 0
has comment: http://stackoverflow.com/comment/44084509
has comment: http://stackoverflow.com/comment/44084939
upvote count: 1
possible better answer: http://stackoverflow.com/a/27840585
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27840585
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27840596
has comment: http://stackoverflow.com/comment/44084584
has comment: http://stackoverflow.com/comment/44084583
has comment: http://stackoverflow.com/comment/44084510
accepted answer: http://stackoverflow.com/a/27840596

http://stackoverflow.com/a/27882929
answers question: http://stackoverflow.com/q/27882466
has comment: http://stackoverflow.com/comment/44176063
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44178719
has comment: http://stackoverflow.com/comment/44171952
type: Answer
has body: You can use a class for that, create a class with the properties you want, in your case .scrolled { height: 100px; width: 100px; } Then addClass, it accepts the other options you wanted, so you can if(this.scrollTop() &gt;= 300){ this.addClass('scrolled', 500, 'swing'); } if(this.scrollTop() &lt; 300){ this.removeClass('scrolled', 500, 'swing); }
accepted answer of: http://stackoverflow.com/q/27882466
score: 1
upvote count: 1

http://stackoverflow.com/q/27809591
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44028552
answer count: 0
has title: Div positioning calculation explanation required
has comment: http://stackoverflow.com/comment/44028493
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44028620
type: Question
has body: I have attached the screenshot below to explain what i am trying to do. The yellow highlighted line is the script which is run to get the position of the div (The red box in the picture). I have used this code to calculate the position. function getPosition(element) { var xPosition = 0; var yPosition = 0; var left = 0; var top = 0; var i = 0; while (element) { xPosition = (element.offsetLeft); yPosition = (element.offsetTop); console.log("TOP Pos: "+yPosition+"Left Pos: "+xPosition); if (i == 1) { left = xPosition; top = yPosition; } element = element.offsetParent; i++; } return { x: left, y: top }; } And here i have used this method function ReadDivPos(selector) { var _divPos = ""; var parentDoc = window; while (parentDoc !== parentDoc.parent) { parentDoc = parentDoc.parent; } parentDoc = parentDoc.document; var parentDiv = parentDoc.getElementsByTagName('div'); var divs = []; for (var i = 0; i &lt; parentDiv.length; i++) { if (parentDiv[i].className == "content") { var pos = getPosition(parentDiv[i]); var x = pos["x"]; var y = pos["y"]; console.log("Values+ Top: " + y + " Left: " + x); var w = parentDiv[i].offsetWidth; _divPos += x + "," + w + "," + y + "," + (x + w) + ","+window.screen.availWidth+"\\n"; } } console.log("Values+ x: " + _divPos); return _divPos; } Interestingly i am getting three values and on the second attempt i am getting the correct values. Here is the screenshot showing all the three values. The correct value is TOP Pos: 185Left Pos: 197 which i got it in the second attempt. Can anyone explain me why i did not get the correct values in the first attempt or is there any efficient way to get these values. I have to get the parent node because this was the only way to access the div class='content' as script is placed before the div content so i have to read the parent nodes and then i am able to access the required div. Please Note this is the copy of my original question(Div Positioning is calculated fine but need explanation how it is working)…
has comment: http://stackoverflow.com/comment/44029109
tagged with: javascript
linked to: http://stackoverflow.com/q/27790897
has comment: http://stackoverflow.com/comment/44028470
score: 0
has comment: http://stackoverflow.com/comment/44028698
tagged with: jquery

http://stackoverflow.com/comment/44032370
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27812152
has text: Those images aren't keyboard accessible (you can't focus and click them with a keyboard). You're better off wrapping the ` `s in ` `s and adding the click event listener to the buttons. http://www.w3.org/TR/UNDERSTANDING-WCAG20/keyboard-operation.html

http://stackoverflow.com/comment/44079458
type: QuestionComment
has text: @A.Wolff Have you seen the answers posted below? It works without having unique IDs.
comment on: http://stackoverflow.com/q/27837100
score: 0
type: Comment

http://stackoverflow.com/comment/44302726
score: 0
type: Comment
type: QuestionComment
has text: @Christos Hi, please check my post :)
comment on: http://stackoverflow.com/q/27953781

http://stackoverflow.com/comment/44241281
type: AnswerComment
comment on: http://stackoverflow.com/a/27921561
score: 0
type: Comment
has text: I do apologize for that I pressed the wrong edit link.

http://stackoverflow.com/comment/44032180
type: QuestionComment
comment on: http://stackoverflow.com/q/27812272
has text: @lemon your second sentence is irrelevant, have a look at http://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php
score: 0
type: Comment

http://stackoverflow.com/q/27901718
favorite count: 0
type: UnansweredQuestion
tagged with: momentjs
has comment: http://stackoverflow.com/comment/44209995
has comment: http://stackoverflow.com/comment/44203413
has comment: http://stackoverflow.com/comment/44204578
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/44204277
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44202901
has comment: http://stackoverflow.com/comment/44202843
downvote count: 0
tagged with: javascript
has title: JavaScript runtime error: Object doesn't support property or method error
tagged with: runtime-error
has comment: http://stackoverflow.com/comment/44210054
has body: Help would be much appreciated. When I run the below I get a: 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'Moment'. I get this in two parts of the code. The main bit that i'm concerned about is the isBefore line. As that's what I'm actually trying to do, so it's important. The other bit that (I get a similar error to the above) was added during efforts to figure out what the issue was, the "if (currrentTime.isValid)" check. Also, initially this was just "value.isBefore(currentTime)" but that didn't seem to work.. The javascript is an external script. Am I not importing moment correctly?? src = "moment.js"; var currentTime = moment().format('DD MMMM YYYY'); var format = function (index, data) { var value = data[index]; if (currentTime.isValid()) { if (index === 4 &amp;&amp; value.Moment().isBefore.format(currentTime)) { return 'In the past - ' + value; } alert("currentTime not valid...") } return value; } } )

http://stackoverflow.com/comment/44083014
type: AnswerComment
has text: You have to return `aggr`. At least you do if you are using native `Array#reduce`, don't know about Underscore.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27838474

mail-server
tags question: http://stackoverflow.com/q/27897112
type: Tag
tag name: mail-server

http://stackoverflow.com/a/34357124
has body: You can use external libraries like MediaUploader js file. See the following tutorial. It includes every functions such as Create folder, upload file, view images, view content image text, show share files only etc. Demo of using Google Drive API
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27953161

http://stackoverflow.com/a/27890893
answers question: http://stackoverflow.com/q/27889909
score: 0
has body: First of all, after the page is finished loading, you cannot fetch new stuff from the database and show it on your page (unless you use ajax), so this means that ALL of your rows of text should be loaded and stored somewhere beforehand. Or, you can use ajax to fetch some new text from the database each time. Both of these solutions would give 2 different types of strain upon your resources. I'll give you the non-ajax solution, but if you want to hear the ajax one, tell me, and I'll add it here as well. If you want a piece of your website to change upon a click, you can to use javascript to accomplish this. There is also a CSS-only solution based on the current state (selected or not selected) of the radio buttons, but this javascript was easier to write for me. ... so here you go. Solution without ajax, with javascript. &lt;?php $radio_button_div_text = ""; //makes a variable to store all the text to be displayed in section 1 $textarea_div_text = ""; //makes a variable to store all the text to be displayed in section 1 $list_of_all_ids_for_js_function = ""; //makes a variable to store something that will later be part of the javascript function $result = mysqli_query($con,"SELECT * FROM clanok ORDER BY nadpis"); while($row = mysqli_fetch_array($result)) { //while there are rows to get... //put the different buttons and textareas into two separate variables $radio_button_div_text += 'input type="radio" name="nadpis" value="'.$row['nadpis'].'" onclick="show_only_one_textarea('.$row['nadpis'].')"&gt;'; $radio_button_div_text += $row['nadpis']; $radio_button_div_text += '&lt;br&gt;'; $textarea_div_text += '&lt;textarea id='.$row['nadpis'].' name="text" cols="30" rows="5" style="display:none;"&gt;'; $textarea_div_text += $row['text']; $textarea_div_text += '&lt;/textarea&gt;'; $list_of_all_ids_for_js_function += 'document.getElementById(\''.$row['nadpis'].'\').style.display="none";' } //now, after you got all the info sorted, show the two areas! echo $radio_button_div_te…
type: Answer

http://stackoverflow.com/comment/44179157
type: QuestionComment
comment on: http://stackoverflow.com/q/27889079
score: 0
has text: Ahhh, guys, you are life savers. Thanks so much for your help and quick response. It is really appreciated. :)
type: Comment

http://stackoverflow.com/comment/44278112
type: Comment
has text: `if (true) return true else return false`, oh my. You could just write `return currentUserId === taskUserId`.
score: 0
comment on: http://stackoverflow.com/q/27940987
type: QuestionComment

http://stackoverflow.com/q/27926562
type: Question
has comment: http://stackoverflow.com/comment/106417167
has title: Deprecation of Javascript function unescape()
has comment: http://stackoverflow.com/comment/44250244
has comment: http://stackoverflow.com/comment/44250321
tagged with: javascript
has comment: http://stackoverflow.com/comment/44250663
has comment: http://stackoverflow.com/comment/137066937
has comment: http://stackoverflow.com/comment/44250189
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44250373
has comment: http://stackoverflow.com/comment/44250394
has answer: http://stackoverflow.com/a/27926636
favorite count: 0
score: 17
has comment: http://stackoverflow.com/comment/44250288
has comment: http://stackoverflow.com/comment/44250183
has comment: http://stackoverflow.com/comment/44250218
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44250424
linked to: http://stackoverflow.com/q/76092922
has comment: http://stackoverflow.com/comment/82710279
has comment: http://stackoverflow.com/comment/44250225
accepted answer: http://stackoverflow.com/a/27926636
has body: According to W3 Schools the unescape() JavaScript function has been deprecated. The site states, "The unescape() function was deprecated in JavaScript version 1.5. Use decodeURI() or decodeURIComponent() instead." Should I go through and replace all instances of unescape()? Is the deprecation of JavaScript functions something that web developers concern themselves with and actively update their JavaScript code? or can I expect that most browsers will support JavaScript 1.5 in the foreseeable future?
upvote count: 17

http://stackoverflow.com/comment/44027551
type: QuestionComment
type: Comment
has text: Also, validate functions just return true or false for the validation. Don't call `document.form.submit();` in the validate function. That will just make like an infinite loop I think, since `onsubmit' calls the validate function. If you return true in the validate function it will submit already, and if you return false it will not.
comment on: http://stackoverflow.com/q/27809142
score: 0

http://stackoverflow.com/q/27882654
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44167930
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/44167915
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27883216
accepted answer: http://stackoverflow.com/a/27883216
has comment: http://stackoverflow.com/comment/44167681
has title: How to create a link to sections on the same page
has comment: http://stackoverflow.com/comment/44167897
has body: I am stuck at moving to a section on the same page which in my case is the #iframe, located at the bottom of the page. $(document).ready(function() { $('#toggle_message').click(function() { var value = $('#toggle_message').attr('value'); $('#iframe').toggle('fast'); if (value == 'Vise Reserver Bord Her') { $('#toggle_message').attr('value', 'Skjule Reservation'); } else if (value == 'Skjule Reservation') { $('#toggle_message').attr('value', 'Vise Reserver Bord Her'); } }) $("#toggle-message").click(function() { window.location.hash = "#" + $(this).attr("#iframe"); }) }); images here text boxes
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44168106
has comment: http://stackoverflow.com/comment/44167959

http://stackoverflow.com/a/27820979
has body: Using Jquery you could wrap your link in a span with an ID and then get the value of that ID and push it into another span id. HTML link-text jQuery var span1val = $('#span1').html(); $('#span2').html(span1val); Example can be found here. http://jsfiddle.net/3en2Lgmu/5/
upvote count: 0
has comment: http://stackoverflow.com/comment/44091869
answers question: http://stackoverflow.com/q/27820682
has comment: http://stackoverflow.com/comment/44047693
score: -1
has comment: http://stackoverflow.com/comment/44047709
has comment: http://stackoverflow.com/comment/44047599
type: Answer
downvote count: 1

http://stackoverflow.com/comment/44063398
score: 0
comment on: http://stackoverflow.com/q/27828688
type: Comment
type: QuestionComment
has text: I know that I never stop but, why does it reach that much memory. I can stop it by calling `clearTimeout(call)`. But I'm trying to understand if I'm not filling up the callstack by using `setTimeout` and I'm only using 1 variable a. Unless it's the call variable?

http://stackoverflow.com/a/27953929
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27953872
has body: It's not animating. The two images were likely cached at different times by google and the image publisher changed the image in-between those times.

http://stackoverflow.com/a/27826432
has body: Try adding &amp;embedded=true to the end of your URL as stated here.
answers question: http://stackoverflow.com/q/27825039
accepted answer of: http://stackoverflow.com/q/27825039
has comment: http://stackoverflow.com/comment/44059639
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44061081
score: 3
upvote count: 3

http://stackoverflow.com/a/27805254
has comment: http://stackoverflow.com/comment/44019631
score: 0
has body: you had a "log" function or whatever i think you wanted to be "console.log" your code otherwise does what its supposed to do, but i think this is what you actually want it to do: http://jsfiddle.net/swm53ran/27/ var matrix = []; createGrid(); function createGrid () { for(var i=0; i &lt; 6; i++) { matrix[i] = []; for(var j=0; j &lt; 6; j++) { console.log("["+i+"]["+j+"]"); var $span = "&lt;span&gt;["+i+"]["+j+"]&lt;/span&gt;&lt;br/&gt;"; $("#myGrid").append($span); } } }
upvote count: 1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27805018

http://stackoverflow.com/comment/131640204
comment on: http://stackoverflow.com/a/47446965
type: AnswerComment
score: 0
type: Comment
has text: Works like a charm. Customize error response (Send a custom error response instead of the error received from the origin. ) Select Yes, and provide the above said path and response code.

http://stackoverflow.com/comment/44094321
score: 0
type: AnswerComment
type: Comment
has text: So this is a dumb question (as I'm still learning the ropes on Polymer) - Does putting a template in the middle of an otherwise "normal" html page cause any problems?
comment on: http://stackoverflow.com/a/27833575

http://stackoverflow.com/q/27804441
has answer: http://stackoverflow.com/a/27806285
upvote count: 3
has body: I am attempting to push data into a nested array inside of a Mongo collection. I've followed along the Mongo documentation here, http://docs.mongodb.org/manual/reference/operator/update/positional/, but have not had any luck pushing into the array. No errors or exceptions are thrown and the syntax looks right... In this example, I'm attempting to update the buyer.boards titled 'Board One' by pushing a new string into it's idArr array. Is there something wrong with my query? Mongo Collection // User Document from Meteor.users Collection: { _id: 'userIdqwerty', buyer: { boards: [ { title: 'Board One', idArr: ['id123', 'id456', 'id678'] }, { title: 'Board Two', idArr: ['idABC'] }, { title: 'Board Three', idArr: ['id12345678', 'idqwertyuu'] }, ] }; } Javascript var options = { boardTitle: 'Board One', newId: 'idZjodFsp', userId: 'userIdqwerty' }; Meteor.users.update( { _id:options.userId, 'buyer.boards.$.title':options.boardTitle }, { $push: { 'buyer.boards.$.idArr':options.newId } } );
type: AnsweredQuestion
score: 3
tagged with: database
accepted answer: http://stackoverflow.com/a/27806285
type: Question
tagged with: mongodb
answer count: 1
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: MongoDB & Meteor - Query to push into nested array does not work, no error thrown
tagged with: meteor
favorite count: 0

http://stackoverflow.com/comment/44224364
has text: Related question, may help: http://stackoverflow.com/questions/14446511/what-is-the-most-efficient-method-to-groupby-on-a-javascript-array-of-objects
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27912417
score: 2

http://stackoverflow.com/comment/44225577
comment on: http://stackoverflow.com/q/27912428
score: 0
type: QuestionComment
has text: Try a different event. add ` Click ` then try rewrite your event `'click .click-me': function (event) { console.log('the event happened!') }` Because everything looks fine to me except choosing the wrong element for your submit event
type: Comment

http://stackoverflow.com/a/28347422
has comment: http://stackoverflow.com/comment/45042936
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45042540
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45042578
has comment: http://stackoverflow.com/comment/45043178
has comment: http://stackoverflow.com/comment/45042720
has comment: http://stackoverflow.com/comment/45042503
has comment: http://stackoverflow.com/comment/45042866
answers question: http://stackoverflow.com/q/27872279
has body: None of the previous answers, not even that serial-upvoted one ;), actually explains the problem and why their solutions work. The problem is that an inline onclick handler does not pass on its current context. Inside the onclick="" JavaScript code this is the element clicked. Once you call a global function (like your toggleTip), that context is lost. The this the function receives is window and not the element. The usual quick fix, for raw JavaScript code, is to pass this as a parameter to the global function. e.g. onclick="toggleTip(this)" and receive a parameter in the function like this: function toggleTip(element) { $(element).siblings(".tip-content").toggleClass("hidden"); } However, as you are using jQuery, inline event handlers are actually a bad idea. They separate the event registration from the event handler code for no reason and do not allow for multiple event handlers, of the same type, on the same element. They also bypass the rather cool event bubbling system jQuery uses. The preferred alternative, with jQuery, is to use jQuery to select the element and jQuery to connect the event in one step: jQuery(function($){ $('.tip-title').click(function(){ $(this).siblings(".tip-content").toggleClass("hidden"); }); }); As you only want the element that follows, and potentially will add more pairs, the better option would be using nextAll and first(), with the same jQuery filter, instead of siblings: e.g. jQuery(function($){ $('.tip-title').click(function(){ $(this).nextAll(".tip-content").first().toggleClass("hidden"); }); }); Or, of you can guarantee it is the next element, use next as @Tim Vermaelen did (with or without the selector makes no difference, so might as well leave it out): jQuery(function($){ $('.tip-title').click(function(){ $(this).next().toggleClass("hidden"); }); }); Note: In this example jQuery(function($){ is a DOM ready event handler which is the rather handy shortcut version of $(document).ready(function(){YOUR CODE});, which also passes…

http://stackoverflow.com/comment/44209056
type: Comment
comment on: http://stackoverflow.com/a/27837544
has text: Well... doesn't cover 100% of the cases, but I guess it will have to do. (Doesn't work if you click the button, hold the mouse bttn down, and release it somewhere else, not over the button)
score: 0
type: AnswerComment

http://stackoverflow.com/a/31886195
upvote count: 1
answers question: http://stackoverflow.com/q/27860884
score: 1
downvote count: 0
has body: Because has a different domain and security restrictions must enable CORS in the Server to make HTTP requests.
type: Answer

http://stackoverflow.com/comment/44227875
comment on: http://stackoverflow.com/q/27914209
has text: just post full code, as you have mentioned in comments at answer, writing to file is a `async` task if you are not using a `sync` function. That's why you are facing strange behaviour.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44293915
type: Comment
comment on: http://stackoverflow.com/a/27949393
type: AnswerComment
has text: It certainly was from the first line, i had to read it twice haha
score: 0

http://stackoverflow.com/comment/44135988
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27866666
has text: @Byc You could call a JavaScript from the Code behind when the blick button has been finished.

http://stackoverflow.com/a/27879844
answers question: http://stackoverflow.com/q/27879505
type: Answer
accepted answer of: http://stackoverflow.com/q/27879505
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
has body: Try this, angular.module('myApp').directive('mobileScreenSwitcher', function ($window, snapRemote) { return { restrict: 'E', link: function (scope) { snapRemote.getSnapper().then(function(snapper) { function onResizeCallback() { var screenWidth = $window.innerWidth; if (screenWidth &gt;= 768) { snapper.close(); snapper.disable(); } else { snapper.enable(); } } $window.addEventListener('resize', onResizeCallback); onResizeCallback(); }); scope.$on('$destroy', function () { $window.removeEventListener('resize' onResizeCallback); }); } }; }); The following approach has worked for me before: .run(function ($rootScope, snapRemote) { snapRemote.getSnapper().then(function(snapper) { function onResizeCallback() { if (window.innerWidth &lt;= 1024) { snapper.enable(); } else { snapper.close(); snapper.disable(); } } onResizeCallback(); $(window).resize(onResizeCallback); }); });

http://stackoverflow.com/q/27883618
has answer: http://stackoverflow.com/a/27883766
type: UnansweredQuestion
tagged with: jquery-1.9
has comment: http://stackoverflow.com/comment/44169070
has body: I'm having a multi-step form functionality. Following is the code for it. I tried to create a jsFiddle for this code but it was not saving there in fiddle and I was not able to create it. If you just make a HTML file on your system and copy paste the whole code it will run in any browser without making any change. Multi Step Form with Progress Bar using jQuery, CSS3 and PHP - InfoTuts Account Setup Social Profiles Personal Details Create your account This is step 1 Social Profiles Your presence on the social network Personal Details We will never sell it Currently error messages are shown one by one when user clicks on "Next" button, but I want to show all the three error messages together when user doesn't enter any data into the fields viz. Email, First Name and Last Name. Currently I'm able to show the error messages one by one. I don't want to do that any more, I want to show all the applicable error messages together when user clicks on "Next" button. How should I do this? Please help me. Once again apologies for not able to create a js fiddle. Thanks.
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44169034
score: 0
tagged with: validation
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How to show all the applicable error messages on top of a form instead of showing the error messages one by one?

http://stackoverflow.com/comment/44119823
comment on: http://stackoverflow.com/q/27856238
score: 0
has text: @cari just tried, still the same.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27839304
has comment: http://stackoverflow.com/comment/44082376
type: Answer
upvote count: 2
has body: You mean this? if(intvalue &gt; 0.5){ intvalue = 1; } if intvalue is greater than 0.5, then intvalue is 1.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27839272

http://stackoverflow.com/q/27931495
tagged with: javascript
tagged with: express
type: Question
has title: Node.js/Socket.io realtime webpage push updates
has answer: http://stackoverflow.com/a/27931615
score: 0
has body: I am looking to implement/add realtime push notification updates from node.js server to browser (client). I looked into socket.io (http://socket.io/docs/rooms-and-namespaces/) business requirement is - users will visit a page displaying customer info &amp; their orders. There will be ~10,000 users visiting the page at any given time (all 10,000 could be for different customers or sometimes a user may have opened the same page in 2 or 3 tabs) When orders flow in to elasticsearch for a customer (my datastore) i want to push notification to users who have that customer's page opened. Questions: Is socket.io the correct framework for this case? Am I correct in understanding I have to use socket.io' rooms functionality to implement this? (each room identifier equals customer ID?) Is this implementation scalable and would it be memory intensive for 10k users on node.js server? Thanks!
accepted answer: http://stackoverflow.com/a/27931615
answer count: 1
tagged with: node.js
has comment: http://stackoverflow.com/comment/44260586
tagged with: socket.io
type: AnsweredQuestion

http://stackoverflow.com/q/27925493
tagged with: pagination
type: Question
has answer: http://stackoverflow.com/a/27925582
tagged with: javascript
tagged with: jquery
has title: How to write content inside all div under a parent div?
has answer: http://stackoverflow.com/a/27925620
has comment: http://stackoverflow.com/comment/44248046
has answer: http://stackoverflow.com/a/27925613
score: 0
possible better answer: http://stackoverflow.com/a/27925582
has answer: http://stackoverflow.com/a/27925645
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44248001
answer count: 7
has comment: http://stackoverflow.com/comment/44248010
has answer: http://stackoverflow.com/a/27925811
has answer: http://stackoverflow.com/a/27925882
type: AnsweredQuestion
has body: I am planning to write pagination manually for a slider. Now this pagination is printing like this now its printing empty pagination. I want to write content in all div under the div having class-name=tp-bullets simplebullets custom using javascript someone please help me to do this. I am very basic about js.
accepted answer: http://stackoverflow.com/a/27925645
has answer: http://stackoverflow.com/a/27925688

http://stackoverflow.com/q/27842832
downvote count: 1
has title: JavaScript ignores appendChild in 2nd and 4th loop
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44089833
score: 0
type: AnsweredQuestion
has body: Here's the fiddle that successfully does what I am trying to do: http://jsfiddle.net/WoofurrBro/qcf4qcm6/2/ And here is my setup that's not working. function align() { var x = document.getElementById('container').offsetWidth; var y = document.getElementsByClassName('box')[0].offsetWidth; var z = Math.floor(x / y); // finds # of columns for (var i = 0; i < z; i++) { document.getElementById('container').innerHTML += ' '; }; // creates columns var columns = document.getElementsByClassName('col'); var boxes = document.getElementsByClassName('box'); // variables for later use /////////////////////////////////////////////////////////////////////////////// for (var i = 0; i < boxes.length; i++) { var minIndex; var column = []; // minIndex = shortest column, column[] to sort NodeList for (var iii = 0; iii < columns.length; iii++) { column[iii] = columns[iii].clientHeight; }; // converts columns[] (NodeList) to column[] (Array) column.sort(function (a, b) { return a - b; }); // sorts the column[] array for (var ii = 0; ii < columns.length; ii++) { if (column[0] == columns[ii].clientHeight) { minIndex = ii; break; }; }; // picks the first item in the column[] array (shortest) and finds the index of it in columns[] NodeList boxes[i].style.visibility = 'visible'; //ALSO, placing this under the appendChild string causes weird bugs (?) boxes[i].innerHTML += i + 'h'; columns[minIndex].appendChild(boxes[i]); // !!!!!!!!!!!!!! SEEMS TO IGNORE THIS appendChild //places them and adds identification }; /////////////////////////////////////////////////////////////////////////////// }; window.onload = align; * { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor:default; margin:0px; padding:0px; } html { background-color:#20293F; } #title { text-align:center; padding-top:40px; font-size:60px; margin-bottom:10px; } #description { font-size:14px; text-align:center; margin:0 auto 30px aut…
has comment: http://stackoverflow.com/comment/44090652
has comment: http://stackoverflow.com/comment/44090001
type: Question
has answer: http://stackoverflow.com/a/27843629
accepted answer: http://stackoverflow.com/a/27843629
has comment: http://stackoverflow.com/comment/44090163
tagged with: appendchild
has comment: http://stackoverflow.com/comment/44089913
tagged with: dom
has comment: http://stackoverflow.com/comment/44090604
upvote count: 1

http://stackoverflow.com/q/27930094
upvote count: 2
tagged with: php
downvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44260165
has answer: http://stackoverflow.com/a/27931092
type: Question
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
has body: My form uploads multiple text fields and a file to a php script to save the file and save the text fields to a sql db. that is working, my php script ends with ('state' =&gt; 200, "success" =&gt; true, "id" =&gt; $_POST['id'], "titlea" =&gt; $_POST['title'], "addressa" =&gt; $_POST['address'], "lot_sizea" =&gt; $_POST['lot_size'], "zoninga" =&gt; $_POST['zoning'], "build_sizea" =&gt; $_POST['build_size'], "sale_pricea" =&gt; $_POST['sale_price'], "lease_pricea" =&gt; $_POST['lease_price'], "commenta" =&gt; $_POST['comment'], "transactiona" =&gt; $_POST['transaction'], "ad_linka" =&gt; $ad_link, ); exit(json_encode($response)); which is returning a json encoded response. However the return is staying on the php page and not coming back to the page with the ajax request on it. Here is my ajax script: $("document").ready(function() { $(".data-form").submit(function() { var formData = new FormData($('form')[0]); if (confirm("\t\t\tAre you ready to sumbmit this listing?\nYou can always edit the listing after going to the menu tab - edit listing.")) { $.ajax({ type: "POST", dataType: "json", url: "add-list.php", data: formData, success: function(response) { if (response.success) { $("#modal1").modal('hide'); $("#add_frame").show(); $("#newbutt").show(); $(".atitle").html('&lt;a href="' + response.ad_linka + '" target="_blank"&gt;' + response.titlea + '&lt;/a&gt;'); $(".acomment").html(response.commenta); $(".aaddress").html(response.addressa); $(".asale-price").html(response.sale_pricea); $(".alease-price").html(response.lease_pricea); $(".alot-size").html(response.lot_sizea); $(".abuilding-size").html(response.build_sizea); $(".azoning").html(response.zoninga); } else { console.log("An error has ocurred: sentence: " + response.sentence + "error: " + response.error); } }, error: function() { alert("An Error has ocurred contacting the server. Please contact your system administrator"); } }); return false; } }); }); How can I change this so I can get the page back and allow…
accepted answer: http://stackoverflow.com/a/27931092
has title: jquery ajax request not returning to page

http://stackoverflow.com/comment/44042601
score: 0
type: Comment
has text: `" " & Request.QueryString("id") & "'>"` is giving syntax error as `;` expected
comment on: http://stackoverflow.com/a/27818205
type: AnswerComment

http://stackoverflow.com/q/27883455
has title: In d3.js, how can I check if an element has been removed without doing a new selection?
has comment: http://stackoverflow.com/comment/44169701
has comment: http://stackoverflow.com/comment/44172560
upvote count: 5
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/44178991
score: 5
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44181588
has body: I am using a d3 timer to animate an element, and I want the timer to stop when the element has been removed. What is a simple way of doing that? Here's a JS fiddle to illustrate my issue. What should I replace this line with? if (rect.empty()) { I realize I can get it to work by changing it into this: if (d3.select("rect").empty()) { However, doing a new D3 selection based on element names or classes is a problem if I have a lot of rect elements or reuse the same classes a lot. Is it possible to simply refresh an existing D3 selection to see if it has become empty?
answer count: 1
has answer: http://stackoverflow.com/a/40466236
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/comment/44311749
score: 0
type: Comment
has text: I have anchors on both sides, just like your regex. PS: This doesn't match my conditions, in fact it doesn't match any digits. Is there a typo?
comment on: http://stackoverflow.com/a/27958840
type: AnswerComment

http://stackoverflow.com/a/27937712
has comment: http://stackoverflow.com/comment/44272962
has comment: http://stackoverflow.com/comment/44272311
downvote count: 0
has comment: http://stackoverflow.com/comment/44314143
score: 1
has comment: http://stackoverflow.com/comment/44272488
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27936575
accepted answer of: http://stackoverflow.com/q/27936575
has comment: http://stackoverflow.com/comment/44310882
has body: You can simply increase the height of the highcharts and set backgroundColor of tooltip as transparent. Fiddle: http://jsfiddle.net/4mznaybs/11/ chart: { type: 'column', height : 300 }, tooltip: { borderWidth: 0, backgroundColor: "rgba(255,255,255,0)", borderRadius: 05, shadow: false, useHTML: true, percentageDecimals: 2, backgroundColor: "rgba(255,255,255,1)", formatter: function () { return '&lt;b&gt;' + this.x + '&lt;/b&gt;&lt;br/&gt;' + this.series.name + ': ' + this.y + '&lt;br/&gt;' + 'Total: ' + this.point.stackTotal; }, }, And CSS as: .label { z-index: 1 !important; } .highcharts-tooltip span { background-color:white; border:1px solid green; opacity:1; z-index:9999 !important; } .tooltip { padding:5px; }
has comment: http://stackoverflow.com/comment/44274551
type: Answer

http://stackoverflow.com/comment/46513253
type: QuestionComment
comment on: http://stackoverflow.com/q/27818936
score: 1
has text: In my experience, once you stick a NaN in an SVG attribute, all bets are off about the rest of the rendering. Could you post just a small snippet of the code that sets the translate on that inner `<g>`? It looks like you have a race condition there, and I've dealt with stuff like that in the past.
type: Comment

http://stackoverflow.com/q/27891225
has answer: http://stackoverflow.com/a/27891262
accepted answer: http://stackoverflow.com/a/27891262
tagged with: d3.js
type: AnsweredQuestion
type: Question
has title: Issue trying to build error chart in D3
has body: I'm attempting to build an error chart using D3 that looks like this: The issue I'm having is that maximum error square (the square at the top) isn't showing up. Here's what I have so far: var m = { top: 10, right: 10, bottom: 10, left: 10 } var h = 400 - m.top - m.bottom; var w = 500 - m.left - m.right; var r = 5; var data = [ { x: 0, y: 12, yMin: 10, yMax: 20 }, { x: 1, y: 25, yMin: 17, yMax: 30 }, { x: 2, y: 15, yMin: 12, yMax: 17 }, { x: 3, y: 10, yMin: 5, yMax: 14 }, { x: 4, y: 5, yMin: 1, yMax: 6 } ] var xScale = d3.scale.linear() .domain([0, d3.max(data, function(d) { return d.x } )]) .range([0, w]); var yScale = d3.scale.linear() .domain([0, d3.max(data, function(d) { return d.yMax } )]) .range([h, 0]); var vis = d3.select('body').append('svg') .attr({ height : h + m.top + m.bottom, width : w + m.left + m.right, }) .append('g') .attr({ transform : 'translate(' + m.left + ',' + m.top + ')' }) var scatterPlot = vis.selectAll('rect') .data(data) .enter() .append('rect') .attr({ x : function(d) { return xScale(d.x) - r; }, y : function(d) { return yScale(d.y); }, width : r * 2, height : r }); var errorMin = vis.selectAll('circle') .data(data) .enter() .append('circle') .attr({ cx : function(d) { return xScale(d.x); }, cy : function(d) { return yScale(d.yMin); }, r : r }); var errorMax = vis.selectAll('rect') .data(data) .enter() .append('rect') .attr({ x : function(d) { return xScale(d.x) - r; }, y : function(d) { return yScale(d.yMax); }, width : r * 2, height : r * 2 }); And here is a working example: http://jsfiddle.net/du37ep71/2/ I am pretty sure that when I do var errorMax = vis.selectAll('square') at the end of my code it's telling D3 to select the existing squares rather than appending new ones, and I'm sure there's a way to just append new squares, I've just been unable to figure out how.
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/27821549
upvote count: 0
score: -1
has body: { "responseCode": 200, "responseMessage": "COMPLETE", "responseData": "95W_RTXszAuuwsLxp8pA56UJQhMfNSVRQ-6OWd_f5-4tvBHp9WI4UgPBfop2AWPBY7xCI0QQcb2QwKuCRhSNdzbGOHlNL_Oectcb4xeUV_-cN8mqPo5iVyqXn_QtOtpn9GxlocFyLmXsjOKQgd5W_HsrmIwwldEwKLlcAzDTy9MIVSiZ3O97YXAzVZleV_yM0V4IqEd68wK3xGamCf05d_e4W-pnc56y3MSXRpu9op3Km0IdQAXj6gqeYCXe-AoZhj_OSP4pHpRJipixFpQGxWsSK2fhvZmdoNGxQRKtZGBzgJ9blCRFmNteio9_GbhOMXL6ySnSRbtSZ_RfBsjMu2m1MKWb0YOwQyOrIjKpQ3KOnXNCc0j54nF24YRmdFMZXbPktzrU90Y3HpzuX1xAZM0oAoUOm2xiJii1CJmH9YCOq3vR_eFneBFXFrOVCz29YKOkE4hlRHLlYxwgmWh91BFney0QIF9f9lyjHLTN958murr8dm6cS4BHSqWzeCrS86QuU4j7Zpgz6_jZUP-jK9Damjph2ZYJsIw5YHG_1dXRqse1RwbPYzP5xjADqgDVZm4IJfOwSiaYsuXtmm0hBj9fCj4DTVjVptnoYcv8Z649TquOYgbs-58st_bycROo9i1erwLz_nDdjIlQKPfz64a5UA", "responseVersion": 3 }
downvote count: 1
answers question: http://stackoverflow.com/q/27821400
type: Answer

http://stackoverflow.com/q/27850355
tagged with: javascript
has comment: http://stackoverflow.com/comment/44104984
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44105506
has comment: http://stackoverflow.com/comment/44104789
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27850401
accepted answer: http://stackoverflow.com/a/27850401
type: Question
has title: How do I match parentheses arguments with regex?
has body: How do I match this: foo(bar,baz) getting bar,baz as the match with regex in javascript? This is the regular expression: ([A-z]+([A-z,]+))

http://stackoverflow.com/comment/44135768
type: Comment
has text: Thanks guys for all of your comments - this works and answers a couple of other questions I had as well! Thanks!
comment on: http://stackoverflow.com/a/27865564
type: AnswerComment
score: 0

http://stackoverflow.com/a/27925934
score: 0
answers question: http://stackoverflow.com/q/27817806
type: Answer
has body: And here another solution: &lt;script type="text/javascript"&gt; $(function () { $.widget("custom.TFOiconSelectImg", $.ui.selectmenu, { _renderItem: function (ul, item) { var li = $("&lt;li&gt;", { html: item.element.html() }); var attr = item.element.attr("data-style"); if (typeof attr !== typeof undefined &amp;&amp; attr !== false) { $("&lt;span&gt;", { style: item.element.attr("data-style"), "class": "ui-icon TFOOptlstFiltreImg" }).appendTo(li); } return li.appendTo(ul); } }); $("#people") .TFOiconSelectImg({ create: function (event, ui) { var widget = $(this).TFOiconSelectImg("widget"); $span = $('&lt;span id="' + this.id + 'ImgSelected" class="TFOSizeImgSelected"&gt; ').html("&amp;nbsp;").appendTo(widget); $span.attr("style", $(this).children(":first").data("style")); }, change: function (event, ui) { $("#" + this.id + 'ImgSelected').attr("style", ui.item.element.data("style")); } }).TFOiconSelectImg("menuWidget").addClass("ui-menu-icons customicons"); }); &lt;/script&gt; &lt;select name="people" id="people" class="TFOlstFiltreImg"&gt; &lt;option value="" data-style="background-image: url(&amp;apos;/Images/vide.png&amp;apos;);" selected="selected"&gt;TOUS&lt;/option&gt; &lt;option value="" data-style="background-image: url(&amp;apos;/Images/vide.png&amp;apos;);"&gt;SANS&lt;/option&gt; &lt;option value="/Images/imgres.jpg" data-style="background-image: url(&amp;apos;/Images/imgres.jpg&amp;apos;);"&gt;&amp;nbsp;&lt;/option&gt; &lt;option value="/Images/imgres.png" data-style="background-image: url(&amp;apos;/Images/imgres.png&amp;apos;);"&gt;&amp;nbsp;&lt;/option&gt; &lt;/select&gt; And the associated CSS .ui-widget { font-size: 1em; } .ui-widget-content { border-style: none; } /*Affichage des options*/ .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item { padding: 0.5em 0 0.5em 2.1em; background-repeat: no-repeat; } /*Agrandir sinon 16px par defaut*/ .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item .ui-icon { height: 24px; width: 24px; top: 0.1em; } .TF…

http://stackoverflow.com/a/66842459
score: 0
answers question: http://stackoverflow.com/q/27901443
has body: Just write String(&lt;put here your data&gt;)
type: Answer

jquery-tabs
tags question: http://stackoverflow.com/q/27822075
tag name: jquery-tabs
type: Tag

http://stackoverflow.com/q/27833780
accepted answer: http://stackoverflow.com/a/27833839
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27833864
tagged with: checkbox
has title: function only works one time
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44073245
has comment: http://stackoverflow.com/comment/44073008
type: Question
has answer: http://stackoverflow.com/a/27833864
tagged with: javascript
score: 0
answer count: 2
has body: This is my first question on here. I use this site all of the time, but have never posted on here. When I call the function writeMessage(), when the checkbox is checked, the textarea is created. When I uncheck the checkbox, the textarea is removed. When I check the checkbox the second time, the function is not called. Any suggestions? I need for it to show the textarea any time the checkbox is checked, not just the first time around. Below is my code. HTML: Gift for someone javascript function: function writeMessage() { var x = document.getElementById('spaceForMsg'); var docBody = document.getElementById('parent'); var element = document.createElement('textarea'); element.cols='60'; element.rows='8'; element.id = 'msgArea'; if (x.checked) { give = 'Type your gift message here: '; docBody.appendChild(element); } else { give = ''; y = document.getElementById('parent').parentNode; y.removeChild(y.childNodes[0]); } document.getElementById('printMsg').innerHTML = give; }
has answer: http://stackoverflow.com/a/27833839

http://stackoverflow.com/a/54079071
upvote count: 3
has body: I know there is already an answer to this, but as of today, I found a way to increase the buffer on dgram from the official documentation: official doc. socket.setRecvBufferSize(size); Added in: v8.7.0 size &lt;integer&gt; Sets the SO_RCVBUF socket option. Sets the maximum socket receive buffer in bytes. socket.setSendBufferSize(size) Added in: v8.7.0 size &lt;integer&gt; Sets the SO_SNDBUF socket option. Sets the maximum socket send buffer in bytes. Usage example: var socket = dgram.createSocket('udp4'); socket.on("listening", () =&gt; { socket.setRecvBufferSize(100000000); // 100mb socket.setSendBufferSize(100000000); // 100mb }); The default value is 65507
downvote count: 0
answers question: http://stackoverflow.com/q/27867428
type: Answer
has comment: http://stackoverflow.com/comment/99602190
score: 3
has comment: http://stackoverflow.com/comment/103403713

http://stackoverflow.com/q/27840557
upvote count: 2
has body: I'am running code in 5th lesson of javascript codecadamy.It is related to prompt and if/else so i'm a java developer, it seems like my code is all correct but it gives the error Oops, try again. Did you add an if statement to your code? instruction to tutorial is as follows: Now you have to create different scenarios. Good thing we know how to do that using if / else statements. If userAnswer is "yes", print out: "You and Bieber start racing. It's neck and neck! You win by a shoelace!" Otherwise, print out: "Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'" Remember: = is for assignment, and === is to check if things are equal! my code is var userAnswer = prompt("Do you want to race Bieber on stage?"); if (userAnswer === "yes") { console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!"); } else { console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'"); }
downvote count: 2
has answer: http://stackoverflow.com/a/38592891
type: Question
has comment: http://stackoverflow.com/comment/44084972
has comment: http://stackoverflow.com/comment/44085723
has answer: http://stackoverflow.com/a/34740764
has answer: http://stackoverflow.com/a/27841183
has comment: http://stackoverflow.com/comment/44085394
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27840597
has comment: http://stackoverflow.com/comment/44085016
favorite count: 0
has comment: http://stackoverflow.com/comment/44084993
type: UnansweredQuestion
has title: javascript if/else not working
has comment: http://stackoverflow.com/comment/44084934
answer count: 4

http://stackoverflow.com/a/27880406
type: Answer
has body: The ReadOnly state of your ASP.NET control is handled on the server. So your JS code has no ability to directly affect it. Changing ReadOnly to False, then, typically happens on the server via a postback. There may be some way to do it via a [WebMethod] in your code behind, but I'm not sure if that'll properly influence the ViewState or not.
score: 0
answers question: http://stackoverflow.com/q/27880174

http://stackoverflow.com/q/27962996
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/70681132
type: Question
tagged with: javascript
has body: I have recently started a small project that involves drawing transport scheme on top of the Leaflet map. I've got a collection (array) of points denoting stops, each having an attribute location (LatLng). How can I place them on the map without using native markers but using SVG layer with paths &amp; circles instead and guaranteeing the correct geographical placement of elements on every dragging or zooming of the map? So far, I've thought of: Using the SVG overlay provided by Leaflet inside the overlay pane on the map. The problem with this approach is that I have a feeling it was designed specifically for native elements like markers, polylines, etc, but not for custom SVG elements (I haven't found much info on that). And besides, every time I zoom the map in &amp; out, its elements' coordinates don't seem consistent &amp; different all the time. Appending an SVG overlay into the map container on top of the map panes. That seems fine and you may be sure Leaflet doesn't 'corrupt' your overlay in any way, until you find out that the SVG is not draggable. Which seems to have 2 solutions: 2.1. Assigning the map container's transform traslate3d value to the overlay. This seems to work &amp; does its job simultaneously displacing both map tile layer &amp; the overlay creating illusion as if they are bound together. Each point now has constant position on the SVG, as long as the map is not zoomed, which equals its projected position onto the container minus the difference between the container's &amp; the overlay's top-left corners. So assuming the overlay should fit all the points &amp; the user is shown the centre of the map, the SVG should start beyond the screen thus having negative values of x &amp; y attributes' or left &amp; top CSS properties. Actually, none of it seems to work correctly as the map is either zero size or the size that only fits the very few points in the top-left corner (which is outside the original viewport). 2.2. Creating a large SVG overlay…
upvote count: 1
has comment: http://stackoverflow.com/comment/57278697
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44320998
tagged with: css
has title: How can I make a custom SVG overlay on Leaflet without using D3?
tagged with: geo
tagged with: leaflet
has comment: http://stackoverflow.com/comment/44321714

http://stackoverflow.com/comment/44259801
type: QuestionComment
score: 5
comment on: http://stackoverflow.com/q/27931162
type: Comment
has text: Step one: `Array` should be used only as an array. Not an object or "associative array". If you want an associative array use an object: `arrSummat = {}; arrSummat["987"] = "Boat";`

http://stackoverflow.com/comment/44107170
type: Comment
score: 0
type: AnswerComment
has text: Sorry for not being precise on what I want in the question, I want an alternative solution to solve it without using the jQuery key **cancel**. I have actually used cancel in the beginning, but it stops allowing user to tab into the "li"s when I used that option.
comment on: http://stackoverflow.com/a/27850761

http://stackoverflow.com/comment/44201686
comment on: http://stackoverflow.com/a/27894053
type: Comment
has text: no, as you can see on image i.stack.imgur.com/haTkH.png, I can draw line on google map, but now I want to draw the same line with same coordinates on html5 canvas ... so html5 canvas is problem, not google map api, google map is here just as example how need to looks like on canvas
score: 1
type: AnswerComment

http://stackoverflow.com/q/27929195
type: Question
has comment: http://stackoverflow.com/comment/44255849
has comment: http://stackoverflow.com/comment/44255642
has comment: http://stackoverflow.com/comment/44256415
has comment: http://stackoverflow.com/comment/44257428
tagged with: javascript
has body: I've successfully minified a large angular application, but there is one angular file that is not working when it is included. It happens to be the app.js file. The strange part is that all the annotations look correct, and most of them look like they wouldn't cause a problem anyway. But the result of minifying them is a blank screen with no error (presumably ng isn't executed somehow). The code in app.js has no controllers only .config, .run, .factory, .constant. I've searched all documentation and still have this question: Do constants require annotation to be minified? If so there is no indication here: https://docs.angularjs.org/api/auto/service/$provide?PHPSESSID=cae8e98e7ca559b4605d75c813b358ee Also - Would run and config blocks cause minify to fail in any way that you know? What should I be looking for as a problem for the minification - blank screen no error behavior? The code is formatted like this: window.app = angular.module('ds.example', ['a','b','c']) .constant('_', window._ ) .factory('name', ['a','b','c', function (a,b,c) { }]) .config(['a','b','c', function (a,b,c) { }]) .run(['a','b','c', function (a,b,c) { }]) .config(['a','b','c', function (a,b,c) { ]); Do you see anything there that would cause minification to go blank? UPDATE: putting annotation around the constant had no effect: .constant('', [window.] )
has comment: http://stackoverflow.com/comment/44258517
has comment: http://stackoverflow.com/comment/44255897
has comment: http://stackoverflow.com/comment/44255574
has comment: http://stackoverflow.com/comment/44255662
has comment: http://stackoverflow.com/comment/44256703
has comment: http://stackoverflow.com/comment/44255822
has title: AngularJS Minification of .config, .run, .factory, .constant
tagged with: minify
has comment: http://stackoverflow.com/comment/44255598
has comment: http://stackoverflow.com/comment/44255697
answer count: 0
tagged with: angularjs
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44256547

http://stackoverflow.com/a/27810091
has comment: http://stackoverflow.com/comment/44029134
has comment: http://stackoverflow.com/comment/44029217
has comment: http://stackoverflow.com/comment/44029172
has body: Use positive look behind /(?&lt;=@)\S+/ /Edit I've read that JavaScript doesn't support lookbehinds. So I recommend using: result.map(function(a) {a.slice(1)}) On each
upvote count: 1
has comment: http://stackoverflow.com/comment/44029106
has comment: http://stackoverflow.com/comment/44029294
has comment: http://stackoverflow.com/comment/44029195
has comment: http://stackoverflow.com/comment/44029023
score: 1
answers question: http://stackoverflow.com/q/27810050
downvote count: 0
has comment: http://stackoverflow.com/comment/44029202
has comment: http://stackoverflow.com/comment/44029224
type: Answer

http://stackoverflow.com/comment/44093953
score: 0
has text: You can remove your last 3 comments above as they have been added to your question. Are you sure the JSON data is correct? Your result should look like the snippet in your question.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27831034

http://stackoverflow.com/a/27962661
downvote count: 0
type: Answer
score: 2
has body: You can use a simple regex to macth rgb({number}, {number}, {number}): function convertRgb(rgb) { // results contains e.g. ["rgb(255, 255, 255)", "255", "255", "255"] var results = /^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.exec(rgb); return { r: results[1], g: results[2], b: results[3], }; } var rgb = convertRgb("rgb(255, 255, 255)"); console.dir(rgb);
upvote count: 2
answers question: http://stackoverflow.com/q/27962538

http://stackoverflow.com/a/27942764
has comment: http://stackoverflow.com/comment/44282261
answers question: http://stackoverflow.com/q/27941460
has comment: http://stackoverflow.com/comment/44282176
has comment: http://stackoverflow.com/comment/44281613
has comment: http://stackoverflow.com/comment/44281670
has comment: http://stackoverflow.com/comment/44282316
score: 0
has body: Have you tried: &lt;div id="wrap" ng-switch on="view"&gt; And setting: $scope.view = "project";
type: Answer
has comment: http://stackoverflow.com/comment/44282564

http://stackoverflow.com/a/27946436
has body: Instead of worrying about tracking file names, why not just target anything that's not yours? $('link').not('.myLink').remove(); And just make sure you drop that class on your link: &lt;link rel="stylesheet" href="path.css" class="myLink" /&gt;
answers question: http://stackoverflow.com/q/27945969
type: Answer
upvote count: 1
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44290760
score: 1
has comment: http://stackoverflow.com/comment/44289178
accepted answer of: http://stackoverflow.com/q/27945969

meteor
tags question: http://stackoverflow.com/q/27831751
tags question: http://stackoverflow.com/q/27848916
tags question: http://stackoverflow.com/q/27948848
tags question: http://stackoverflow.com/q/27910047
tags question: http://stackoverflow.com/q/27904348
tags question: http://stackoverflow.com/q/27867199
tags question: http://stackoverflow.com/q/27948046
tags question: http://stackoverflow.com/q/27958396
tags question: http://stackoverflow.com/q/27962532
tags question: http://stackoverflow.com/q/27817858
tags question: http://stackoverflow.com/q/27930161
tags question: http://stackoverflow.com/q/27909787
tags question: http://stackoverflow.com/q/27926044
tags question: http://stackoverflow.com/q/27915773
tags question: http://stackoverflow.com/q/27877662
tags question: http://stackoverflow.com/q/27831421
tags question: http://stackoverflow.com/q/27856029
tags question: http://stackoverflow.com/q/27806206
tags question: http://stackoverflow.com/q/27951102
tags question: http://stackoverflow.com/q/27884740
tags question: http://stackoverflow.com/q/27804363
tags question: http://stackoverflow.com/q/27848634
tags question: http://stackoverflow.com/q/27882357
tags question: http://stackoverflow.com/q/27907132
tags question: http://stackoverflow.com/q/27806202
tags question: http://stackoverflow.com/q/27950075
tags question: http://stackoverflow.com/q/27845493
tags question: http://stackoverflow.com/q/27875350
tags question: http://stackoverflow.com/q/27912223
tags question: http://stackoverflow.com/q/27849701
tags question: http://stackoverflow.com/q/27930460
tags question: http://stackoverflow.com/q/27853143
tags question: http://stackoverflow.com/q/27853277
type: Tag
tags question: http://stackoverflow.com/q/27923733
tags question: http://stackoverflow.com/q/27807762
tags question: http://stackoverflow.com/q/27869279
tags question: http://stackoverflow.com/q/27949872
tags question: http://stackoverflow.com/q/27910775
tags question: http://stackoverflow.com/q/27855087
tags question: http://stackoverflow.com/q/27836815
tags question: http://stackoverflow.com/q/27845653
tags question: http://stackoverflow.com/q/27949663
tags question: http://stackoverflow.com/q/27911701
tags question: http://stackoverflow.com/q/27835164
tags question: http://stackoverflow.com/q/27804441
tags question: http://stackoverflow.com/q/27853637
tags question: http://stackoverflow.com/q/27838869
tags question: http://stackoverflow.com/q/27960559
tags question: http://stackoverflow.com/q/27879745
tags question: http://stackoverflow.com/q/27926619
tags question: http://stackoverflow.com/q/27956166
tags question: http://stackoverflow.com/q/27950673
tags question: http://stackoverflow.com/q/27936868
tags question: http://stackoverflow.com/q/27912428
tags question: http://stackoverflow.com/q/27814192
tags question: http://stackoverflow.com/q/27846170
tags question: http://stackoverflow.com/q/27918820
tags question: http://stackoverflow.com/q/27868876
tags question: http://stackoverflow.com/q/27831290
tag name: meteor
tags question: http://stackoverflow.com/q/27934720
tags question: http://stackoverflow.com/q/27846897
tags question: http://stackoverflow.com/q/27828361
tags question: http://stackoverflow.com/q/27897142
tags question: http://stackoverflow.com/q/27874148
tags question: http://stackoverflow.com/q/27912417
tags question: http://stackoverflow.com/q/27832359

http://stackoverflow.com/a/27963526
type: Answer
has comment: http://stackoverflow.com/comment/44325663
has comment: http://stackoverflow.com/comment/44352768
has comment: http://stackoverflow.com/comment/45651762
downvote count: 0
score: 1
has body: I would define a currentUser method on the Session that returns the user as a promise: export default Session.extend({ currentUser: function() { var userId = this.get('user_id'); if (!Ember.isEmpty(userId)) { return this.container.lookup('store:main').find('user', userId); } }.property('user_id') }); Also you should better define your own customer session class that extends from the Ember Simple Auth Session class instead of reopening that.
accepted answer of: http://stackoverflow.com/q/27947274
answers question: http://stackoverflow.com/q/27947274
has comment: http://stackoverflow.com/comment/44326084
upvote count: 1
has comment: http://stackoverflow.com/comment/44327646
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44336149

http://stackoverflow.com/comment/44142417
comment on: http://stackoverflow.com/a/27869266
score: 0
type: AnswerComment
type: Comment
has text: @Ziarno - in this case, it's had the necessary data added to it - and a function *is* an object in JavaScript after all. `sayHello instanceof Object === true`

http://stackoverflow.com/q/27806202
downvote count: 0
tagged with: meteor
favorite count: 0
has body: I want to show all objects which are due today. Everything works properly with my fixture data. But newly added objects won't show up. Fixture ... var today = moment().toDate(); Cards.insert({ deckName: javascriptId, due: today, front: 'blaablaa', back: 'blaablaablaa' }); ... Show objects Template.showCards.helpers({ cards: function () { var end = moment().toDate(); return Cards.findOne({ deckName: this._id, due: {"$lte": end} }); } Add new due date to hide an object Template.showCards.events({ ... 'click #difficulty button': function(event) { var incBy = parseInt(event.target.value); console.log(incBy); console.log(typeof incBy); var today = moment(); var newDue = moment(today).add(incBy,'days').toDate(); Cards.update( this._id, { $set: {due: newDue} } ); } }); Add new objects Template.addCards.events({ 'submit form': function (event, template) { event.preventDefault(); var deckNameVar = event.target.deckName.value; var frontVar = event.target.front.value; var backVar = event.target.back.value; var today = moment().toDate(); Cards.insert({ deckName: deckNameVar, due: today, front: frontVar, back: backVar }); } }); New objects will be properly added to the database but for some reason they don't show up.
accepted answer: http://stackoverflow.com/a/27806359
has title: Meteor: How to add and query Dates in Mongodb with Momentjs
tagged with: momentjs
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27806359
tagged with: mongodb
answer count: 1

http://stackoverflow.com/a/27937538
answers question: http://stackoverflow.com/q/27937445
has body: No. You can not use serialization for table td. It will work only for input controls. If you want to post td data then create your own java script object, collect td texts &amp; post it to server.
type: Answer
score: 0

http://stackoverflow.com/a/27955345
accepted answer of: http://stackoverflow.com/q/27955059
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44306272
answers question: http://stackoverflow.com/q/27955059
has comment: http://stackoverflow.com/comment/44306555
type: Answer
has body: The problem is you have multiple lis, they will cancel out the open ones. You need to either assign the timeout to each li or you need to see if their is another li open to close it. var lis = $('#menu').find('li').has('ul'); lis.on('mouseenter', function(){ var li = $(this); var timer = li.data("timer"); clearTimeout(timer); $(this).find('&gt;ul').stop().slideDown(); }); lis.on('mouseleave', function(){ var li = $(this); var timer = setTimeout(function() { $(this).find('&gt;ul').stop().slideUp(); },1000); li.data("timer", timer); });
score: 0

http://stackoverflow.com/q/27827313
type: AnsweredQuestion
tagged with: javascript
tagged with: autoplay
has answer: http://stackoverflow.com/a/27827434
accepted answer: http://stackoverflow.com/a/27827434
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27827378
favorite count: 0
has title: HTML5 music player external play button
has body: I'm building a single page parallax site. The first part of the page is a logo and a text button that says "Listen Now" When the listen now button is clicked the page automatically scrolls down to the next section where a HTML5 music play is embedded. Is there a way to make the music automatically start once the "Listen Now" button is clicked? Here's a link to the page I'm working on. I tried adding the event listener but it doesn't seem to be working. http://rob.peytongregory.com/
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/27827378
has comment: http://stackoverflow.com/comment/44060432
type: Question

http://stackoverflow.com/comment/44208104
type: Comment
has text: Wait, so you are going to let people create a html page, which will then be uploaded onto your server. I hope you are taking security seriously as allowing people you dont know to create content on your server might be a very bad idea
comment on: http://stackoverflow.com/q/27904102
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44294754
type: Comment
has text: but what is the parent controller of the index?
comment on: http://stackoverflow.com/a/27949587
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46957292
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27840316
has text: Can reproduce on Chrome 41 on OS X Yosemite. I suspect it is due to a painting issue, where the frame rate of the browser is simply too slow to fully display the range of opacity the element is cycled through. Adding a delay seems to work, so as extending the transition time to 125ms and beyond.
score: 0

http://stackoverflow.com/q/27926171
has answer: http://stackoverflow.com/a/27926595
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27926595
downvote count: 1
has comment: http://stackoverflow.com/comment/44249652
has body: I've been struggling with this for the past day and I can't seem to make it work. The following code always returns false. I have tried hasOwnProperty, typeof === 'undefined', typeof == 'undefined', I have even tried just using looped_array[major_minor]['sum_sales']. I am never getting the add part of the loop. It always returns false. For arguments sake, let's just say I've been tasked to do this in pure javascript. I can easily do this in PHP and Python, but I can't use them. Which could very well be my problem, I'm trying to use PHP knowledge and apply it to js. I am not a javascript programmer, but I need to learn. I need to loop through several thousand records and build a summed array from them. My original data looks like item['net_price_extended'] item['pg_major'] item['pg_minor'] major_minor is created like so var major_minor = item['pg_major'] + '' + item['pg_minor']; Code I'm trying right now that doesn't work if('sum_sales' in looped_array[major_minor]) { console.log("should be true"); console.log('sum_sales' in looped_array[major_minor]); looped_array[major_minor]['sum_sales'] += parseFloat(item['net_price_extended']); } else { console.log("should be false"); console.log('sum_sales' in looped_array[major_minor]); looped_array[major_minor]['sum_sales'] = parseFloat(item['net_price_extended']); } All the code for the loop for(r in margin_array) { var item = margin_array[r]; var major_minor = item['pg_major'] + item['pg_minor']; looped_array[major_minor] = {}; looped_array[major_minor]['pg_major'] = item['pg_major']; looped_array[major_minor]['major_description'] = item['major_description']; looped_array[major_minor]['pg_minor'] = item['pg_minor']; looped_array[major_minor]['minor_description'] = item['minor_description']; /************************ * Calculate the totals * ************************/ if(looped_array[major_minor] &amp;&amp; looped_array[major_minor]['sum_sales']) { looped_array[major_minor]['sum_sales'] += parseFloat(item['net_price_extended'…
type: Question
has comment: http://stackoverflow.com/comment/44249457
has comment: http://stackoverflow.com/comment/44249881
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/44249750
score: 0
answer count: 1
has title: Javascript if key in array then set it else add to it
favorite count: 0
upvote count: 1

http://stackoverflow.com/comment/44251177
has text: well sould I give each button an id ?
type: Comment
comment on: http://stackoverflow.com/q/27927004
score: 0
type: QuestionComment

http://stackoverflow.com/q/27835426
tagged with: irc
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27835469
tagged with: npm
type: Question
has title: Where are event listeners defined in npm packages?
has body: I've been working on coding an IRC bot in nodejs as a learning project. I've been frequently coming across event listeners such as the following: bot.addListener("message", function(from, to, text, message) { . . . }); Problem: I've been looking everywhere for an explanation of where this addListener is defined/explained. I can't find anything. It is from the irc package in npm, and even after searching every github file in the irc package source, I find no instance of the string addListener. What's going on here? How do I figure out how this addListener is working, what the list of IRC events are (besides just "message"), and so forth?
score: 0
answer count: 1
tagged with: javascript
tagged with: dom-events
accepted answer: http://stackoverflow.com/a/27835469

http://stackoverflow.com/a/27880099
has body: To pass argument to callback function from directive, try to do following changes. template.html: Your Main HTML Here, we need to pass the argument in form of an object and the key of this object will be mapped with the argument of function that is assigned in your template. Check this working example in plunker showing how to pass argument to the function from directive. Hope this will be useful.
answers question: http://stackoverflow.com/q/27878866
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27878866

http://stackoverflow.com/comment/44290276
type: QuestionComment
has text: I am not sure how to do this. Very new to regex.
score: 0
comment on: http://stackoverflow.com/q/27947663
type: Comment

charts
tags question: http://stackoverflow.com/q/27936137
tags question: http://stackoverflow.com/q/27952605
tags question: http://stackoverflow.com/q/27845961
tags question: http://stackoverflow.com/q/27957552
tags question: http://stackoverflow.com/q/27893248
tags question: http://stackoverflow.com/q/27866365
tags question: http://stackoverflow.com/q/27810292
tags question: http://stackoverflow.com/q/27863903
type: Tag
tags question: http://stackoverflow.com/q/27930030
tag name: charts
tags question: http://stackoverflow.com/q/27859936
tags question: http://stackoverflow.com/q/27915909
tags question: http://stackoverflow.com/q/27947215
tags question: http://stackoverflow.com/q/27821005
tags question: http://stackoverflow.com/q/27848063
tags question: http://stackoverflow.com/q/27961628
tags question: http://stackoverflow.com/q/27868958

http://stackoverflow.com/q/27886478
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27886513
answer count: 1
has comment: http://stackoverflow.com/comment/44174124
has comment: http://stackoverflow.com/comment/44174193
tagged with: route-provider
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to use the angular routeProvider and routeParams to get the id and name parameters. Here's the js: angular.module("test",["ngRoute"]) .config(["$routeProvider",function(a){ a.when("/test/:id",{}). when("/tests/:name",{}); } ]).controller("testCtrl",["$scope","$routeParams",function(a,b){ a.result = b.name; //console.log(b.id); } ]); And the HTML ... Test ID 1 2 Test Name Test1 Test2 Test3 RouteParams Result {{ result }} This is not a SPA and hence I'm not setting the templateUrl and controller in when function. I only need the URL params. I have included the angular and angular-route libs Here's the plunkr just in case
type: Question
has title: Angular routeParams returns an empty object

http://stackoverflow.com/q/27882126
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27882141
upvote count: 0
answer count: 1
favorite count: 0
has title: Simple isEven function throws syntax error
has body: I can't figure out why this function code will not run? Here is my code. function isEven(n) { if (n%2 == 0) { return true; }; else { return false; }; }; console.log(isEven(50)); I am getting an error message with the "else" statement.
has comment: http://stackoverflow.com/comment/44166151
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44166037
downvote count: 1
type: Question

http://stackoverflow.com/a/27863336
has comment: http://stackoverflow.com/comment/44137042
has body: A slightly different approach to this would be to put all the functions/variables etc back in the global scope as designed, and instead remove the script tag pointing at the Google script. Instead, inject it in the click handler: function generateUpload() { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://apis.google.com/js/api.js?onload=onApiLoad'; document.getElementsByTagName('head')[0].appendChild(script); }
type: Answer
answers question: http://stackoverflow.com/q/27862865
has comment: http://stackoverflow.com/comment/44136959
score: 0
has comment: http://stackoverflow.com/comment/44136893
has comment: http://stackoverflow.com/comment/44136777

http://stackoverflow.com/comment/44305045
comment on: http://stackoverflow.com/q/27954941
has text: Just tried that, didn't help, I noticed that the element didn't totally vanish from the DOM actually. It got moved outside of .
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44320013
has text: my bad, the alpha channel should be decimal, I changed it and now I can see the issue, but it's something expected by the specs
score: 0
comment on: http://stackoverflow.com/q/27961537
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27873109
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27873051
upvote count: 1
type: Answer
has body: Why change the value of hours in your routine? Use a separate value like var americanTime = hours; if(hours &gt; 12) { americanTime = hours - 12; }

http://stackoverflow.com/comment/44238104
type: QuestionComment
comment on: http://stackoverflow.com/q/27919753
has text: google chrome does it :). it just shows the downloaded file at the bottom of the browser without any popup or dialog box
score: 0
type: Comment

http://stackoverflow.com/comment/44284433
comment on: http://stackoverflow.com/q/27944219
score: 0
has text: ah ok then, I just hope my app won't go out of memory..
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27914081
has comment: http://stackoverflow.com/comment/44227401
type: Question
has comment: http://stackoverflow.com/comment/44227517
has comment: http://stackoverflow.com/comment/44227499
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27914269
has comment: http://stackoverflow.com/comment/44227487
has body: I'm new to js and i'm trying to show a pricing/plan based on a user's selection. I don't think this is the best way to do it but since I'm a beginner I'm not too sure on a more efficient approach. Currently the script seems to hide my selector and I can't figure out why. Any suggestions on how to make a better solution. Any help would be appreciated. My HTML $19.99 /mo 30 day Free Trial Starter Plan 1 to 50 Users Unlimited Bandwidth Unlimited Products Unlimited Push Notifications 1 Entry Raffle For a Custom App Theme $49.99 /mo 30 day Free Trial Starter Plan 1 to 50 Users Unlimited Bandwidth Unlimited Products Unlimited Push Notifications 1 Entry Raffle For a Custom App Theme $99.99 /mo 30 day Free Trial Starter Plan 1 to 50 Users Unlimited Bandwidth Unlimited Products Unlimited Push Notifications 1 Entry Raffle For a Custom App Theme --> $199.99 /mo 30 day Free Trial Starter Plan 1 to 50 Users Unlimited Bandwidth Unlimited Products Unlimited Push Notifications 1 Entry Raffle For a Custom App Theme $599.99 /mo 30 day Free Trial Starter Plan 1 to 50 Users Unlimited Bandwidth Unlimited Products Unlimited Push Notifications 1 Entry Raffle For a Custom App Theme $19.99 $49.99 $99.99 $199.99 $599.99
has answer: http://stackoverflow.com/a/27914213
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27914226
has title: How to show a 1 DOM object while hiding other DOM options with a selector

http://stackoverflow.com/comment/44099325
score: 0
type: Comment
has text: @TimLewis After some time when user loggs in to my portal there should be a warning message that the session is about to expire. It is done by those JS files I cannot touch. Also in document.title there show up a counter which count down to 0. Now, I hide this message (using CSS) and then display it just 5 minutes before expiration. It's easy but unfortuantely I cannot figure out how to prevent those JS files to update my document.title, which I want to hold a portal name.
type: QuestionComment
comment on: http://stackoverflow.com/q/27847616

http://stackoverflow.com/comment/44134360
has text: @AlvaroMontoro very nice. Write it in an answer and I will mark it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27863698

http://stackoverflow.com/comment/44101885
type: QuestionComment
comment on: http://stackoverflow.com/q/27848474
type: Comment
score: 1
has text: @user3202422 sure you are, you are trying to filter it in the view. Can easily do that in controller

http://stackoverflow.com/comment/44225626
type: QuestionComment
has text: This is called inside my content script JS
comment on: http://stackoverflow.com/q/27913065
score: 0
type: Comment

node.js
tags question: http://stackoverflow.com/q/27909246
tags question: http://stackoverflow.com/q/27875090
tags question: http://stackoverflow.com/q/27911840
tags question: http://stackoverflow.com/q/27825155
tags question: http://stackoverflow.com/q/27876557
tags question: http://stackoverflow.com/q/27879568
tags question: http://stackoverflow.com/q/27897938
tags question: http://stackoverflow.com/q/27884297
tags question: http://stackoverflow.com/q/27850907
tags question: http://stackoverflow.com/q/27929769
tags question: http://stackoverflow.com/q/27847720
tags question: http://stackoverflow.com/q/27847594
tags question: http://stackoverflow.com/q/27864977
tags question: http://stackoverflow.com/q/27832552
tags question: http://stackoverflow.com/q/27887391
tags question: http://stackoverflow.com/q/27910409
tags question: http://stackoverflow.com/q/27907357
tags question: http://stackoverflow.com/q/27828374
tags question: http://stackoverflow.com/q/27876511
tags question: http://stackoverflow.com/q/27949659
tags question: http://stackoverflow.com/q/27815391
tags question: http://stackoverflow.com/q/27942658
tags question: http://stackoverflow.com/q/27867045
tags question: http://stackoverflow.com/q/27923107
tags question: http://stackoverflow.com/q/27890619
tags question: http://stackoverflow.com/q/27941460
tags question: http://stackoverflow.com/q/27809347
tags question: http://stackoverflow.com/q/27865419
tags question: http://stackoverflow.com/q/27891402
tags question: http://stackoverflow.com/q/27933692
tags question: http://stackoverflow.com/q/27884371
tags question: http://stackoverflow.com/q/27944113
tags question: http://stackoverflow.com/q/27855951
tags question: http://stackoverflow.com/q/27919946
tags question: http://stackoverflow.com/q/27922152
tags question: http://stackoverflow.com/q/27931103
tags question: http://stackoverflow.com/q/27861253
tags question: http://stackoverflow.com/q/27817077
tags question: http://stackoverflow.com/q/27904913
tags question: http://stackoverflow.com/q/27920259
tags question: http://stackoverflow.com/q/27953338
tags question: http://stackoverflow.com/q/27825220
tags question: http://stackoverflow.com/q/27959554
tags question: http://stackoverflow.com/q/27931602
tags question: http://stackoverflow.com/q/27843673
tags question: http://stackoverflow.com/q/27809007
tags question: http://stackoverflow.com/q/27862618
tags question: http://stackoverflow.com/q/27822942
tags question: http://stackoverflow.com/q/27919443
tags question: http://stackoverflow.com/q/27914209
tags question: http://stackoverflow.com/q/27843258
tags question: http://stackoverflow.com/q/27810012
tags question: http://stackoverflow.com/q/27881942
tags question: http://stackoverflow.com/q/27916510
tags question: http://stackoverflow.com/q/27932947
tags question: http://stackoverflow.com/q/27844553
tags question: http://stackoverflow.com/q/27883321
tags question: http://stackoverflow.com/q/27810409
tags question: http://stackoverflow.com/q/27896355
tags question: http://stackoverflow.com/q/27863114
tags question: http://stackoverflow.com/q/27956245
tags question: http://stackoverflow.com/q/27904002
tags question: http://stackoverflow.com/q/27942712
tags question: http://stackoverflow.com/q/27865732
tags question: http://stackoverflow.com/q/27892047
tags question: http://stackoverflow.com/q/27810138
tags question: http://stackoverflow.com/q/27880524
tags question: http://stackoverflow.com/q/27953134
tags question: http://stackoverflow.com/q/27925705
tags question: http://stackoverflow.com/q/27907196
tags question: http://stackoverflow.com/q/27893251
tags question: http://stackoverflow.com/q/27893474
tags question: http://stackoverflow.com/q/27909811
tags question: http://stackoverflow.com/q/27856315
tags question: http://stackoverflow.com/q/27874834
tags question: http://stackoverflow.com/q/27861722
tags question: http://stackoverflow.com/q/27908520
tags question: http://stackoverflow.com/q/27913112
tags question: http://stackoverflow.com/q/27862979
tags question: http://stackoverflow.com/q/27852946

http://stackoverflow.com/comment/44278379
score: 0
comment on: http://stackoverflow.com/q/27935779
type: Comment
type: QuestionComment
has text: You need to parse your string values into numbers. Visit [this](http://www.highcharts.com/docs/working-with-data/data-module) website to see how you can do it.

http://stackoverflow.com/comment/44041171
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27817042
has text: Can you give some example of the mask you need?
score: 0

http://stackoverflow.com/a/27828519
downvote count: 0
has comment: http://stackoverflow.com/comment/44064921
has body: If you are using the router version 0.2.0 there is a new method to get the url from the state configuration. You can use $state.href(stateOrName [, params] [, options]) for that. Provided you place $state instance on the scope, you can do: &lt;span&gt;&lt;a ui-sref="mystate({ arg1_name: 'arg1_val', arg2_name: 'arg2_val'})"&gt; {{$state.href('mystate', { arg1_name: 'arg1_val', arg2_name: 'arg2_val'})}} &lt;/a&gt;&lt;/span&gt; The options can be:- 1) lossy Boolean (default true) If true, and if there is no url associated with the state provided in the first parameter, then the constructed href url will be built from the first navigable ancestor (aka ancestor with a valid url). 2) inherit Boolean (default false) If true will inherit url parameters from current url. 3) relative stateObject (default $state.$current), When transitioning with relative path (e.g '^'), defines which state to be relative from. 4) absolute Boolean (default false) If true will generate an absolute url, e.g. "http://www.example.com/fullurl". You wont be able to access injected $state in your view unless you associate it to the scope or controller instance (if you are using controller As). So you can add a scope method on your controller. $scope.getUrl = function(state, params){ return $state.href(state, params, anyOptions); } and in your view:- {{getUrl('mystate', { arg1_name: 'arg1_val', arg2_name: 'arg2_val'})}} and access it on the view by calling getUrl function. If you want this functionality across controllers you could either move it to a utilityService function or place the utility method on the rootScope in the run block so that any child scopes will have access to it (Though for unit testing you may need to mock it based on your set up). Remember to inject $state.
type: Answer
has comment: http://stackoverflow.com/comment/44063318
has comment: http://stackoverflow.com/comment/44063276
upvote count: 3
has comment: http://stackoverflow.com/comment/44063240
score: 3
answers question: http://stackoverflow.com/q/27828246

http://stackoverflow.com/q/27820860
tagged with: javascript
has body: I'm just new here in Javascript and I would like to ask you question on how to make a simple fibonacci generator by which when a user input any number, it will find the nth term of the fibonacci sequence. Sample code is given. &lt;html&gt; &lt;body&gt; the number inserted in this textbox will find the nth term of the fibonacci sequence. The sample is 4 where the 4th term is 5. &lt;script type="text/javascript"&gt; function myFunction() { var x = document.f1.n1.value; if(x=4) { document.write(5); } } &lt;/script&gt; &lt;form name="f1" onsubmit="return false"&gt; First no. &lt;input type="text"name="n1" value=3 disabled&gt; &lt;input type="submit" value=GO onClick="myFunction()"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;
has comment: http://stackoverflow.com/comment/44047467
answer count: 2
tagged with: while-loop
tagged with: for-loop
upvote count: 0
has answer: http://stackoverflow.com/a/27821221
favorite count: 0
score: -3
has answer: http://stackoverflow.com/a/27820946
type: AnsweredQuestion
has title: finding the nth term fibonacci sequence using loop in javascript
accepted answer: http://stackoverflow.com/a/27821221
downvote count: 3
possible better answer: http://stackoverflow.com/a/27820946
tagged with: loops
type: Question
tagged with: fibonacci

http://stackoverflow.com/a/27949795
score: 2
upvote count: 2
has body: You can use canvg library to convert svg to canvas. You should include all its necessary js files to your page and then use it something like this: canvg(document.getElementById('canvasElement'), '&lt;svg&gt;...&lt;/svg&gt;')
answers question: http://stackoverflow.com/q/27949573
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44294852
has comment: http://stackoverflow.com/comment/44295867

http://stackoverflow.com/q/27904323
type: Question
tagged with: javascript
upvote count: 2
tagged with: jwplayer
has body: I modified a plugin to JWPlayer(http://www.pluginsbyethan.com/newsticker6.html), which ended up working great on the HTML5 version with mp4 format playing, but when i shifts to Flash version, it crashes the player. How come I can't implement the plugin on the Flash version? If I use a callback to a .swf file, that is not relevant, it does not crash, so does the Flash player only support .swf flash plugins, or can I define the JS plugin to the Flash player somehow? Code looks like this; jwplayer().registerPlugin("ticker", "6.0", function(player, config) { function setup() { var theBody = document.getElementById(player.id); var playerWidthPX2 = player.getHeight(); var playerWidthPX = parseFloat(playerWidthPX2); var playerHeightPX2 = player.getWidth(); var playerHeightPX = parseFloat(playerHeightPX2); var ticker_top = document.createElement("div"); var ticker_top_marquee = document.createElement("marquee"); var ticker_middle = document.createElement("div"); var ticker_middle_marquee = document.createElement("marquee"); var ticker_middle_date = document.createElement("div"); // top ticker_top.setAttribute("id", "ticker_top"); ticker_top.style.background = "#e3bfa3"; ticker_top.style.height = 26 + "px"; ticker_top.style.width = "100%"; ticker_top.style.position = "absolute"; ticker_top.style.zIndex = "1"; ticker_top.style.bottom = "25px"; ticker_top.style.opacity = "1"; ticker_top.style.visibility = "hidden"; // Marquee too ticker_middle ticker_top_marquee.setAttribute("id", "ticker_top_marquee"); ticker_top_marquee.style.color = "#000000"; ticker_top_marquee.innerHTML = config.ticker1; ticker_top_marquee.setAttribute("scrollamount", "6"); ticker_top_marquee.setAttribute("direction", "left"); ticker_top_marquee.style.fontSize = "18px"; ticker_top_marquee.style.fontWeight = "600"; ticker_top_marquee.style.textTransform = "uppercase"; ticker_top_marquee.style.cursor = "default"; ticker_top_marquee.style.fontFamily = "PT Sans"; ticker_top_marquee.style.position = "absolute"…
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27905249
accepted answer: http://stackoverflow.com/a/27905249
tagged with: plugins
has title: JWPlayer JS plugin added to the flash-version
score: 2
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/27841822
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27841750
score: 1
type: AcceptedAnswer
has body: In your controller you're waiting for a .then after your .all() but you haven't wired up your getDeals to work like that, here's how you would do it: app.factory('Deals', function($http, $q) { function getDeals() { var myPromise = $q.defer(); $http.get('http://www.domain.com/library/fct.get_deals.php') .success(function (data) { var deals = data; myPromise.resolve(deals); }) .error(function(err){ myPrmoise.reject(); }); return myPromise.promise; } return { all: function() { return getDeals(); }, get: function(keyID) { return restaurants[keyID]; } } });
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27841750

http://stackoverflow.com/comment/44254184
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27927817
has text: you are asking if anyone can solve your problem, but you forgot to mention what **IS** the problem?
score: 0

http://stackoverflow.com/comment/44305940
type: Comment
has text: I've created a jsbin page to demonstrate this bug - http://jsbin.com/xegularomu. However, this points to the same imgur link above, and I expect imgur would begin to throttle traffic if this was run very often. I can consistently reproduce it in IE11 (usually starts to fail somewhere around 200 images)
score: 0
comment on: http://stackoverflow.com/q/27934411
type: QuestionComment

http://stackoverflow.com/comment/44232716
comment on: http://stackoverflow.com/a/27917102
has text: You need to use immediate child selector as well. check the updated answer
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44292761
has text: Have you verified that the ID being assigned to each button is unique?
comment on: http://stackoverflow.com/q/27948775
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44239965
comment on: http://stackoverflow.com/q/27921355
score: 1
type: Comment
type: QuestionComment
has text: Reduce your code to the minimum that displays the issue and post it here. Linking to 2,200 lines elsewhere shows zero effort on your behalf.

http://stackoverflow.com/a/27980632
type: Answer
downvote count: 0
score: 1
has body: When you have markers inside loop, and want to access the clicked marker always use 'this' instead of marker variable, For eg. for(var i=0; i&lt;9; i++) { new google.maps.event.addListener(markers[i], 'click', function() { infowindow.open(map, this) }); } If you don't do the above work around, and use marker variable instead, the loop executes and finishes before you click on marker, there fore the value of I will always be the value of its last iteration. And thus clicking only shows the latest one
has comment: http://stackoverflow.com/comment/44409483
has comment: http://stackoverflow.com/comment/50230838
accepted answer of: http://stackoverflow.com/q/27962476
answers question: http://stackoverflow.com/q/27962476
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44386960

http://stackoverflow.com/q/27908309
accepted answer: http://stackoverflow.com/a/27908501
upvote count: 1
type: AnsweredQuestion
has body: I am wondering if it is possible to store the contents of the clipboard in a string variable. The following source states that this is not possible using pure JS, but I was thinking hoping that the chrome API would make it possible. (I am developing a chrome extension). How to read clipboard data in cross browser? There is a clipboardRead permission, which would lead you to believe that it is possible, but it's description is just: Required if the extension or app uses document.execCommand('paste'). source To clarify: I am not trying to copy data to the clipboard or paste data from it. I would like to store the contents of the clipboard into a variable without mutating the clipboard contents in any way. To further clarify, I can not assume that the clipboard data happens to be sitting in info.selectionText at the time of the operation. If it is not possible, than I will just have to live with it I suppose, but it seems like something that would be possible to do with an extension. EDIT: The reason I want to store the value is because I need to utilize the clipboard to perform an operation, but I would like to restore its contents when I am done, so the user doesn't loose whatever used to be in there. If I just paste the data into a text area and store it from there, then, when I go to put the data back, the user will loose any formatting that they had, which is much better than nothing, but is not optimal. Also, is there a way that I could store that data, even if it is not a string, (an image for example)? A solution that allows me to do this would undoubtedly implicitly answer the above question as well, but is not necessary. I am primarily looking save string data and would prefer a way to keep the formatting.
tagged with: clipboarddata
score: 1
tagged with: google-chrome
linked to: http://stackoverflow.com/q/5551338
type: Question
has answer: http://stackoverflow.com/a/27908501
downvote count: 0
has title: Storing clipboard data into a variable with JavaScript and the Google Chrome API
tagged with: javascript
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/q/27912428
accepted answer: http://stackoverflow.com/a/27975561
answer count: 1
tagged with: meteor
has comment: http://stackoverflow.com/comment/44243958
has comment: http://stackoverflow.com/comment/44224425
tagged with: datepicker
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27975561
has comment: http://stackoverflow.com/comment/44225730
has comment: http://stackoverflow.com/comment/44225517
type: Question
has title: Unable to submit JQuery datepicker value in Meteor
has comment: http://stackoverflow.com/comment/44228056
tagged with: javascript
has body: I added a datepicker (https://github.com/deepwell/meteor-bootstrap-datepicker) to my project, but am struggling to submit the chosen date to my Mongo document. If I use the following code as-is, the datepicker works just fine, but the submit event does not work. The datepicker field is still cleared, however. If I comment out the three Template.datepicker.rendered lines, the form submit event works just fine and inserts into the Mongo document. Ideas? // item.html {{#if editMode}} {{> datepicker}} {{/if}} // datepicker.html Due date: // datepicker.js Template.datepicker.rendered = function() { this.$('.datepicker').datepicker(); }; Template.datepicker.events({ 'submit .datepicker': function(event) { event.preventDefault(); var itemDue = event.target.text.value; Items.update(this._id, {$set: {itemDue: itemDue}}); event.target.text.value = ""; return false; } });
score: 0
has comment: http://stackoverflow.com/comment/44225577

http://stackoverflow.com/q/27943412
has title: Need to activate JS code on leaving a textarea
tagged with: javascript
has answer: http://stackoverflow.com/a/27945040
score: 0
possible better answer: http://stackoverflow.com/a/27943495
answer count: 3
accepted answer: http://stackoverflow.com/a/27943452
has answer: http://stackoverflow.com/a/27943452
has body: Currently I clean text in a TextArea via an an OnClick event on the submit button of a form. Save However I now think this is flawed, and it would be much better to have the cleanHTML function being triggered on the TextArea element itself when say the user leaves it, so if the user pastes some code then moves on, then it will get triggered. What would be the required event and what would the function call code now look like? I provide a starter below with pseudocode in the onblur event, if onblur is the correct event? Also what is the best approach to link up all TextAreas to behave this way, centrally. Currently I am thinking that I need to put the required event call on every TextArea. EDIT1
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27943495

http://stackoverflow.com/a/27860791
has body: I personally haven't tried it but you could look into Wt: http://www.webtoolkit.eu/wt/ It is a C++ framework that has a Qt flavour. It has a Java version called JWt. Hence, a Jython binding exists for us Python programmers: http://www.webtoolkit.eu/wt/other_language It is not a direct replacement of Qt, and might need modification to your Qt code to work as a Wt web app, but it certainly seems worth it to look into.
score: 0
answers question: http://stackoverflow.com/q/27846603
type: Answer

http://stackoverflow.com/comment/44357428
comment on: http://stackoverflow.com/a/27963704
type: AnswerComment
type: Comment
has text: no, the function isn't called `c`. And the rest of your answer looks like you're a little lost about what really happens. I'd suggest you read a little about IIFE (see link in my answer), or maybe newuser's answer.
score: 0

http://stackoverflow.com/q/27840074
has body: I'm using a Response.Write in ASP to send an e-mail via Javascript using the Mandrill API, I've already checked this code for at least 5 times and the syntax looks right to me, I don't know why this error is being reported. if err.number = 0 then Response.Write("&lt;script language=""javascript"" type=""text/javascript""&gt; $.ajax({ type: “POST”, url: “https://mandrillapp.com/api/1.0/messages/send.json”, data: { ‘key’: ‘MYAPIKEY’, ‘message’: { ‘from_email’: ‘MAIL’, ‘to’: [ { ‘email’: ‘MAIL’, ‘name’: ‘ABC’, ‘type’: ‘to’ }, ], ‘autotext’: ‘true’, ‘subject’: ‘TEST’, ‘html’: ‘TEST’ } } }).done(function(response) { console.log(response); }); &lt;/script&gt;") end if I'd appreciate some help since I'm a beginner.
type: Question
has answer: http://stackoverflow.com/a/27855794
tagged with: mandrill
tagged with: asp-classic
answer count: 1
has title: Unterminated String Constant on Javascript code
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44084141
has comment: http://stackoverflow.com/comment/44095066
type: UnansweredQuestion

http://stackoverflow.com/q/27957634
has answer: http://stackoverflow.com/a/28643067
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44309514
has title: How to automatically synchronize jquery grid with database table?
tagged with: jqgrid
type: Question
has body: Any jquery library supports auto synchronize between server side database table and client side jquery grid. Suppose any CRUD operation done by sever side table, it should reflect in client side grid view
tagged with: jquery-ui
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: jqwidget

http://stackoverflow.com/comment/44097429
has text: so in that function (e) i would put the html element id of my textarea, in the PHPFILE.php is where i would read the file?
type: Comment
comment on: http://stackoverflow.com/a/27846732
score: 0
type: AnswerComment

http://stackoverflow.com/a/27830400
answers question: http://stackoverflow.com/q/27830177
downvote count: 0
has body: This may be a bit of a stretch, but assuming all the elements have the same class (maybe it even is .sliding-panels?) and are in order, i.e. &lt;div class="panel1"&gt;&lt;/div&gt; &lt;div class="panel2"&gt;&lt;/div&gt; &lt;div class="panel3"&gt;&lt;/div&gt; ... you can do: var $panels = $(".sliding-panels").click(function() { var n = $(this).attr("number") - 1; $panels.toggleClass(function(index) { return index === n ? 'panel-active' : (index &lt; n ? 'panel-push-left' : 'panel-push-right'); }); }); Let jQuery handle the element traversal.
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44144828
has text: with pdo and bindparam. ex $stmt->bindParam(':title', $_POST['title']); All the data is coming back though (i can see it in my browser tool and on the screen), it's just not returning to the page it's sent from
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27870973

http://stackoverflow.com/comment/44023637
type: QuestionComment
has text: Its just a console log aka console.log("HOURSSSS:+Hours);
score: 0
comment on: http://stackoverflow.com/q/27807279
type: Comment

http://stackoverflow.com/a/27934051
accepted answer of: http://stackoverflow.com/q/27933955
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44265791
answers question: http://stackoverflow.com/q/27933955
score: 0
has body: You can use extend() with an empty object to clone the unit object so that each array doesn't refer to the same instance: $(this).next('tr').children('td').each(function () { input = $(this).children('input'); units[i] = $.extend({}, unit); units[i]['barcode'] = input.val(); i++; }); This should work fine now with each object unique, including the barcodes.

http://stackoverflow.com/q/27895478
tagged with: regex
score: 2
has title: Javascript RegExp - I'm getting cross-eyed
downvote count: 0
type: Question
tagged with: javascript
upvote count: 2
answer count: 1
has body: This seems so simple, but I just can't get it right. I'm trying to parse a parameter to a function, that is (a) a filename with an embedded WIDTHxHEIGHT --or -- (b) a filename without WIDTHxHEIGHT --or-- (c) just a WIDTHxHEIGHT It seems like I should be able to do this with a singe RegExp... // PROCESS CORRECT SYNTAX chopUp("abc300x150.jpg"); // should return: abc, 300, 150, .jpg - works chopUp("abc.jpg"); // should return: abc, , , .jpg - doesn't work chopUp("300x150"); // should return: , 300, 150, - works // PROCESS "IN-CORRECT" SYNTAX chopUp("abc300x.jpg"); // should return: abc300x, , , .jpg - doesn't work chopUp("abcx150.jpg"); // should return: abcx150, , , .jpg - doesn't work function chopUp(str) { var m = str.match( /(.*?)(?:(\d{2,5})x(\d{2,5})*)((?:\..{3,4})*)/ ); if (m != null) { console.log("Prefix: " + m[1] + "\nWidth: " + m[2] + "\nHeight: " + m[3] + "\ndotExt: " + m[4] + "\n"); } else { console.log("m is null"); } return(m); } // function chopUp
favorite count: 0
has answer: http://stackoverflow.com/a/27900122
type: UnansweredQuestion

http://stackoverflow.com/q/27918043
has comment: http://stackoverflow.com/comment/44234830
has comment: http://stackoverflow.com/comment/44235706
has comment: http://stackoverflow.com/comment/44234448
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44235896
has title: How to use ng-show with a function in the controller that returns true/false
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44234438
has comment: http://stackoverflow.com/comment/44235291
has comment: http://stackoverflow.com/comment/44234400
has answer: http://stackoverflow.com/a/27918189
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27918189
answer count: 1
has body: I'm new to AngularJS and I'm having trouble with understanding the working of ng-show attribute. I'm trying to create a modal pop-up in a video,which shows when the current time of the video is 7 or 14 or 21 seconds.So I'm using ng-show="dc.timeCheck()" where 'dc' is my controller and 'timeCheck()' my function within the controller that returns 'true' and pauses the video if the time is one of the mentioned else it returns false and plays the video. But i'm unable to make it work and I have failed to see the reason why despite of going through various docs and tutorials! My code HTML: {{ques[x]}} Submit JAVASCRIPT: var video = videojs('myVideo'); var timeCheck=function(){ var currT=Math.floor(video.currentTime()); if ((currT===7||currT===14||currT===21 )&& currT!=0) { video.pause(); return true; } else { video.play(); return false; } }; ` for full code the pastebin links are JavaScript: http://pastebin.com/ruY5bhhG HTML: http://pastebin.com/sNxK2K4i `

http://stackoverflow.com/comment/44291190
score: 0
has text: Unless there's an issue with the printer. check the printer docs, and see if there's any info there. I was working with a dot matrix printer a while back and strange things were happening with it. It could be that it needs to 'clear cache' or 'update readings' or the like.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27947869

http://stackoverflow.com/a/27859357
downvote count: 0
has body: Let's simplify: ;(function(root) { ... }(this)); So, we have a function that takes an argument called root. This function is being immediately invoked (http://benalman.com/news/2010/11/immediately-invoked-function-expression/), and we are passing the value this to it. In this context, this is your global object. If you are using a browser, your global object will be window. So, if you are indeed using a browser: root.he = he; is actually the same as: window.he = he; And note, we don't necessarily need to be using a browser, thanks to platforms like Node there are now other contexts where the this global object is something other than window. That's why the other doesn't specify window explicitly and goes through this particular exercise.
answers question: http://stackoverflow.com/q/27859227
score: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/27859227
has comment: http://stackoverflow.com/comment/44121539
upvote count: 5
type: AcceptedAnswer

http://stackoverflow.com/q/27827972
answer count: 1
tagged with: javascript
score: 0
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27830967
type: Question
has title: Making an image slide with a timer?
has body: How would I go about making a set of images slide after a video has been either exited out of or is no longer running? Here is the site in question: http://www.mcbridesrv.voicemktg.com/ When you visit it, you get a video that pops up. How can I get the image slides to slide every 7 seconds after you get out of the video popup? Currently just using CSS - Would I have to use JS or could I use CSS animation to make it slide every few seconds? Even if the video is playing - as a last resort I guess. Might be a really dumb question. Thanks.

http://stackoverflow.com/a/27880749
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/27880694
downvote count: 0
type: Answer
has body: You could use the :not() pseudo class to exclude it: events: { 'click .table-link:not(.danger)': 'edit', 'click .table-link.danger': 'del' } I'd suggest adding an additional class to the element, as stealthwang suggests, though.

http://stackoverflow.com/q/27805015
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I have a list from MySQL which I would like to add links to. When clicked the link will load information regarding the item. EG I have a database with a list of cars and specifications. When clicking an item in the list, properties regarding the car will load. So far I have managed to get it working for the first list item, but not sure how to iterate this to the other options: Code I am using to achieve this: $(document).ready(function () { $('#clickthrough2').click(function () { $.post('referrer-ajax2.php', { clickthrough: $('#clickthrough').val(), ref_date_from2: $('#ref_date_from2').val(), ref_date_to2: $('#ref_date_to2').val() }, function (data) { $('#car1').html(data); }); }); }); HTML: Select Car <?php $result=$ mysqli->query($sql); if($result->num_rows === 0) { echo 'No Cars in selected time period.'; } else { while ($row = $result->fetch_array()) { ?> <input type="hidden" id="ref_date_from2" value="<?php echo $date_from; ?>" /> <input type="hidden" id="ref_date_to2" value="<?php echo $date_to; ?>" /> <input type="hidden" id="clickthrough" value="<?php echo $row['car_name'] ?>" /> <?php echo $row['car_name'] ?> <?php echo $row[ 'quantity']; ?> <?php } } ?> HTML After: Car Details <?php $result=$ mysqli->query($sql); if($result->num_rows === 0) { echo 'No Cars in selected time period.'; } else { while ($row = $result->fetch_array()) { ?> <input type="hidden" id="ref_date_from2" value="<?php echo $date_from; ?>" /> <input type="hidden" id="ref_date_to2" value="<?php echo $date_to; ?>" /> <input type="hidden" id="clickthrough" value="<?php echo $row['car_details'] ?>" /> <?php echo $row['car_details'] ?> <?php echo $row[ 'quantity']; ?> <?php } } ?> If someone could help point me in the correct direction I would be very grateful. Love using jQuery but trying to understand it better. EDIT: I have been scouring Google and have found lots of examples of running queries following the click of 1 button - such as this - but I cannot find out how to iterate that proce…
upvote count: 1
linked to: http://stackoverflow.com/q/16707648
favorite count: 0
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27819340
has title: Dynamic Ajax MySQL List with Clickthrough
downvote count: 0
score: 1
tagged with: mysql
type: Question
has answer: http://stackoverflow.com/a/27819340
answer count: 1

http://stackoverflow.com/a/27845831
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27845570
score: 6
accepted answer of: http://stackoverflow.com/q/27845570
has body: We will create a flag to check if the button has been clicked or not and then if it was clicked we will disable it and if not then it will be clicked var clicked = false; $('header.div.nav.ul li').first().find('a').on("click", function (e) { if(clicked===false){ clicked=true; }else{ e.preventDefault(); } });
type: AcceptedAnswer
upvote count: 6

http://stackoverflow.com/comment/44222753
comment on: http://stackoverflow.com/q/27900384
has text: Look the comment i wrote to user @chsdk and it will help you understand what i want to say ;)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27840399
answers question: http://stackoverflow.com/q/27840274
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44084410
score: 2
upvote count: 2
has body: To link the text of the selected option to the corresponding property; $('.Bx').css('background', myArray[$("#select option:selected").text()][0]);
has comment: http://stackoverflow.com/comment/44084359

http://stackoverflow.com/q/27803817
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44017399
has title: want to reset only the last newly inserted dynamically block on the click of button
has answer: http://stackoverflow.com/a/27816845
score: 0
has answer: http://stackoverflow.com/a/27804565
has comment: http://stackoverflow.com/comment/44016898
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44039163
tagged with: http://stackoverflow.com/tag/html
has body: var qBlock='&lt;form id="resetblock"&gt;&lt;div class="newqandaBlock"&gt;&lt;div class="input-group margin-bottom-20"&gt;&lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-question"&gt;&lt;/i&gt;&lt;/span&gt;&lt;input type="text" class="form-control" placeholder="Question Asked "&gt;&lt;button type="button" class="btn btn-purple closequest" style="position: absolute;top: 3px;"&gt;&lt;span&gt; &lt;i class="fa fa-close"&gt;&lt;/i&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt; &lt;div class="input-group margin-bottom-20"&gt; &lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-reply"&gt;&lt;/i&gt;&lt;/span&gt;&lt;textarea rows="3" class="form-control" name="info" placeholder="Your Answer"&gt;&lt;/textarea&gt; &lt;/div&gt;&lt;div class="input-group margin-bottom-20"&gt;&lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-comments"&gt;&lt;/i&gt;&lt;/span&gt;&lt;textarea rows="3" class="form-control" name="info" placeholder="Add Your Comments"&gt;&lt;/textarea&gt; &lt;/div&gt;&lt;/div&gt;&lt;/form&gt;'; $("#addQuestion").on("click",function(){ $(qBlock).insertAfter(".qandaBlock"); }); $("#resetblock").on("click",'.closequest', function(){ alert("Do you really want to remove the question?!?"); $(this).closest(".newqandaBlock").remove(); }); $("#resetblock").on("click",'.resetlatest', function(){ alert("Do you really want to reset the question?!?"); $(this).closest('form').find("input[type=text], textarea").val(""); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;html&gt; &lt;body&gt; &lt;form id="resetblock" name="resetblock" &gt; &lt;div class="qandaBlock"&gt; &lt;div class="input-group margin-bottom-20"&gt; &lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-question"&gt;&lt;/i&gt;&lt;/span&gt; &lt;input type="text" class="form-control" placeholder="Question Asked "&gt; &lt;/div&gt; &lt;div class="input-group margin-bottom-20"&gt; &lt;span class="input-group-addon pur…

http://stackoverflow.com/comment/44094335
type: Comment
comment on: http://stackoverflow.com/a/27844922
score: 0
type: AnswerComment
has text: On the fact that he wants to mark/unmark elements based on clicking on links - which is accordion menu (even when not used as menu!).

java
tags question: http://stackoverflow.com/q/27861333
tags question: http://stackoverflow.com/q/27851069
tags question: http://stackoverflow.com/q/27949434
tags question: http://stackoverflow.com/q/27827008
tags question: http://stackoverflow.com/q/27909411
tags question: http://stackoverflow.com/q/27895462
tags question: http://stackoverflow.com/q/27857665
tags question: http://stackoverflow.com/q/27914668
tags question: http://stackoverflow.com/q/27897389
tags question: http://stackoverflow.com/q/27875190
tags question: http://stackoverflow.com/q/27833119
tags question: http://stackoverflow.com/q/27888056
tags question: http://stackoverflow.com/q/27946859
tags question: http://stackoverflow.com/q/27925219
tags question: http://stackoverflow.com/q/27921540
tags question: http://stackoverflow.com/q/27915261
tags question: http://stackoverflow.com/q/27828374
tags question: http://stackoverflow.com/q/27836554
tags question: http://stackoverflow.com/q/27953402
tags question: http://stackoverflow.com/q/27904638
tags question: http://stackoverflow.com/q/27869316
tags question: http://stackoverflow.com/q/27901038
tags question: http://stackoverflow.com/q/27832266
tags question: http://stackoverflow.com/q/27833184
tags question: http://stackoverflow.com/q/27957305
tags question: http://stackoverflow.com/q/27850382
tags question: http://stackoverflow.com/q/27930199
tags question: http://stackoverflow.com/q/27833036
tags question: http://stackoverflow.com/q/27908520
tags question: http://stackoverflow.com/q/27904518
tags question: http://stackoverflow.com/q/27840390
tags question: http://stackoverflow.com/q/27823047
tags question: http://stackoverflow.com/q/27837289
tags question: http://stackoverflow.com/q/27901151
tags question: http://stackoverflow.com/q/27929224
tags question: http://stackoverflow.com/q/27948209
tags question: http://stackoverflow.com/q/27922810
tags question: http://stackoverflow.com/q/27857102
tags question: http://stackoverflow.com/q/27846377
tags question: http://stackoverflow.com/q/27876256
tags question: http://stackoverflow.com/q/27870181
tags question: http://stackoverflow.com/q/27838326
tags question: http://stackoverflow.com/q/27830026
tags question: http://stackoverflow.com/q/27858282
tags question: http://stackoverflow.com/q/27820855
tag name: java
tags question: http://stackoverflow.com/q/27839870
tags question: http://stackoverflow.com/q/27810294
tags question: http://stackoverflow.com/q/27899189
tags question: http://stackoverflow.com/q/27956690
tags question: http://stackoverflow.com/q/27821400
tags question: http://stackoverflow.com/q/27883399
tags question: http://stackoverflow.com/q/27962599
tags question: http://stackoverflow.com/q/27846536
tags question: http://stackoverflow.com/q/27841988
tags question: http://stackoverflow.com/q/27921129
tags question: http://stackoverflow.com/q/27895987
tags question: http://stackoverflow.com/q/27959052
tags question: http://stackoverflow.com/q/27867424
tags question: http://stackoverflow.com/q/27839766
tags question: http://stackoverflow.com/q/27810033
tags question: http://stackoverflow.com/q/27832133
tags question: http://stackoverflow.com/q/27896103
tags question: http://stackoverflow.com/q/27872879
type: Tag
tags question: http://stackoverflow.com/q/27823764
tags question: http://stackoverflow.com/q/27834360
tags question: http://stackoverflow.com/q/27886746
tags question: http://stackoverflow.com/q/27836161

http://stackoverflow.com/q/27935908
has answer: http://stackoverflow.com/a/27936083
type: UnansweredQuestion
has title: .velocity("scroll") does not work properly if used inside a $window.scroll() function
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 0
score: 1
has body: Lately, I have been working on a website where I want to shoot specific effects at different scroll positions. I am using Velocity JS for the animation.There is an element where I want to have an automatic scroll to another specific scroll position. This can be easily achieved using Velocity JS. Below is the piece of code which illustrates the case: $(window).scroll(function(){ if($(window.scrollTop() &gt; 100) {$('#element').velocity('scroll',{duration: 1000, offset:500});} }); So now when the scroll position is more than 100 the element will be automatically scrolled to an offset of 500.Now the problem here is that once the animation is executed the scroll gets stuck and gets unstable. So the question is, How to get rid of this issue ? Why is this happening ? Is there an alternate way to achieve what I want? Here is a Fiddle that elaborates the issue: http://jsfiddle.net/zubairanwar2/65xCP/58/ I am fairly new in using velocity Js so please advice me and help me. Thank you !
tagged with: scroll
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28275137
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/44268908
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/27853367
has comment: http://stackoverflow.com/comment/44131812
upvote count: 2
has body: This generally is not a highly recommended way to accomplish this, but I have found edge cases where this can be handy- especially when integrating code that is outside of Angular. I crafted a light version fiddle of your code to provide a working demo which you can feel free to build on from there. Basically, I am grabbing your element by id and 'digging' into it's scope, then calling the scope function. In my example, I call your chart_area like angular .element(document.getElementById('dash')).scope().addWidgetInternal(); .scope() .addWidgetInternal(message); message in this case is just a string I am sending from the UI and logging out in addWidgetInternal() in the directive, called from the controller JSFiddle Link
accepted answer of: http://stackoverflow.com/q/27848095
has comment: http://stackoverflow.com/comment/44131143
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27848095
type: Answer
has comment: http://stackoverflow.com/comment/44131575
has comment: http://stackoverflow.com/comment/44131699
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44144253
has comment: http://stackoverflow.com/comment/44129841

http://stackoverflow.com/comment/44051359
has text: @Don: Yeah, that is a problem that I noticed shortly after posting. The problem is that I don't believe Javascript's regex support recursive matching to any arbitrary depth.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27822541

http://stackoverflow.com/a/57865551
downvote count: 0
upvote count: 2
has body: use the Async module, Its easy and best. async.each(array, function (element, callback) { callback() }, async function (err) { console.log("array ends") });
type: Answer
answers question: http://stackoverflow.com/q/27914209
score: 2

http://stackoverflow.com/comment/44153453
has text: Added an extra line, it tells your problem
comment on: http://stackoverflow.com/a/27875971
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27846711
has answer: http://stackoverflow.com/a/27846818
type: UnansweredQuestion
has title: How do I specify my toggle button to open for my menu?
tagged with: toggle
type: Question
answer count: 2
tagged with: mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44097230
score: 0
tagged with: menu
has body: I am trying to make my mobile navigation open up when you click the toggle button (http://international-aset.com/intaset/); however for some reason it doesn't work when you click the button itself but it works when you click the SURROUNDING area of the button. EDIT: What I am trying to do is make my navigation open up by clicking the toggle button, which would then enable the toggle animation. Right now, the toggle button works but my navigation doesn't open up when I click the button. The only time my navigation opens up is when I click the surrounding area (white space) around my toggle button. I hope this makes more sense, if not please let me know and I will try my best to be more clear. Here is the HTML code: Here is the JS: Thank you for your help!
has comment: http://stackoverflow.com/comment/44097298
has answer: http://stackoverflow.com/a/27846881

http://stackoverflow.com/q/27916660
tagged with: jquery
score: 0
has body: I want to edit coordinate. such as input logitude and latitute, but I dont know how to link between javasciprt and html. when I fill in input(Textbox HTML) latitude and logitute, It will display directly map on html page. Thanks for your reply Regards, Fizul
has answer: http://stackoverflow.com/a/27917278
answer count: 1
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: How to edit latest google map
type: Question
accepted answer: http://stackoverflow.com/a/27917278
tagged with: javascript

http://stackoverflow.com/a/27855849
score: 0
answers question: http://stackoverflow.com/q/27855665
has body: $scope.isClick = false; $scope.countLikes = function (e) { $scope.isClick = true; }
type: Answer

php
tags question: http://stackoverflow.com/q/27880127
tags question: http://stackoverflow.com/q/27942599
tags question: http://stackoverflow.com/q/27953788
tags question: http://stackoverflow.com/q/27897851
tags question: http://stackoverflow.com/q/27876608
tags question: http://stackoverflow.com/q/27939742
tags question: http://stackoverflow.com/q/27826148
tags question: http://stackoverflow.com/q/27881445
tags question: http://stackoverflow.com/q/27963384
tags question: http://stackoverflow.com/q/27865670
tags question: http://stackoverflow.com/q/27851053
tags question: http://stackoverflow.com/q/27908707
tags question: http://stackoverflow.com/q/27860164
tags question: http://stackoverflow.com/q/27937743
tags question: http://stackoverflow.com/q/27884001
tags question: http://stackoverflow.com/q/27888785
tags question: http://stackoverflow.com/q/27887862
tags question: http://stackoverflow.com/q/27953389
tags question: http://stackoverflow.com/q/27813603
tags question: http://stackoverflow.com/q/27930441
tags question: http://stackoverflow.com/q/27813707
tags question: http://stackoverflow.com/q/27922530
tags question: http://stackoverflow.com/q/27861936
tags question: http://stackoverflow.com/q/27896953
tags question: http://stackoverflow.com/q/27935339
tags question: http://stackoverflow.com/q/27915217
tags question: http://stackoverflow.com/q/27928041
tags question: http://stackoverflow.com/q/27916977
tags question: http://stackoverflow.com/q/27948638
tags question: http://stackoverflow.com/q/27906105
tags question: http://stackoverflow.com/q/27869381
tags question: http://stackoverflow.com/q/27805015
tags question: http://stackoverflow.com/q/27834429
tags question: http://stackoverflow.com/q/27818450
tags question: http://stackoverflow.com/q/27835488
tags question: http://stackoverflow.com/q/27877053
tags question: http://stackoverflow.com/q/27914590
tags question: http://stackoverflow.com/q/27879488
tags question: http://stackoverflow.com/q/27940570
tags question: http://stackoverflow.com/q/27853912
tags question: http://stackoverflow.com/q/27878485
tags question: http://stackoverflow.com/q/27931920
tags question: http://stackoverflow.com/q/27919759
tags question: http://stackoverflow.com/q/27869088
tags question: http://stackoverflow.com/q/27861740
tags question: http://stackoverflow.com/q/27856874
tags question: http://stackoverflow.com/q/27812608
tags question: http://stackoverflow.com/q/27930094
tags question: http://stackoverflow.com/q/27847747
tags question: http://stackoverflow.com/q/27919645
tags question: http://stackoverflow.com/q/27857045
tags question: http://stackoverflow.com/q/27805222
tags question: http://stackoverflow.com/q/27938525
tags question: http://stackoverflow.com/q/27853969
tags question: http://stackoverflow.com/q/27844311
tags question: http://stackoverflow.com/q/27912207
tags question: http://stackoverflow.com/q/27921326
tags question: http://stackoverflow.com/q/27864109
tags question: http://stackoverflow.com/q/27840668
tags question: http://stackoverflow.com/q/27824168
tags question: http://stackoverflow.com/q/27884061
tags question: http://stackoverflow.com/q/27821982
tags question: http://stackoverflow.com/q/27875109
tags question: http://stackoverflow.com/q/27939318
tags question: http://stackoverflow.com/q/27869935
tags question: http://stackoverflow.com/q/27952164
tags question: http://stackoverflow.com/q/27882342
tags question: http://stackoverflow.com/q/27899498
tags question: http://stackoverflow.com/q/27841959
tags question: http://stackoverflow.com/q/27891635
tags question: http://stackoverflow.com/q/27890714
tags question: http://stackoverflow.com/q/27957178
tags question: http://stackoverflow.com/q/27944570
tags question: http://stackoverflow.com/q/27939242
tags question: http://stackoverflow.com/q/27831622
tags question: http://stackoverflow.com/q/27920422
tags question: http://stackoverflow.com/q/27931177
tags question: http://stackoverflow.com/q/27956163
tags question: http://stackoverflow.com/q/27859671
tags question: http://stackoverflow.com/q/27824699

http://stackoverflow.com/comment/44251614
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27927249
has text: You may have to do $scope.$apply() if you are looking for some scope binding updates that happens inside showNotif.
type: QuestionComment

http://stackoverflow.com/a/27894932
has comment: http://stackoverflow.com/comment/44195901
upvote count: 0
answers question: http://stackoverflow.com/q/27894900
has comment: http://stackoverflow.com/comment/44190859
type: Answer
has body: try using a:hover{ background-image:url(img/messages-blue.svg); } in the css.
downvote count: 2
score: -2

http://stackoverflow.com/q/27929728
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44258462
tagged with: google-maps-api-3
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has body: We have a google maps V3 map. With a ground overlay in a function. We have a menu with items and i want when clicked on a link the groundoverlay appear and when click again, dissapear. This is my code so far but it doesn't work yet. Any tips ? function Radarlaag() { radarOverlay.setMap(null); radarOverlay.setMap(map); } And this is my HTML code: Radar Thanks!
linked to: http://stackoverflow.com/q/9899372
has title: Toggle groundoverlay in google maps with link
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27930944
accepted answer: http://stackoverflow.com/a/27930944
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44258180

http://stackoverflow.com/a/27893048
accepted answer of: http://stackoverflow.com/q/27892282
answers question: http://stackoverflow.com/q/27892282
type: Answer
has comment: http://stackoverflow.com/comment/132423050
score: 4
upvote count: 4
has body: "createProperties" in the documentation is the dictionary that is passed to the chrome.contextMenus.create method (i.e. that thing with "title", "contexts", etc.) The onclick event description of chrome.contextMenus.create states that the function receives two parameters. The first parameter ("info") is a dictionary with information about the selected text. The second parameter ("tab") contains information about the tab (in your case, you don't need though). The "info" dictionary has a property "selectionText" that holds the selected text when the context menu item was clicked. This can be used in your code as follows: function copyToClipboard(info) { var tempNode = document.getElementById("temp"); tempNode.value = info.selectionText; // &lt;-- Selected text tempNode.select(); document.execCommand('copy', false, null); } That would solve your immediate question. Besides that, your extension can be improved by converting your background page to an event page. The main benefit of event pages over background pages is that your extension will not unnecessarily use memory while sitting idle in the background. // background.js // Register context menu chrome.runtime.onInstalled.addListener(function() { chrome.contextMenus.create({ "id": "some id", // Required for event pages "title": "Copy selected text to clipboard", "contexts": ["editable"], // "onclick" : ... // Removed in favor of chrome.contextMenus.onClicked }); }); // Register a contextmenu click handler. chrome.contextMenus.onClicked.addListener(copyToClipboard); Here is a minimal manifest.json (note the "persistent": false key, which specifies that you want to use an event page) { "manifest_version": 2, "name": "Copy selected text to clipboard", "version": "1.0", "permissions": [ "contextMenus", "clipboardWrite" ], "background": { "page": "background.html", "persistent": false } }
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27862372
linked to: http://stackoverflow.com/q/26979538
tagged with: javascript
tagged with: jquery
tagged with: callback
favorite count: 0
has title: Is there any JavaScript/Underscore/jQuery shortcut for function(i,x) { x(); }?
has comment: http://stackoverflow.com/comment/44127026
has comment: http://stackoverflow.com/comment/44127143
has answer: http://stackoverflow.com/a/27862698
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27862507
has body: I have a array of listener functions, like: var tab = [ function() {console.log(1);} , function(){console.log(2);} ] And I can notify all my listeners without writing a loop, by: $.each( tab , function(i,x) { x(); } ); Eventually, I can extract my function to common place: $.each( tab , myLib.call ); But is there any shortcut for doing that array call in JS / jQuery / underscore?
has answer: http://stackoverflow.com/a/27862507
upvote count: 1
type: Question
tagged with: underscore.js
score: 1
accepted answer: http://stackoverflow.com/a/27862698
answer count: 2
tagged with: arrays
downvote count: 0

http://stackoverflow.com/a/27817916
has comment: http://stackoverflow.com/comment/44041732
downvote count: 0
has comment: http://stackoverflow.com/comment/44042076
answers question: http://stackoverflow.com/q/27817896
type: Answer
score: 2
upvote count: 2
has body: event is not defined. You should change $(event.target) to $(e.target). More - you shouldn't use inline JavaScript in your code. My solution is to rewrite your code to look like: var demoMap = '&lt;table class="popup"&gt;&lt;tr&gt;&lt;td&gt;; // Why HTML string in JS? And rest of JS: $('table.popup').on('click', closePopup); function closePopup(e) { var $this = $(this); if ( $this.closest("#map").get(0) == null ) { $this.fadeOut(500, function () { $this.remove(); }); } }

http://stackoverflow.com/comment/44302872
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27953860
type: Comment
has text: @PeterOlson I was more-or-less looking for a better way to do what I did above / confirmation that it is the correct way. Should have posted on code review.

http://stackoverflow.com/comment/44083513
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27839264
type: Comment
has text: If you are agin push new object to `obj` by `obj.push()` than it will give output same as what you want.

http://stackoverflow.com/q/27942209
upvote count: 8
type: Question
has comment: http://stackoverflow.com/comment/44353798
downvote count: 2
has title: How can i apply a draggable directive to bootstrap modal using angularJS?
tagged with: javascript
has body: I am using bootstrap modal in my Angular Application, it works fine. I need to make it draggable and resizeable, so i have defined a directive. The issue now is it getting applied to the content inside the modal window, hence the modal window becomes transparent. how can i assign the draggable directive to the modal window when opening the window? Here is the code, HTML: &lt;div ng-controller="CustomWidgetCtrl"&gt; &lt;div class="box-header-btns pull-right" style="top:10px" &gt; &lt;a title="settings" ng-click="openSettings(widget)"&gt;&lt;i class="glyphicon glyphicon-cog"&gt;&lt;/i&gt;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; App.js: var routerApp = angular.module('DiginRt', ['ui.bootstrap','ngRoute']); routerApp.controller('CustomWidgetCtrl', ['$scope', '$modal', function($scope, $modal) { $scope.openSettings = function(widget) { $modal.open({ scope: $scope, templateUrl: 'chart_settings.html', controller: 'chartSettingsCtrl', resolve: { widget: function() { return widget; } } }); }; } ]) Chart Settings is another HTML page. Here is my Draggable directive. UPDATE: I have update the issue with Plunker Issue:
has answer: http://stackoverflow.com/a/40431949
has answer: http://stackoverflow.com/a/40685569
tagged with: http://stackoverflow.com/tag/html
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/44353762
tagged with: angularjs
tagged with: twitter-bootstrap
score: 6
has answer: http://stackoverflow.com/a/27981428
accepted answer: http://stackoverflow.com/a/27981428
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/32379006
possible better answer: http://stackoverflow.com/a/32379006

http://stackoverflow.com/comment/109003955
score: 7
type: AnswerComment
type: Comment
has text: That's great for dev, but doesn't help with production builds.
comment on: http://stackoverflow.com/a/46155087

http://stackoverflow.com/q/27876475
has comment: http://stackoverflow.com/comment/44154502
has comment: http://stackoverflow.com/comment/44154385
tagged with: javascript
has comment: http://stackoverflow.com/comment/44154540
score: 0
has body: I have a table with many tbodies inside. For example: 1 2 3 I need these tbody for grouping rows with span. How can I get certain tbody index in table via js? I mean: var tbody=....; var table=....; var tbodyIndex=? For example, for rows we can use rowIndex, but for tbodies? EDIT Special edit for some users: var tbody=document.getElementById("tbodyId"); var table=document.getElementById("tableId"); var tbodyIndex=?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44154622
favorite count: 0
has answer: http://stackoverflow.com/a/27876654
has title: JS: how to get tbody index in table
has comment: http://stackoverflow.com/comment/44154557
upvote count: 1
has comment: http://stackoverflow.com/comment/44154762
linked to: http://stackoverflow.com/q/13887162
has comment: http://stackoverflow.com/comment/44154580
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44154477
has comment: http://stackoverflow.com/comment/44154402
has comment: http://stackoverflow.com/comment/44154948
downvote count: 1
has comment: http://stackoverflow.com/comment/44154561
type: Question
accepted answer: http://stackoverflow.com/a/27876654

http://stackoverflow.com/comment/82771667
type: Comment
comment on: http://stackoverflow.com/a/27889252
has text: I use `.jsx` for react components, following the convention of saving coffeescript files as `.coffee`. Yes, it will eventually compile to javascript, but using the appropriate file extension to describe what is actually inside the file is a better convention
type: AnswerComment
score: 5

http://stackoverflow.com/comment/44102627
type: QuestionComment
has text: ` ` there are three `///` try adding two`2`
comment on: http://stackoverflow.com/q/27849306
score: 0
type: Comment

http://stackoverflow.com/comment/44213687
type: Comment
type: QuestionComment
score: 6
has text: No there isn't. However, if you have to perform this test multiple times, build a `slug -> object` map so that you can simply lookup `slug`.
comment on: http://stackoverflow.com/q/27907213

http://stackoverflow.com/comment/44044472
score: 0
type: Comment
type: QuestionComment
has text: @devqon Yes checked console their are not any kind of error display
comment on: http://stackoverflow.com/q/27818943

http://stackoverflow.com/comment/44200720
type: QuestionComment
comment on: http://stackoverflow.com/q/27900469
has text: If you use radio button in a form, you will be able to achieve this without using JS
score: 0
type: Comment

http://stackoverflow.com/comment/44100629
type: Comment
has text: link shown has all the answers you need though ... http://stackoverflow.com/questions/1129216/sorting-objects-in-an-array-by-a-field-value-in-javascript
comment on: http://stackoverflow.com/q/27848278
score: 0
type: QuestionComment

http://stackoverflow.com/a/27949575
type: Answer
answers question: http://stackoverflow.com/q/27949539
score: 0
has comment: http://stackoverflow.com/comment/44295183
has body: Wrap your code in a function and use that inside setInterval method: var interval_time = 5000;//in milliseconds setInterval(your_function,interval_time); function your_function(){ var imgCount = 3; var dir = 'images/'; var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1; var images = new Array images[1] = "1.jpg", images[2] = "2.jpg", images[3] = "3.jpg", document.getElementById("hero").style.backgroundImage = "url(" + dir + images[randomCount] + ")"; } Now, after each interval_time your_function would run.

http://stackoverflow.com/a/52003539
has body: Here how I have done the same thing: _.keys(_.pick(_.countBy(somevalue, b=&gt; b.name), (value, key, object) =&gt; value &gt; 1))
answers question: http://stackoverflow.com/q/27854705
score: 0
type: Answer

http://stackoverflow.com/comment/44133472
has text: I don't see anything about jQuery mentioned in the OP; edited tags. Thanks.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27864314

http://stackoverflow.com/q/27962476
has title: Google Maps Multiple Marker with Custom Markers and OnClick Zoom
has body: I am trying to place multiple custom markers and what i want is zoom in and focus the location of clicked marker. So far, i've partly succeed but there is two problem. First of all when i clicked on a marker and zoom in map is constantly shaking and second problem is i could only manage ot focus on one location. Even if i click another, map is focusing the first one. You can see my code live in here: live map And here is my code: JS CSS HTML
type: Question
accepted answer: http://stackoverflow.com/a/27980632
tagged with: google-maps-api-3
score: 0
tagged with: google-maps
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27980632
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/q/27953048
has body: I'm trying to achieve an array with items that displays as a title and image and when the user click the title the item should be added to a div. However, I can´t make it to work as when I click on "Add me", there is only a blank item added, with no image and no title. I got the delete-function to work but not the add-function. Here is what I got: The "Add me"-button and the list of items {{item.title}} x Add Me The array var myApp = angular.module("myApp", []); myApp.factory("items", function () { var items = {}; items.data = [{ title: "Item 1", image: "img/item01.jpg" }, { title: "Item 2", image: "img/item02.jpg" }, { title: "Item 3", image: "img/item03.jpg" }, { title: "Item 4", image: "img/item04.jpg" }]; return items; }); And the functions for add and delete function ItemsController($scope, items) { $scope.items = items; $scope.deleteItem = function (index) { items.data.splice(index, 1); } $scope.addItem = function () { items.data.push({ title: $scope.items.title }); } }
downvote count: 0
has title: Adding and removing items from ng-repeat, simple cart implementation, using angular
has comment: http://stackoverflow.com/comment/44301509
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44301427
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44301264
tagged with: arrays
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27953228
accepted answer: http://stackoverflow.com/a/27953228
tagged with: angularjs-ng-repeat
score: 2
tagged with: angularjs

http://stackoverflow.com/comment/44114330
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27855375
has text: @BhojendraSah - you're close, just remove the hyphen in the function name.

http://stackoverflow.com/comment/44039743
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27816001
has text: Oooops, now I see where my error was when I tried it before! I lost "" in name=. Thanks.
type: AnswerComment

http://stackoverflow.com/comment/44156471
type: QuestionComment
comment on: http://stackoverflow.com/q/27877353
score: 0
has text: @RoryMcCrossan There's probably more than one `tbody` in the table.
type: Comment

http://stackoverflow.com/comment/44162762
comment on: http://stackoverflow.com/q/27880534
score: 0
type: Comment
type: QuestionComment
has text: Good point, thanks. @p.s.w.g Though, given that Wolfram guys have strong math skills, it could some difficult method.

http://stackoverflow.com/q/27854446
type: Question
has title: How to set read only false in select box and When a checkbox is selected it would be editable. In my jquery code disable is not working
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44112526
score: 0
has answer: http://stackoverflow.com/a/27854481
answer count: 1
has body: How to make select box is disabled and When a check box is selected it would be editable. In my java script code disable is not working. Morning After Noon Full Day jQuery if ($("#" + id).is(':checked')) { $("#ShiftType").attr('disable', false); }
type: UnansweredQuestion
tagged with: checkbox
has comment: http://stackoverflow.com/comment/44112476
has comment: http://stackoverflow.com/comment/44113297

http://stackoverflow.com/a/27983157
type: Answer
accepted answer of: http://stackoverflow.com/q/27914055
answers question: http://stackoverflow.com/q/27914055
score: 0
has body: Ok it is working now. The solution was: var newFileName = 'N' + result + '_' + agent + '_' + todayDate + '_' + newURI + '_' + depot + '_' + date; localStorage.setItem('newFileName', localStorage.getItem('newFileName') + "," + newFileName ); Thanx to all for the help.
type: AcceptedAnswer

http://stackoverflow.com/comment/44147399
type: QuestionComment
comment on: http://stackoverflow.com/q/27872476
has text: you dont have enough code here. `<iframe [embed stream DOM element] ` is not valid HTML. And you set to that to `$livestream`, but then you are appending `$insaneLivestream`.
score: 0
type: Comment

http://stackoverflow.com/comment/44060741
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27827427
has text: If the two sites are on different domains, you're gonna have to use [Window.postMessage](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB0QFjAA&url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FWindow.postMessage&ei=d42tVIDoC4b4yQSU_YLQCA&usg=AFQjCNEnazVAnZe__qabZI2Vcu1R9u8b0g&sig2=oSaANLF7G504jbK2667cfA).

http://stackoverflow.com/a/27853945
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27853912
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27853912
has body: try this jQuery("#DoneBtn").click(function(){ &lt;?php $db = JFactory::getDBO(); $user = JFactory::getUser(); ?&gt; var userid = &lt;?php echo $user-&gt;id; ?&gt;; var data = $("#insertsubs_form").serialize() + "&amp;userid=" + userid; $.ajax({ data: data, type: "post", url: "../insert_subs.php", success: function(data){ alert(data); } }); })
type: Answer
score: 1

http://stackoverflow.com/comment/128400875
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/60567598
has text: @Ark-kun I see the same issue here, how can one resolve that?

http://stackoverflow.com/comment/44206483
type: Comment
has text: added more detail above.
type: AnswerComment
comment on: http://stackoverflow.com/a/27863915
score: 0

http://stackoverflow.com/q/27907196
tagged with: node.js
has body: I have these events, and I want to search for events by name by clicking on the event name. I've done all the logic of the server, but I have a problem: encode the URL. I need encode the /. If I click on any of them, will redirect me to 20/11/11%20Evento%20Free%20Pass when should be 20%2F11%2F11%20Evento%20Free%20Pass I am using Node.js. How fix that? Should i do in the client or in the server??? Update: &lt;tr class="reservas"&gt; &lt;td&gt; &lt;a class="fullEventName" href="/admin/bookings/1/&lt;%= booking[i].fullEventName %&gt;"&gt;&lt;%= booking[i].fullEventName %&gt; &lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; And: $(document).ready(function(){ $('.fullEventName').on('click', function(){ var href = $(this).attr('href'); var position = href.indexOf('='); var getDate = href.substring(position + 19); alert(getDate); var newChar = "%2F"; var changeDateFormat = getDate.split('/').join(newChar); var newLink = '/admin/bookings/1/' + changeDateFormat; $(this).attr('href', newLink); }); }); This is working, but i dont think this is the better way..
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44213789
has comment: http://stackoverflow.com/comment/44214133
has comment: http://stackoverflow.com/comment/44214213
has comment: http://stackoverflow.com/comment/44214167
has comment: http://stackoverflow.com/comment/44214222
type: Question
tagged with: encoding
has comment: http://stackoverflow.com/comment/44213618
has title: How encode / in the URL
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44213821
has comment: http://stackoverflow.com/comment/44213964
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44213975
has answer: http://stackoverflow.com/a/27907453
accepted answer: http://stackoverflow.com/a/27907453

http://stackoverflow.com/comment/44293687
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27949205
has text: [Here](http://ejohn.org/apps/workshop/adv-talk/#8) is a good resource that verifies the above claim that jQuery keeps information internal to each event. See the current slide and the next one below...
score: 0

http://stackoverflow.com/comment/44079584
type: AnswerComment
has text: put sleep after this statement map.addShape(vehicle); vehicle.setRolloverContent("Vehicle # KA05 9999");
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27834040

http://stackoverflow.com/q/27832945
has comment: http://stackoverflow.com/comment/44146498
tagged with: php
has body: I have to create search engine like in this site : http://olx.co.id . it has three keywords. First is searching by Item, second is searching by City, and the third is searching by Categories. Users can search with one keywords, two keywords, and three keywords. I did't have any Idea to do this. Here is my code but I am not sure it is working well or not. All Cities Jakarta Singapore Beijing All Categories Car Motorcycle Property Industry Elektronic & Gadget Sport <a class="search-button" href="<?php echo base_url();?>search" > my question is how how to get the value of category when user changes the value of city or get the value of city when user changes the value of category. var city; var category; var item=$('search_item').val(); $('#city li').on('click', function(){ city = $(this).text(); if(category == "") window.location.assign('<?php echo base_url()?>index.php/searching/'+city); else window.location.assign('<?php echo base_url()?>index.php/searching/'+city+'/'+category); }); $('#category li').on('click',function(){ $category = $(this).text(); if(city == "") window.location.assign('<?php echo base_url()?>index.php/searching/'+category); else window.location.assign('<?php echo base_url()?>index.php/searching/'+lokasi+'/'+kategori); }); Thanks for all comments and answers
tagged with: twitter-bootstrap
score: 0
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has title: How to get both values from dropdown menu of bootstrap
has comment: http://stackoverflow.com/comment/44073196
has answer: http://stackoverflow.com/a/27833946
tagged with: jquery
type: Question

http://stackoverflow.com/comment/137288661
comment on: http://stackoverflow.com/a/54497835
has text: @eaglei22 What I wrote was *There is still an problem with DOM event properties in that if you wanted to set up multiple event handlers, you didn't have a clean way to do that since you can only store one function reference in a given property.* This does not refer to inline HTML event attributes, this refers to using "event properties" in JavaScript. For example, if you write `element.click = foo;` and then write `element.click = bar'` the second statement overwrites the value of the `click` property set in the first statement so if the element gets clicked only `bar` would execute.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/a/27827229
upvote count: 2
answers question: http://stackoverflow.com/q/27827135
type: Answer
score: 2
downvote count: 0
has body: I'll try to tackle some of the problems with your code (in hope that they magically match your HTML): function create(){ var textbox = document.createElement("input"); var para = document.createElement("p"); para.setAttribute("id", "p"); textbox.type = 'text'; textbox.value='asdf'; textbox.setAttribute("id","textbox"); // The following is a valid way to attach an event handler: textbox.onblur = function(){ para.innerHTML = document.getElementById('textbox').value); } document.body.appendChild(textbox); }

http://stackoverflow.com/a/27857004
answers question: http://stackoverflow.com/q/27832642
has body: You can declare Cloud Code functions like outlined in the guide Bjorn posted (https://www.parse.com/docs/cloud_code_guide#cloud_code). To help you out in this case, below is the sample of a method definition that will behave like you desire. /** * Send Push Notification * Required: * tracking -- Tracking String * slug -- Slug String * channel -- Channel String */ Parse.Cloud.define("sendNotification", function(request, response) { // Obviously you don't need to assign these variables, but this is how you access the parameters passed in var tracking = request.params.tracking; var slug = request.params.slug; var channel = request.params.channel; // Send your push notification here, I'm not gonna write the whole thing for you! :) // In the callback of your push notification call: response.success(); // For a successful send and response.error() if it fails or an error occurs }); To call this method in a client, assuming you're using java since you used java syntax in your question statement, you can follow this pattern as outlined in the Cloud Code Guide (referenced earlier): HashMap&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;(); params.put("tracking", "TRACKING_STRING"); params.put("slug", "SLUG_STRING"); params.put("channel", "CHANNEL_STRING"); ParseCloud.callFunctionInBackground("sendNotification", params, new FunctionCallback&lt;Float&gt;() { void done(ParseException e) { if (e == null) { // Your function was successful } else { // Your function failed, handle the error here } } }); However, if you're simply trying to send a push notification from the client, you should probably just use Parse's built in functions outlined here: https://parse.com/docs/push_guide#sending/Android
score: 0
type: Answer

http://stackoverflow.com/comment/44049689
type: AnswerComment
has text: Another great in-depth answer. Thanks for the second day in a row!
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27809853

http://stackoverflow.com/comment/44067530
type: QuestionComment
comment on: http://stackoverflow.com/q/27830784
type: Comment
has text: Possibly a bit broad for SO? I have given a broad answer below, but maybe you could help us by showing what you've done so far, and describing precisely where you are stuck.
score: 0

http://stackoverflow.com/comment/44218144
has text: really? need a socket io? The poll (temp reading) is done from the Arduino on timed intervals if thats what you mean. My requirement is to get the sensor reading and put it to a cloud instance like Heroku.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27909076

http://stackoverflow.com/q/27812511
has body: Im new to javascript so please go gentle lol I have a function that times one field against another that the user inputs. My problem is if the number is being multiplied by 8.5 its not taking the .5 only the 8. How would I go about being able to multiply the whole number including .5 heres my function so far: function chech() { amount = parseInt(document.getElementById("amount").value) ; prev = parseInt(document.getElementById("previous").value) ; multi = amount * prev ; document.getElementById("return").value = multi ; } Ive tried googling it for a while now and cant seem to find the correct solution.
score: 0
has comment: http://stackoverflow.com/comment/44032499
has title: javascript times sum not calculating after the .
answer count: 1
has answer: http://stackoverflow.com/a/27812536
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27812536
type: Question
has comment: http://stackoverflow.com/comment/44032506
tagged with: javascript

http://stackoverflow.com/comment/44176727
type: Comment
comment on: http://stackoverflow.com/a/27887768
score: 0
type: AnswerComment
has text: really? REALLY? that was it? Tell me, what's the difference? the variable is inside the scope so why would using the full notation break it? Thanks though, that was indeed the issue... I feel stupid now.

http://stackoverflow.com/a/27896793
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: Thanks N.M! So, it looks like ArrayBuffer objects cannot be used directly, and a DataView must be created in order to use them. Below is what worked - uploadFiles: function(eve) { var fileContent = null; for(var i = 0; i &lt; this.filesToBeUploaded.length; i++){ var reader = new FileReader(); reader.onload = (function(fileToBeUploaded) { return function(e) { fileContent = e.target.result; var int8View = new Int8Array(fileContent); // now int8View object has the content of the read file! }; })(this.filesToBeUploaded[i]); reader.readAsArrayBuffer(this.filesToBeUploaded[i]); } } Refer N.M 's comments to the question for links to the relevant pages. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
accepted answer of: http://stackoverflow.com/q/27855052
answers question: http://stackoverflow.com/q/27855052

http://stackoverflow.com/comment/44210398
type: QuestionComment
comment on: http://stackoverflow.com/q/27905513
score: 0
has text: Can you show us more of your code?
type: Comment

http://stackoverflow.com/a/27844847
score: 17
accepted answer of: http://stackoverflow.com/q/27844407
has comment: http://stackoverflow.com/comment/44108906
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27844407
upvote count: 17
has comment: http://stackoverflow.com/comment/75327049
has body: A 1024 character limit on a single message isn't exactly unreasonable. Even if it was, IE offers no means of altering that limitation. Out of curiosity, why is this one big block rather than individual calls to console.log() grouped with console.group()? console.group("Wed Jan 7 20:41:16 GMT-0700 2015 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9"); console.log("41:17:181 - Initiating recording..."); console.log("41:17:233 - Creating NetStream..."); console.log("41:17:240 - NetStream created."); console.log("41:17:240 - Recording ready."); console.groupEnd(); console.group("Wed Jan 7 20:41:16 GMT-0700 2015 NetConnectionQueue - rtmp://AMS2alt.commercialtribe.net/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9"); console.log("41:16:867 - Initializing..."); console.log("41:16:868 - Creating negotiator..."); console.log("41:17:175 - Connection success: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9"); console.log("41:17:175 - Connection added to queue."); console.log("41:17:182 - Connection request recieved..."); console.log("41:17:183 - Connection request fulfilled."); console.log("41:17:452 - Connection success: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9"); console.log("41:17:452 - Connection added to queue."); console.groupEnd(); console.group("Wed Jan 7 20:41:16 GMT-0700 2015 NetNegotiator Log"); console.log("41:16:890 - Attempting: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9"); console.log("41:17:174 - Negotiator reset"); console.log("41:17:194 - Attempting: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9"); console.log("41:17:282 - Attempting: rtmp://AMS2alt.commercialtribe.net:443/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9"); console.log("41:17:339 - Attempting: rtmp://AMS2alt.commercialtribe.net:80/recorder/530d8aa855df0c2d269a5…

http://stackoverflow.com/q/27833984
score: -1
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27834040
has comment: http://stackoverflow.com/comment/44073319
type: UnansweredQuestion
downvote count: 1
has title: How to give delay in between functions in javascript?
has answer: http://stackoverflow.com/a/27834028
has comment: http://stackoverflow.com/comment/44073350
has body: Here is my js code ,I am reading a text file & displaying each locations on map My requirement is I want to give a delay b/w two position ,Right now I am displaying on all at one time Please help me through this show veh1

http://stackoverflow.com/comment/44261926
comment on: http://stackoverflow.com/q/27932096
type: Comment
type: QuestionComment
score: 1
has text: Try opening developer tools in your browser, does it give you an error message?

http://stackoverflow.com/comment/44380649
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27870719
has text: Well, as I mentioned in a comment above, maybe the images are in reverse order? - Latest first? If so you're immediately setting minTimestamp to the latest time, so everything stops. That's all that I can think of.
type: AnswerComment

http://stackoverflow.com/comment/44168007
comment on: http://stackoverflow.com/a/27882286
type: AnswerComment
score: 0
has text: appreciate the reply, thank you. but this is way out of my league, any chance at a fiddle?
type: Comment

http://stackoverflow.com/comment/44149818
comment on: http://stackoverflow.com/a/27873787
type: Comment
has text: thanks for your effort and i think that my code should work too as your examples works fine in google chroome but didn]t work in firefox developer edition as mine too so can u check this pen for me http://codepen.io/muhamedhashem/pen/vEgjJP and thanks again for your snippet @DelightedD0D
score: 0
type: AnswerComment

http://stackoverflow.com/q/27887657
tagged with: jquery
has answer: http://stackoverflow.com/a/27887924
type: Question
has title: Displaying a tree of content in textboxes in HTML/JS/JQueryUI
tagged with: http://stackoverflow.com/tag/html
score: 0
answer count: 1
tagged with: jquery-ui
tagged with: javascript
type: UnansweredQuestion
has body: I am working on a program to manipulate a tree of content. Please see below: Parent1 Child1 Child2 Parent2 Child3 Parent3 Child4 I want to display this on a JQueryUI based page, where the user can graphically manipulate this tree by dragging and dropping a "Child" to another Parent. For example, if user may drag "Child2" to "Parent3", in which case Child2 will now appear under Parent3 - indented as shown. Also, the user may add a new Child5 and specify an associated Parent, etc. So, new entities may be added dynamically to the list (with the proper indenting as appropriate). What's the best components to use for this guys? I tried something like the following below, but it has a few issues. The textinput is a fixed width and doesn't wrap just to the size of the text, if you click on the textinput the blinking cursor is present (I just want it to be output text), and the draggable is not working for some reason. HTML: Containment Javascript: $(function() { $( "#parent1" ).draggable({containment: "#container"}); $( "#child1" ).draggable({containment: "#container"}); }); I also want the large container box to be a fixed size and not dependent on the length of the list in the container box. Thanks guys.

http://stackoverflow.com/a/27890128
score: 3
upvote count: 3
has body: Just to give an example of my use case, I have a WYSIWYG in my app and I need the input from that included as part of a json object to be posted to my server. Assuming you have the user input in a string variable: var userInput = 'Any crap with HTML you can imagine'; You can simply JSON encode this in order to transport it as a valid JSON string: var json = JSON.stringify({ value = userInput }); Now the resulting object will look like this: { "value": "Any crap with HTML you can imagine" } and on your server simply map this to a POCO with a plain Value string property. The JSON.stringify method will ensure to properly serialize any input to a valid JSON string. This being said, I don't quite understand your need of wrapping the user input in a JSOn string and then deserializing it back on the server with JSON.NET. I would rather send the raw input as-is. This way you would get exactly the same value on the server without the overhead of JSON serialization.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44181245
type: Answer
has comment: http://stackoverflow.com/comment/44181230
answers question: http://stackoverflow.com/q/27890097
accepted answer of: http://stackoverflow.com/q/27890097
has comment: http://stackoverflow.com/comment/44181318
has comment: http://stackoverflow.com/comment/44181395

loops
tags question: http://stackoverflow.com/q/27909856
tags question: http://stackoverflow.com/q/27946173
tags question: http://stackoverflow.com/q/27922814
tags question: http://stackoverflow.com/q/27902701
tags question: http://stackoverflow.com/q/27945283
tags question: http://stackoverflow.com/q/27862915
tags question: http://stackoverflow.com/q/27820860
tags question: http://stackoverflow.com/q/27857958
type: Tag
tags question: http://stackoverflow.com/q/27848772
tags question: http://stackoverflow.com/q/27864617
tag name: loops
tags question: http://stackoverflow.com/q/27865715
tags question: http://stackoverflow.com/q/27874728
tags question: http://stackoverflow.com/q/27816291
tags question: http://stackoverflow.com/q/27847462
tags question: http://stackoverflow.com/q/27896844
tags question: http://stackoverflow.com/q/27947485
tags question: http://stackoverflow.com/q/27944028
tags question: http://stackoverflow.com/q/27953911

http://stackoverflow.com/comment/44073758
comment on: http://stackoverflow.com/q/27833553
score: 0
type: Comment
type: QuestionComment
has text: The problem in my comprehension is that when I do the same thing for stories, which is stories: listStories() instead of stories: listStories ... the result isn't returned. The only way I can get the result from listStories is to link it w/o the parenthesis and then invoke it when I need it in the controller. It's so bizarre!

http://stackoverflow.com/q/27862213
type: AnsweredQuestion
has title: Infinite scroll with Angularjs and Mongoose - performance
has answer: http://stackoverflow.com/a/27862525
has body: I have a list of images that I get with Angular using $http.get() from MongoDB using Mongoose and Expressjs. What I did works fine but I have a doubt about performance. So far I found two ways to do it: using skip using $nin The queries looks like this: // Using $nin: var skip = req.query.skip || []; User.find({ _id : { $nin: skip }}) .sort({ _id: -1 }) .limit(15) .exec(function(err, users) { if (err) res.json({ 'msg': 'Error loading users' }); res.json({ users: users }); }); and: // Using skip User.find({}) .sort({ _id: -1 }) .skip(15) .limit(15) .exec(function(err, users) { if (err) res.json({ 'msg': 'Error loading users' }); res.json({ users: users }); }); Googleling around it seems like using skip lack of performance after a while... But looking at the $nin option I found after scrolling and scrolling a very long query... with plenty of _id... Which of the 2 solution should be better to use? Or there is a third way much better than those, maybe I'm doing something wrong? Thanks
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44126637
answer count: 1
tagged with: mongoose
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/44127008
has comment: http://stackoverflow.com/comment/44127189
tagged with: mongodb-query
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/27862525
has comment: http://stackoverflow.com/comment/44126859
tagged with: node.js
has comment: http://stackoverflow.com/comment/44127279
score: 2

pie-chart
tags question: http://stackoverflow.com/q/27846991
tags question: http://stackoverflow.com/q/27937282
tags question: http://stackoverflow.com/q/27939742
tag name: pie-chart
tags question: http://stackoverflow.com/q/27936744
tags question: http://stackoverflow.com/q/27835768
tags question: http://stackoverflow.com/q/27930405
tags question: http://stackoverflow.com/q/27895619
type: Tag

http://stackoverflow.com/comment/44227982
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27913733
has text: I guess after `cell.innerHTML = product[properties[j]];`, use `cell.appendChild(foo.createBtn());`

http://stackoverflow.com/q/27909720
downvote count: 0
has comment: http://stackoverflow.com/comment/44219199
has comment: http://stackoverflow.com/comment/44219660
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: iframe
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/44218839
has comment: http://stackoverflow.com/comment/66990391
has body: I have iframe and I need to override its styles I try: But when I check the generated html those new styles don't apply.
score: 1
has comment: http://stackoverflow.com/comment/44222452
has comment: http://stackoverflow.com/comment/44219549
type: Question
has title: How to override an iframe styles?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44219374

http://stackoverflow.com/comment/44167905
score: 0
comment on: http://stackoverflow.com/q/27882938
has text: That sort of fixed it. The images appear for a brief moment, then disappear. I have to quickly reload the page and click on an image in order for the image window to pop up. Once that happens the previous image, next image and close window functionality works properly.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27921938
downvote count: 1
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/44241032
has body: I want to select all selected, Non selected value in multiple select box using jquery. How to do this. Can anyone help me on this. $("#rSelectedBrand").val() This command selects only selected value in multiple select box but I want non selected value also in the array. Thanks
favorite count: 0
has comment: http://stackoverflow.com/comment/44240956
has answer: http://stackoverflow.com/a/27922439
type: UnansweredQuestion
has title: Select all values in Multi Select
upvote count: 0
has comment: http://stackoverflow.com/comment/44241489
has answer: http://stackoverflow.com/a/27922078
has comment: http://stackoverflow.com/comment/44240815

http://stackoverflow.com/q/27888637
has body: i use ajax to upload multiple file.user can upload multiple file in the same time.how i can abort ajax only for one uploading file? this is ajax : areq=$.ajax({ url: $(this).attr('action'), xhr: function() { // custom xhr (is the best) var xhr = new XMLHttpRequest(); //load xhr.upload.addEventListener("load", function(evt) { $("#msg").text('success !' ); }, false); //error xhr.upload.addEventListener("error", function(evt) { // show progress like example $("#msg").text('error !' ); }, false); //abort xhr.upload.addEventListener("abort", function(evt) { $("#msg").text('abort !' ); }, false); return xhr; }, type: 'post', processData: false, contentType: false, data: fd, success: function(data) { // do something... } });
has comment: http://stackoverflow.com/comment/44178368
has comment: http://stackoverflow.com/comment/44178456
has answer: http://stackoverflow.com/a/27889456
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44179685
linked to: http://stackoverflow.com/q/19126994
has comment: http://stackoverflow.com/comment/44178387
has comment: http://stackoverflow.com/comment/44179516
has comment: http://stackoverflow.com/comment/44178253
type: Question
score: 0
has title: abort one ajax request in multiple ajax request
has comment: http://stackoverflow.com/comment/44179653
answer count: 1
has comment: http://stackoverflow.com/comment/44179585
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44178414
has comment: http://stackoverflow.com/comment/44179834
tagged with: ajax

http://stackoverflow.com/q/27869935
answer count: 1
tagged with: javascript
has body: I have a web application with a PHP server side language on NGINX. Via JS, a user is able to download a file which is constructed dynamically by PHP from a database that is very slow. Therefore, to receive the first bytes for printing takes about 20 seconds. Then, more data is continuously streamed out afterwards. PHP: header("Content-Disposition: attachment; filename=\"" . $filename . ".txt\""); header("Pragma: public"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Set-Cookie: fileDownload=" . $filename . "; path=/"); while (Stream::MORE_DATA == $client-&gt;receive($data)) { print $data; flush(); } This download is taking place via an iframe (and it has to stay as an iframe for other reasons): iframe = document.createElement("iframe"); iframe.style.display = "none"; iframe.src = downloadFileUrl; (document.getElementsByTagName("body")[0]).appendChild(iframe); In the case the user wants to navigate to another page in a new window, the other page will not load until the download is complete because NGINX is only serving up one request at a time (I think). So I enabled a way for the user to cancel the download: iframe.contentWindow.stop(); iframe.parentNode.removeChild(iframe); This works successfully if the download is cancelled in that initial 20 seconds before the first part of the file printed. However, if cancelled after the first print, the file still continues to be downloaded even though the iframe is nullified. Is there another way to completely abort the download other than canceling it manually via the download manager of an internet browser? Maybe this can be solved with JavaScript, PHP or an NGINX config change? Thanks!
has comment: http://stackoverflow.com/comment/44142863
has title: Cancel long running download
accepted answer: http://stackoverflow.com/a/27871255
tagged with: abort
tagged with: iframe
has comment: http://stackoverflow.com/comment/44144859
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44142744
score: 0
has answer: http://stackoverflow.com/a/27871255
type: Question
has comment: http://stackoverflow.com/comment/44142341
has comment: http://stackoverflow.com/comment/44142799
tagged with: nginx

http://stackoverflow.com/q/27890714
has body: Typically, I use utf-8 for everything. Is utf-8 acceptable for JavaScript header('Content-Type: application/javascript; charset=utf-8'); Reason I ask is http://kunststube.net/encoding/ states: What does it mean for a language to support Unicode then? Javascript for example supports Unicode. In fact, any string in Javascript is UTF-16 encoded. In fact, it's the only thing Javascript deals with. You cannot have a string in Javascript that is not UTF-16 encoded. Javascript worships Unicode to the extent that there's no facility to deal with any other encoding in the core language. Since Javascript is most often run in a browser that's not a problem, since the browser can handle the mundane logistics of encoding and decoding input and output. Should I be using utf-16 instead of utf-8? Or does this article pertain to how JavaScript encodes text, not how the browser deencodes the text of a file which happens to be JavaScript?
linked to: http://stackoverflow.com/q/9853463
type: Question
answer count: 2
tagged with: encoding
tagged with: javascript
has answer: http://stackoverflow.com/a/27899952
downvote count: 0
tagged with: utf-8
linked to: http://stackoverflow.com/q/9254891
tagged with: unicode
favorite count: 0
possible better answer: http://stackoverflow.com/a/27890854
upvote count: 2
has answer: http://stackoverflow.com/a/27890854
tagged with: php
accepted answer: http://stackoverflow.com/a/27899952
score: 2
type: AnsweredQuestion
has title: Which charset to use with PHP's header when serving JavaScript

http://stackoverflow.com/comment/44285640
has text: I had issues to convert the function function updateClock() in C#, basically I do not know where to start and how to work with DateTime and TimeSpan, the line that is giving me the most trouble is var eo_timestamp = Math.floor(global.utcTime * E_TIME); in JS it seems more easy to work with Time, so far I have been doing tests with ticks in C# but handling the different types is what is giving me the most trouble, I'll post some code soon.
comment on: http://stackoverflow.com/q/27944108
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27931701
has body: I made a function and added to a prototype but when I try to call it from element appears the error undefined is not a function. function relMouseCoords(event){ var totalOffsetX = 0; var totalOffsetY = 0; var canvasX = 0; var canvasY = 0; var currentElement = this; do{ totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft; totalOffsetY += currentElement.offsetTop - currentElement.scrollTop; } while(currentElement = currentElement.offsetParent) canvasX = event.pageX - totalOffsetX; canvasY = event.pageY - totalOffsetY; return {x:canvasX, y:canvasY} } HTMLCanvasElement.prototype.relMouseCoords = relMouseCoords; function onDocumentMouseMove( event ) { event.preventDefault(); var canvas= document.getElementsByTagName("canvas"); coords = canvas.relMouseCoords(); // **** undefined is not a function **** //
favorite count: 0
type: UnansweredQuestion
has title: Add a function to prototype
has comment: http://stackoverflow.com/comment/44260936
has comment: http://stackoverflow.com/comment/44260986
downvote count: 0
has answer: http://stackoverflow.com/a/27931731
score: 1
type: Question
tagged with: javascript
upvote count: 1
has comment: http://stackoverflow.com/comment/44261011
answer count: 1

http://stackoverflow.com/comment/44073464
has text: Can you elaborate on what you mean by this? ". I'd like the container div to be exactly the height of its child element, but the default height is 3px taller than the child."
comment on: http://stackoverflow.com/q/27834039
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27924088
has title: How to highlight a table row upon hover conditionally based on table cell values with CSS and jQuery?
accepted answer: http://stackoverflow.com/a/27924114
favorite count: 0
possible better answer: http://stackoverflow.com/a/27924244
has answer: http://stackoverflow.com/a/27924244
tagged with: css
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27924114
answer count: 2
tagged with: javascript
tagged with: jquery
has body: So I have an HTML table populated with negative and positive values. I want to query the specific values and then upon hovering over the table values less than 0 I want to highlight the row with a red background color and for values greater than or equal to 0 should highlight with a blue background. My current attempt is: $(document).ready(function(){ var rows = $("#htmlTable").find('tbody').find('tr'); $.each(rows, function(key, value){ var rowData = $(rows[key]).find('td:eq(1)').html(); if (rowData &lt; 0) { $("tr").hover(function(){ $(this).addClass('.table-style-1 tbody &gt; tr:hover'); } } else { $("tr").hover(function(){ $(this).addClass('.table-style-2 tbody &gt; tr:hover'); }); } }); }); The CSS classes are as follows: .table-style-1 tbody &gt; tr:hover { background-color: red; } .table-style-2 tbody &gt; tr:hover { background-color: blue; } My above code is correctly getting the data from the table as can been seen with a simple console.log(rowData) line so I am assuming that my problem is with my implementation of addClass() and hover() functions. The console isn't showing any syntax errors but the table has no highlight functionality upon hovering. Any help would be greatly appreciated.
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/q/27954988
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/9899372
has comment: http://stackoverflow.com/comment/44305543
type: UnansweredQuestion
has body: I'm writing a webpage that has a button that generates a couple things when it's clicked. It generates a dropdown menu, a textfield and two buttons. The textfield is there to track the quantity of whatever is selected, with the two buttons either raising or lowering the value by 1. Creating the elements was straightforward enough, but tying the functions to the buttons that increase or decrease the value haven't seemed to work. I've seen quite a few examples, but I haven't seen one that works with my code. I think part of the problem is that I'm creating the DOM elements through javascript instead of just using HTML, but I couldn't figure any other way generate them dynamically. window.addField = function addField(btn) { var parentRow = btn.parentNode.parentNode; var table = parentRow.parentNode; var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cell3 = row.insertCell(0); var cell1 = row.insertCell(1); var element1 = document.createElement("input"); element1.type = 'text'; element1.class = 'qty'; element1.id = 'quantity'; element1.value = 0; cell1.appendChild(element1); var cell2 = row.insertCell(2); var element3 = document.createElement("button"); element3.class = 'qtyminus'; element3.type = "button"; element3.innerHTML = "+1"; element3.setAttribute('field', 'quantity'); cell2.appendChild(element3); var cell4 = row.insertCell(3); var element4 = document.createElement("button"); element4.setAttribute('field', 'quantity'); element4.class = 'qtyplus'; element4.type = "button"; element4.innerHTML = "-1"; cell4.appendChild(element4); var my_form = document.createElement('form'); my_form.name = 'myForm'; my_form.method = 'post'; my_form.action = 'equipment_page_admin.php'; var element2 = document.createElement("select"); //element2.type = "select"; var option1 = document.createElement("option"); option1.innerHTML = "---Please Select Equipment---"; option1.value = "default"; element2.add(option1, null); var option2 = document.createElement("option…
duplicate of: http://stackoverflow.com/q/203198
has title: Using jQuery functions on javascript generated DOM elements
type: Question
has comment: http://stackoverflow.com/comment/44333992
score: 0
linked to: http://stackoverflow.com/q/203198
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44305379
has answer: http://stackoverflow.com/a/27955269

http://stackoverflow.com/comment/44254249
type: Comment
has text: Make sense...but: How ?
comment on: http://stackoverflow.com/q/27928466
score: 0
type: QuestionComment

http://stackoverflow.com/q/27877431
type: AnsweredQuestion
downvote count: 0
tagged with: render
type: Question
score: 9
tagged with: requestanimationframe
accepted answer: http://stackoverflow.com/a/27879531
tagged with: javascript
tagged with: reactjs
has answer: http://stackoverflow.com/a/27879531
answer count: 1
has body: I want to experiment with performance of some React components inside my app. I know that ClojureScript's Om framework (https://github.com/swannodette/om) uses some optimization techniques like using immutables with implementing shouldComponentUpdate() and rendering on requestAnimationFrame change. Is there plain JavaScript mixin that could introduce rendering based on requestAnimationFrame?
favorite count: 0
upvote count: 9
has title: react.js - Render on requestAnimationFrame

http://stackoverflow.com/a/27857469
type: Answer
has body: You do need to call the code when the DOM is ready. And remove the quotes. $(document).ready(function(){ var cont = $('#content').html(); $('#content').html(cont.replace(/s\s(.*)/,'$1')); }); Fiddle : http://jsfiddle.net/anj1x7xe/
accepted answer of: http://stackoverflow.com/q/27857354
answers question: http://stackoverflow.com/q/27857354
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/44135557
comment on: http://stackoverflow.com/q/27866153
has text: @T.J.Crowder I have to go eat dinner, you've very welcome to go ahead and post it - there is relevant documentation on the spec page I linked to, you can play with it on the 6to5 repl and there is additional info on the problem in https://github.com/kriskowal/gtor . Cheers.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27935665
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27935450
has body: You can use setInterval to periodically check to see if the language changed: var translatedText=''; var interval=setInterval(function(){ var el=document.getElementsByClassName('goog-te-menu-value')[0]; if(el &amp;&amp; el.innerText!==translatedText){ translatedText=el.innerText; console.log('changed'); } },200); Working JS Bin: http://jsbin.com/neteqihage/1/
upvote count: 2
downvote count: 0

http://stackoverflow.com/q/27946173
upvote count: 0
has body: I have the following code. I'm trying to output each key value ("company" and "address") the different "city1, 2 ,3" object (list goes on and on in the real example). in to a &lt;p&gt; using javascript. I am feeling a bit lost since I've tried a lot of different ways but I can't get it to work. I believe it might be due to the structure. If it would only be one city there would be no problem. var data = { "city1": [ { "company": "Ica kvantum", "address": "Orrgatan 3-5" }, { "company": "Hemköp", "address": "Allegatan 26" } ], "city2": [ { "company": "Ica Nära", "address": "Centrumvägen 7" } ], "city3": [ { "company": "Hora brothers kiosk", "address": "Rövsgatan 43" }, { "company": "Microsoft", "address": "Husvägen 38" } ] };
has comment: http://stackoverflow.com/comment/44287560
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27946666
tagged with: handlebars.js
answer count: 3
downvote count: 3
possible better answer: http://stackoverflow.com/a/27946288
tagged with: loops
has answer: http://stackoverflow.com/a/27946288
tagged with: object
accepted answer: http://stackoverflow.com/a/27946666
tagged with: arrays
tagged with: javascript
score: -3
has title: Output object array loop in javascript
has answer: http://stackoverflow.com/a/27946401
type: AnsweredQuestion

http://stackoverflow.com/q/27891667
score: 7
has comment: http://stackoverflow.com/comment/44188528
tagged with: react-router
tagged with: javascript
has title: React.js pass parameters with Router not in URL
tagged with: reactjs
answer count: 3
has comment: http://stackoverflow.com/comment/44232599
downvote count: 0
favorite count: 0
has body: Hi I want to move from one page to another and pass paramters search and type. Can I achieve this with react router without these parameters in the URL ? I am looking at this https://github.com/rackt/react-router/blob/master/docs/guides/overview.md#dynamic-segments and the solutions using <RouteHandler {...this.props}/> but it is not working until I pass params to the url. Is there any solution for that ? EDIT 1. Routes: <DefaultRoute handler={MainPage}/>
has comment: http://stackoverflow.com/comment/44260712
linked to: http://stackoverflow.com/q/27864720
has comment: http://stackoverflow.com/comment/44260851
has comment: http://stackoverflow.com/comment/53330522
has answer: http://stackoverflow.com/a/27978251
has answer: http://stackoverflow.com/a/52226395
type: UnansweredQuestion
upvote count: 7
type: Question
has answer: http://stackoverflow.com/a/55825754

http://stackoverflow.com/comment/44199866
has text: yes it did show rows and columns but data is not displayed
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27900083

http://stackoverflow.com/q/27891692
tagged with: javascript
has comment: http://stackoverflow.com/comment/44184537
has comment: http://stackoverflow.com/comment/44184956
has body: I know very well the difference b/w the 2 operators in context to primitive types (number, string, boolean, null and undefined). I mean all that stuff, 0 == false // true 0 === false // false, because they are of a different type 1 == "1" // true, auto type coercion 1 === "1" // false, because they are of a different type null == undefined // true null === undefined // false '0' == false // true '0' === false // false Consider the snippet, var str3 = new String("abc"); var str4 = new String("abc"); // false as 2 different objects, referential equality just like in java alert(str3 == str4); var str5 = new String("abc"); var str6 = str5; alert(str6 == str5); // true, as pointing to the same object For str5 and str6, they will compare truthfully. Use of the strict comparison (===) will, of course, produce the same result, as they are the same value and type; indeed, they are the same object! Now consider, function Person(name) { this.name = name; } // the function person has a prototype property // we can add properties to this function prototype Person.prototype.kind = ‘person’ // when we create a new object using new var zack = new Person(‘Zack’); // the prototype of the new object points to person.prototype zack.__proto__ == Person.prototype //=&gt; true zack.__proto__ === Person.prototype //=&gt; false I find myself really confused with the last 2 lines: zack.__proto__ == Person.prototype //=&gt; true zack.__proto__ === Person.prototype //=&gt; false As per my understanding zack.__proto__ and Person.prototype are pointing to the same object (same location in memory), hence true. If so, why zack.__proto__ === Person.prototype false then, as the type of both zack.__proto__ and Person.prototype is object and since they are pointing to the same location in memory, they must have equal values.
has title: Operators == and === on objects in JavaScript
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27891919
has answer: http://stackoverflow.com/a/27891919
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44184721
downvote count: 0
has comment: http://stackoverflow.com/comment/44184904
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44184713
has comment: http://stackoverflow.com/comment/44184748

http://stackoverflow.com/q/27896948
answer count: 1
tagged with: javascript
tagged with: jquery
has title: preventDefault not working with tinyMCE keydown event
favorite count: 0
tagged with: tinymce
downvote count: 0
type: UnansweredQuestion
type: Question
score: 3
has answer: http://stackoverflow.com/a/27918277
has body: When binding on the 'keydown' event on a tinyMCE editor instance, calling preventDefault() on the event does not prevent the default behavior in the editor. For example, when capturing the ENTER key being pressed with the following code: tinymce.init({ selector: 'textarea', setup: function (editor) { $(editor).on('keydown', function (event) { if (event.which == 13) { alert('enter pressed'); event.preventDefault(); } }); } }); TinyMCE still inserts a line break. How can I override this behavior?
tagged with: tinymce-4
upvote count: 3

http://stackoverflow.com/q/27942575
tagged with: javascript
has answer: http://stackoverflow.com/a/27942866
has title: How to change the data in a force layout graph dynamically ? D3
answer count: 1
downvote count: 0
has body: I have a few JSON files I can use with my force directed graph and I wish to choose which one I run. I can just change the name of what JSON is read in the HTML file &lt;script type="text/javascript" src="networkA.json"&gt;&lt;/script&gt; to &lt;script type="text/javascript" src="networkB.json"&gt;&lt;/script&gt; but I wish to do this dynamically. So when I first load the SVG my choice of data pops up and I get to choose which one I want the force directed graph to run off. Also, wish to change this when its running, but knowing how to do the start up will probably answer that question. Here is a perfect demo that can change dynamically: 'http://projects.flowingdata.com/tut/interactive_network_demo/' but I wish to do something similar on a force directed graph
favorite count: 0
tagged with: d3.js
has comment: http://stackoverflow.com/comment/44312506
accepted answer: http://stackoverflow.com/a/27942866
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
linked to: http://stackoverflow.com/q/21122811
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question

http://stackoverflow.com/a/27940053
has body: Instead of using an extra function, you could simply create a flag and change it based on user action: var confirm_flag; // this is undefined, which means that no actions have been taken okBtn.on('click', function(){ validate(true); }); cancelBtn.on('click', function(){ validate(false); }); Then, based on the user input, you can determine which course of action you want to take: function validate(flag) { if(flag) { alert("okBtn has been clicked, it's safe to continue"); }else{ alert("Not good!"); } } If you want to use the return value from a confirm popup, you can simply assign the Window confirm() function to a variable - if the user clicks ok, it will return true var x = confirm('Is it safe?'); // will pop a confirm dialog box and return true if ok is pressed and false if cancel is pressed
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44276362
has comment: http://stackoverflow.com/comment/44280151
has comment: http://stackoverflow.com/comment/44276836
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44276886
answers question: http://stackoverflow.com/q/27939840

http://stackoverflow.com/comment/44036662
comment on: http://stackoverflow.com/a/27814869
score: 0
has text: do you khow why my jquery doesn't work in my content page?should i add ref and ... on my content page?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44202181
score: 0
type: Comment
type: QuestionComment
has text: Hey Connor if my answer helped you out I would appreciate it if you could mark it as the correct answer.
comment on: http://stackoverflow.com/q/27813834

http://stackoverflow.com/q/27823907
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/44098484
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44100602
has comment: http://stackoverflow.com/comment/44099054
answer count: 0
has comment: http://stackoverflow.com/comment/44099103
has comment: http://stackoverflow.com/comment/44098843
has comment: http://stackoverflow.com/comment/44098889
has title: Retrieving value from innerHTML output
type: Question
tagged with: javascript
has body: I know how to retrieve a value from a textfield that a user has inputed, however, I want to be able retrieve the text thats outputed from the following code: var message = url; document.getElementById('result').innerHTML = message; Essentially I want to store into Parse a shorten URL, where the URL is generated from the document selected in Google Drive, and then that URL is display on screen to the user, and thats the URL I want to grab to shorten. Below is the entire code: upload In particular, this where I attempt to shorten the URL to store into Parse: var longUrl=message; var request = gapi.client.urlshortener.url.insert({ 'resource': { 'longUrl': longUrl } }); request.execute(function(response) { if(response.id != null) { str =""+response.id+""; document.getElementById("output").innerHTML = str; Parse.initialize("ID", "ID"); var PDFUpload = new Parse.Object("Scan"); PDFUpload.set("PDFDocument", response.id); PDFUpload.save(null, { success: function(uploadResult) { // Execute any logic that should take place after the object is saved. }, error: function(uploadResult, error) { // Execute any logic that should take place if the save fails. // error is a Parse.Error with an error code and description. alert('Failed to create new object, with error code: ' + error.description); } }); } else { alert("error: creating short url"); } }); Any help would be greatly appreciated Update: Please try out this code. It shortens a url from the input value you insert. In the sense that you enter example yahoo.ca in the input field, and once you hit convert it shortens it into a url and store in parse. This works succesfully, but I wanted to integrate that into my code where the url is derived from the url that is generated from the item the user has selected from their google drive: URL:
score: 0
has comment: http://stackoverflow.com/comment/44098580
tagged with: url
tagged with: url-rewriting

http://stackoverflow.com/q/27859487
tagged with: jquery
has body: I am absolutely new in JavaScript and even more in jQuery and I have the following problem. In a JSP page that use Struts 2 tag library (but I think that this is not important) I have this form: <s:form> <sj:div id="resultEvents" href="%{loadFolderTechId}" formIds="treeForm" class="result ui-widget-content ui-corner-all" loadingText=" " onBeforeTopics="before" onCompleteTopics="complete" deferredLoading="true" reloadTopics="reloadEvents"> </sj:div> <s:submit action="projectCreationAction"/> </s:form> The tag is the same thing that a classic html form (it is a Struts 2 UI tag that wrap a classic html form). The inner tag is like an HTML div with some AJAX behavior (it is shown only if a specific event is triggered) and it contains the form input tag. In the specific case in the page there is (not show in the snippet) a JsTree showing a tree and when the user click on a node of this tree the content of this form is shown (the is shown). Ok, under this , there is the that show a button to submit the form. At this time this button is always shown, even when it is not shown the content of the previous . So what I have to do is to make hidden the button when the content of the is not shown. When the is shown it renders the following HTML code inside my page: Creazione Progetto .............................................. .............................................. .............................................. So I am thinking that maybe I code using JavaScript or jQuery to hidden my until the div id="resultEvents" is not rendered on my page. Is it a correct use of AJAX or exist some better solution to do it? If it is a good solution how can I implement it? Thanks
tagged with: ajax
has comment: http://stackoverflow.com/comment/44121776
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/27859812
type: AnsweredQuestion
has title: How to hide a button until a specific div is not shown in my page using AJAX?
has comment: http://stackoverflow.com/comment/44121883
type: Question
has answer: http://stackoverflow.com/a/27859812
tagged with: javascript

http://stackoverflow.com/q/27915329
has body: <asp:UpdatePanel ID="UpdtBank" runat="server"> <ContentTemplate> <asp:UpdateProgress AssociatedUpdatePanelID="UpdtBank" id="updateProgress" DynamicLayout="true" runat="server"> <asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/img/ajax-loader.gif" AlternateText="Loading ..." ToolTip="Loading ..." style="padding: 10px;position:fixed;top:45%;left:50%;" /> </asp:UpdateProgress> //My Code is Here I have copy above code from the tutorial and stackoverflow answers, but image is not showing at all. Kindly help me i cant find my mistake
tagged with: loading
possible better answer: http://stackoverflow.com/a/27915821
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27915821
tagged with: c#
has comment: http://stackoverflow.com/comment/44229709
has answer: http://stackoverflow.com/a/27915629
has title: Loading Image is not showing
tagged with: busy-cursor
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44229728
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/44229745
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/27915629
type: Question
has comment: http://stackoverflow.com/comment/44229704

http://stackoverflow.com/q/27961474
downvote count: 0
has comment: http://stackoverflow.com/comment/44321772
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44330534
has comment: http://stackoverflow.com/comment/44316561
has comment: http://stackoverflow.com/comment/44326355
linked to: http://stackoverflow.com/q/24656983
answer count: 0
score: 1
has body: I am writing a directive that I want other people to reuse. The problem I encounter is that my directive has several js files it uses, and if I want others to use it, they need to add the js files explicitly. Is there a way to make the directive include those files so that other will only have to add the directive file? The way it works today is by adding the js files in the main head html file. Can I use tamplateUrl to load the js files? Iv'e seen in THIS post that loading scripts creates some problems. Concrete Example: index.html: &lt;body data-ng-app="example"&gt; &lt;test-dir&gt;&lt;/test-dir&gt; &lt;/body&gt; index.js: (function(angular){ var app = angular.module('example', []); app.directive('testDir', function(){ return{ restrict: 'E', templateUrl: 'test-me.html' } }); })(window.angular); test-me.html: &lt;script type="text/javascript" src="test.js"&gt;&lt;/script&gt; &lt;div&gt; TEXT &lt;/div&gt; test.js: function testMe() { console.log('blah'); } This format will call the directive and I will see the div TEXT text. BUT, I can't call the function testMe and I don't see any transfer in the network for test.js which is included in the directive's template. How can I make it work?
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44321681
has title: Adding angular directive with javascript files as package

http://stackoverflow.com/q/27930004
accepted answer: http://stackoverflow.com/a/27930034
has title: typeof Number equals Number
possible better answer: http://stackoverflow.com/a/27930033
tagged with: javascript
has answer: http://stackoverflow.com/a/27930033
has comment: http://stackoverflow.com/comment/44257731
answer count: 2
tagged with: typeof
has body: In JavaScript, typeof 42 === 'number' //true evaluates to true. But.. typeof Number === 'number' //false evalutes to false. And.. typeof 'number' === 'number' //false also evaluates to false. Shouldn't comparison 2 or 3 evaluate to true?
downvote count: 0
has comment: http://stackoverflow.com/comment/44257620
favorite count: 0
has answer: http://stackoverflow.com/a/27930034
type: AnsweredQuestion
tagged with: numbers
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44257426

http://stackoverflow.com/comment/44576893
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28083324
type: AnswerComment
has text: @BradParks - added a little more context to the answer, to try and explain the behaviour. How a browser handles scripts that can't be loaded is up to the vendor, and there is no standard for it, but this is something that happens quite often, scripts dissappear, servers go down etc. and all browsers handles such errors extremely quick and reliable without any issues.

http://stackoverflow.com/comment/44282783
type: Comment
comment on: http://stackoverflow.com/a/27943617
has text: One may use $rootScope to bind variables that need to be shared between Controllers, as the $scope variable of a Controller inherits from the $rootScope. Reads the docs on $rootScope
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44119913
type: Comment
type: AnswerComment
has text: Thanks for the comments & the code:) I will check out the html you told me about, I was completly forgot that there was something in html aswell. yet I need to get it unix timestamp, but that is easy to resolve. The thing about your code is, that I am totally new in Javascript & Ajax, I struggle alot with those codes
score: 0
comment on: http://stackoverflow.com/a/27858349

http://stackoverflow.com/q/27933982
tagged with: javascript
has answer: http://stackoverflow.com/a/27934301
has body: boilerplate html/css/etc. then ... the above uses an Angular template, which is incredibly simple. It just positions absolutely my content into one, two, or three columns. If I set the screen to two columns I'd like it to be centered. I'm able to do this via code, but I wanted a more fluid feel and I suspect CSS can do this, but I'm having trouble w/it. Here's my template: Content here ... My Angular directive simply grabs the element above and changes its CSS position property to absolute and gives it a top and left property. Why is this not working? Can this be done? So in essence if I have one column, which is 400px and is put in my display at position 0, which would occur in this case, and the screen is at 1400px, I'd like the containing div to be displayed at x position (1400-400)/2. If I have two columns, which are 400px and are put on my display at positions 0 and 410, which would also occur in this case, and the screen is at 1400px, I'd like the containing div to be displayed at x position (1400-810)/2. UPDATE: Here's a fiddle http://jsfiddle.net/0LLa1rs4/ UPDATE: Here's a solution, although I'm not sure it's the most elegant. Any suggestions to make it better are welcome. testing ... Item #1 Item #2
score: 0
answer count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44266847
has comment: http://stackoverflow.com/comment/44266507
tagged with: css
has answer: http://stackoverflow.com/a/27934539
has title: Is it possible to center a relative positioned div that contains an absolute positioned div?
has comment: http://stackoverflow.com/comment/44265723
has comment: http://stackoverflow.com/comment/44265884
type: Question
has comment: http://stackoverflow.com/comment/44266780

http://stackoverflow.com/q/27941509
tagged with: javascript
score: 0
has title: how can i lowercase object value/data in javascript using underscore for HTML5 document
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27942086
has body: I have a array of objects (arr), each object has 3 properties (Department, Categories, ProductTypes), the values for these properties are a mixture of upper and lower case. I have created a duplicate array of arr and named it arr2. i needed to do a comparison between arr and a search filter (which is already lowercased) so it returns an array of objects back with the matching criteria and assign to arr using: arr=_.where(arr2,filter); so I’m thinking to iterate through arr2 and lowercase everything in here, as follows: _.each( arr2, function(item){ //loop around each item in arr2 _.each( item, function(properties){ //loop around each property in item properties=properties.toLowerCase(); console.log("Item: ",item,"ID: ",properties); }); }); however i get the following output in chrome: Default1.html:109 Item: Object {Departments: "Dep1", Categories: "Cat1", ProductTypes: "Prod1"} ID: dep1 Default1.html:109 Item: Object {Departments: "Dep1", Categories: "Cat1", ProductTypes: "Prod1"} ID: cat1 Default1.html:109 Item: Object {Departments: "Dep1", Categories: "Cat1", ProductTypes: "Prod1"} ID: prod1 How can I change the “Dep1/Cat1/Prod1” values to lowercase?
has answer: http://stackoverflow.com/a/27946428
has answer: http://stackoverflow.com/a/27942086
type: AnsweredQuestion
tagged with: underscore.js
tagged with: lowercase
accepted answer: http://stackoverflow.com/a/27946428
type: Question
answer count: 2
tagged with: arrays

http://stackoverflow.com/q/27845568
has body: I see that this question has come up before, but it did not help me that much. On my webpage I want an image, a small airballon, to move slowly upp from the right bottom and to stop some place beside my logo, just one time. http://www.butik.meisolle.com/ I found some code in other posts that I maybe will be able to change so it fits my needs. But where to put this code? I have a Joomla site. I am not a programmer, just did the website my self and learned a bit a long the process. I don't even know if this is possible :-) /Christina
tagged with: css
tagged with: joomla
linked to: http://stackoverflow.com/q/13878451
upvote count: 2
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44095675
has comment: http://stackoverflow.com/comment/44114977
has answer: http://stackoverflow.com/a/27847632
has title: How to make image to move from bottom to top on webpage
tagged with: image
tagged with: transition
type: Question
answer count: 1
tagged with: javascript
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27847632

http://stackoverflow.com/q/27866365
tagged with: google-trends
tagged with: javascript
has answer: http://stackoverflow.com/a/68649598
has title: Can't embed google trends graph in HTML page
favorite count: 0
linked to: http://stackoverflow.com/q/27028132
has answer: http://stackoverflow.com/a/27866857
has body: I'm trying to embed this Google Trends chart on my HTML page but it just don't show up. https://www.google.com/trends/explore#q=%2Fm%2F07wc_c%2C%20%2Fm%2F0gtszpv%2C%20%2Fm%2F09zx_p%2C%20%2Fm%2F03lt2r&cmpt=q&tz= Code: Any ideas? Thanks.
upvote count: 3
type: UnansweredQuestion
tagged with: embed
tagged with: charts
score: 3
has answer: http://stackoverflow.com/a/28186948
type: Question
answer count: 3
downvote count: 0

http://stackoverflow.com/a/27820809
type: Answer
has body: Try like this... $("#cbx1").click(function () { var chk = $("#cbx1").val(); var total = 0; if ($("#cbx1").prop("checked") == true) { var gtotal = parseInt(total) + parseInt(chk); } else { var gtotal = parseInt(total); } $("#grandtotal").val(gtotal); }); DEMO
score: 0
answers question: http://stackoverflow.com/q/27820532

http://stackoverflow.com/comment/44064087
comment on: http://stackoverflow.com/a/27809487
type: AnswerComment
type: Comment
score: 1
has text: I didn't know, now it is working perfectly! Thank you!

http://stackoverflow.com/comment/44205224
has text: If you really only want the number of charackters you could simply count them?
type: Comment
comment on: http://stackoverflow.com/q/27902969
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44482087
type: AnswerComment
comment on: http://stackoverflow.com/a/28043905
score: 0
has text: I am sorry Douglas, I am not able to help in detail as I don't have the proper environment setup. Would ask to my developer friends to help you out asap. :)
type: Comment

http://stackoverflow.com/comment/44139963
has text: If your event is raised from a backend instead of an action the actual user has taken inside of a single tab, why are you using the browser to call the API to save the record? Could you not call the API from the backend?
comment on: http://stackoverflow.com/q/27842633
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/27948760
favorite count: 0
has comment: http://stackoverflow.com/comment/44333843
tagged with: angularjs
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44293109
has title: Input type=file with Angular doesn't recognize when a file has been selected. The REQUIRED attribute stays
has body: all. Whenever you select a file with input type=file...see below and then the plunker link: &lt;form name="myForm"&gt; &lt;label&gt;Enter your name:&lt;/label&gt; &lt;input type="text" name="myName" ng-model="name" ng-minlength="5" ng-maxlength="20" required /&gt; &lt;br&gt; &lt;input type="file" name="myFile" ng-model="myFile" required /&gt; &lt;pre&gt;myForm.myName.$error = &lt;/pre&gt; &lt;div ng-messages="myForm.myFile.$error" style="color:maroon;"&gt; &lt;div ng-message="required"&gt;You need to select a file&lt;/div&gt; &lt;/div&gt; &lt;div ng-messages="myForm.myName.$error" style="color:maroon"&gt; &lt;div ng-message="required"&gt;You did not enter a field&lt;/div&gt; &lt;div ng-message="minlength"&gt;Your field is too short&lt;/div&gt; &lt;div ng-message="maxlength"&gt;Your field is too long&lt;/div&gt; &lt;/div&gt; &lt;/form&gt; Here's my Plunker: http://plnkr.co/edit/K5LgAXCHLKl4yQ3m6zAs?p=preview using Angular, and the required attribute doesn't go away and Angular still sees the field as REQUIRED and NOT filled. Please help.... What am I missing here? UPDATE: Yes, this question has been asked before but what I'm running into is this: When I'm testing with the vald-file directive in the "duplicate" question you posted, everything is fine when I select a FILE the "FIRST" time. BUT, when I select a "different" type of file, or another file of the same type, like another RTF, the directive is NEVER FIRED! Meaning, the form remains invalid, the input field DOES NOT clear out and the directive is in LIMBO!!! I have to physically refresh the page, every time, and start over. This is very frustrating since this "supposed" solution DOES NOT work in real world testing. So, hence, this is NOT a duplicate and DOES NOT solve my problem. NOTE: I am not yelling when I use CAPS. That is for EMPHASIS to get your attention to the fact that this duplicate is not working. ???? Why does the directive NOT fire every time even when I want to select an…
linked to: http://stackoverflow.com/q/16207202
score: 2
duplicate of: http://stackoverflow.com/q/16207202
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/27894107
score: 3
answers question: http://stackoverflow.com/q/27894099
upvote count: 3
has comment: http://stackoverflow.com/comment/44189435
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44189496
type: Answer
has body: Use the direct child combinator, >, in order to only select direct children elements: ul.list > li But since this still selects the li that contains the .sublist element, use a combination of the :not()/:has() selectors: $('ul.list > li:not(:has(.sublist))').on('click', function () { // ... }); Example Here $('ul.list > li:not(:has(.sublist))').on('click', function () { alert('working'); }); One Two Three 1 2 3
accepted answer of: http://stackoverflow.com/q/27894099

http://stackoverflow.com/comment/44218793
score: 0
type: Comment
type: QuestionComment
has text: You disagree, you think `alert` is a debugging tool ?
comment on: http://stackoverflow.com/q/27909353

http://stackoverflow.com/q/27932096
has comment: http://stackoverflow.com/comment/44296812
has comment: http://stackoverflow.com/comment/44295993
type: Question
has title: link .js file to .html file
has body: I am building an order form with validation and computational functionality. In the folder there are two files; 1) index.html and 2) app.js. Both the .html and .js file are in the same folder. I cannot, for the life of me, successfully link the .js file to the .html file! I have read through countless posts here, and the only piece of advice I found was to link the .html file to a jquery library (which I did). I have also tested the .js file to see if it is linking properly by typing a test message at the top of the .js file. The result; no linkage! Here is the code: For the .html file: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Order Form&lt;/title&gt; &lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js'&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="style.css"&gt; &lt;script src="modernizr.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="order" method="post" action="/submit"&gt; &lt;h1&gt;Order Form&lt;/h1&gt; &lt;fieldset&gt; &lt;legend&gt;Contact Details&lt;/legend&gt; &lt;ul&gt; &lt;li&gt; &lt;label class="required"&gt; &lt;div&gt;Full Name&lt;/div&gt; &lt;input name="name" required autofocus&gt; &lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;label class="required"&gt; &lt;div&gt;Email Address&lt;/div&gt; &lt;input type="email" name="email" required&gt; &lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;label&gt; &lt;div&gt;Postal Address&lt;/div&gt; &lt;input name="address1" placeholder="Address Line 1"&gt; &lt;/label&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;input name="address2" placeholder="Address Line 2"&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;input name="city" class="city" placeholder="Town/City"&gt; &lt;input name="state" class="state" placeholder="State"&gt; &lt;input name="zip" class="zip" placeholder="Zip Code"&gt; &lt;div&gt;&amp;nbsp&lt;/div&gt; &lt;select name="countr…
tagged with: javascript
has comment: http://stackoverflow.com/comment/44261934
has comment: http://stackoverflow.com/comment/44291791
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44261926
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44291879
has answer: http://stackoverflow.com/a/27932227
accepted answer: http://stackoverflow.com/a/27932227
has comment: http://stackoverflow.com/comment/44261877

http://stackoverflow.com/q/27850065
has body: I have a function nested inside a javascript plugin which quite simply checks if something exists inside of an IndexedDB and then ideally I want it to return true or false. I have assigned the call to the function to a variable (eg var res = $(document).check('name');) However all I get in the console output if I do a console debug on it is undefined. If I add more console logging into the function it is getting the record correctly and in the right part of the if statement but there is no value being returned. (function($){ var db, tx, callback, options, names = { checkFor: function(name){ //Lightweight copy of above without Thumbs console.log('In checkfor'); var tx = db.transaction('myDB').objectStore('people').get(name).onsuccess = function(event){ console.debug('res',event); var res = event.target.result; if(res.length &gt; 0) return true; else return false; }; } } $.extend($.fn,{ check: function(name){ names.checkFor(name); }); }(jQuery)); The above is an example, there are many more functions and the plugin is quite lengthily. If anyone could help that would be greatly appreciated! Thanks!
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44104339
has comment: http://stackoverflow.com/comment/44104324
type: Question
has title: Returning A Boolean Nested Inside A Plugin
has comment: http://stackoverflow.com/comment/44104740
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/44255507
type: Comment
comment on: http://stackoverflow.com/a/27928780
has text: I want to make in javascript something like this.... document.getElementById('infoTexts').className = "fa fa-close"; The thing is that i want to change the whole span(whose ID is 'infoTexts') except one item inside of it (a tag)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44091869
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27820979
has text: Thank you Andrew for your method that works very well. But, unfortunately, I forgot to say something in my initial request: the original link is in the bottom part of my page. And, I would like to have the duplicated link in a upper part of my page So, would you know how to have the duplicated link above the original link ?
score: 0

http://stackoverflow.com/comment/44140714
type: Comment
comment on: http://stackoverflow.com/q/27869112
type: QuestionComment
has text: `.html()` expects a string as input, and inserts that string as if it was an html snippet into the dom at the specified point. You're not passing in a string. You're passing in an Image object, which is NOT going to work. jquery happens to be extending the image object with a .toString magic method which happens to spit out an html representation of the image object. so version 1: image object, not work. version 2: jquery object, works.
score: 2

http://stackoverflow.com/a/27944172
type: Answer
has comment: http://stackoverflow.com/comment/44286640
answers question: http://stackoverflow.com/q/27942818
score: 0
has body: you can try this one: only use pure CSS : column-count & column-gap. firstly: change your html like this one: and then change your css code like this: .wrapper { -moz-column-count: 4; -moz-column-gap: 5px; -webkit-column-count: 4; -webkit-column-gap: 5px; column-count: 4; column-gap: 5px; } .block{ width:100%; display:inline-block; margin-bottom: 0px; margin-top:0px; } #one { height:150px; background:#ff0000; } #two { height:150px; background:#00ff00; } #three { height:300px; background:#0000ff; } #four { height:150px; background:#000000; } #five { height:150px; background:#ff0000; } refresh your browser. it's work fine for me.

http://stackoverflow.com/q/27809208
type: Question
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44027572
has answer: http://stackoverflow.com/a/27809322
has title: issue when trying to move two div's onkeydown
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27809322
has body: The code seems right to me but when i try to move the div with class ai using the key 'A' and 'Q' it doesn't work , it work only with the div which have the class player when hitting up and down arrow : LIVE DEMO JavaScript : var playerPosition = 0, playerPosition2 = 0; window.onkeydown = function(e) { var key = e.keyCode ? e.keyCode : e.which; if(key == 40) { // up arrow playerPosition += 5; } if(key == 38) { // down arrow playerPosition -= 5; } if(key == 113) { // q buttton playerPosition2 += 5; } if(key == 97) { playerPosition2 -= 5; // a button } var players1 = document.getElementsByClassName('player'); for(var i = 0; i &lt; players1.length; i++) { if (playerPosition &lt; 0) { playerPosition = 0; } else if (playerPosition &gt; 330) { playerPosition = 330; } players1[i].style.top = playerPosition + "px"; } var players2 = document.getElementsByClassName('ai'); for(var i = 0; i &lt; players2.length; i++) { if (playerPosition2 &lt; 0) { playerPosition2 = 0; } else if (playerPosition &gt; 330) { playerPosition2 = 330; } players2[i].style.top = playerPosition2 + "px"; } }

http://stackoverflow.com/comment/44101215
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27844895
score: 0
has text: @user3053430 : in fact all the problem is a typo! look at my EDIT.

http://stackoverflow.com/comment/50156908
comment on: http://stackoverflow.com/q/27906867
score: 0
type: Comment
type: QuestionComment
has text: Please detail what you wish to expect at https://github.com/angelozerr/tern.java/issues/289

http://stackoverflow.com/q/27833117
tagged with: javascript
type: UnansweredQuestion
has title: TypeError: document.body is null
tagged with: typeerror
type: Question
linked to: http://stackoverflow.com/q/4637873
linked to: http://stackoverflow.com/q/2414750
has answer: http://stackoverflow.com/a/50559692
favorite count: 0
score: 12
answer count: 2
has comment: http://stackoverflow.com/comment/44071878
has comment: http://stackoverflow.com/comment/105936069
has answer: http://stackoverflow.com/a/27833136
has body: Why I getting error in browser? TypeError: document.body is null Code is working well in JSfiddle. HTML JS var creElem = document.createElement("p"); creElem.innerHTML = "Hellow World"; creElem.setAttribute("id", "id_name"); document.body.appendChild(creElem);
upvote count: 12
downvote count: 0

http://stackoverflow.com/comment/44254302
score: 0
type: Comment
type: QuestionComment
has text: What are you trying to do to "infoTexts"?
comment on: http://stackoverflow.com/q/27928600

http://stackoverflow.com/comment/50302879
has text: Sorry @ColeLawrence, I don't believe I ever resolved my problem.
comment on: http://stackoverflow.com/a/27942922
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27867431
answer count: 1
tagged with: jquery
tagged with: timer
has title: JavaScript stopwatch saving in cookies
tagged with: cookies
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27868479
accepted answer: http://stackoverflow.com/a/27868479
tagged with: javascript
type: Question
has body: I'm a beginner in JavaScript and I'm working in a website, but I got stuck on the stopwatch I'm making. I need something like, I'm in timer.php and I have a stopwatch; when we press start it starts counting from 00:00:00 and if I move to page exemple1.php I don't want that the stopwatch just stop counting, I want that the stopwatch just keep counting and when I comeback to the timer.php the stopwatch just keep counting forward until I press the stop button and when I press it just stops at that value, for example 00:20:00. And here I'm stuck. It's in the part that when I move to another page, because the stopwatch just stop and I don't want that I want the stopwatch just keep counting and when I move again to timer.php I see the stopwatch counting and not stopped in 00:00:00. Here is my code: Demo - Jsfiddle Timer.php 00:00:00 exemple1.php
score: 0
tagged with: stopwatch

http://stackoverflow.com/comment/44359567
type: QuestionComment
comment on: http://stackoverflow.com/q/27826876
score: 0
type: Comment
has text: Eclipse for Java Developers: `Eclipse IDE for Java Developers Version: Luna Service Release 1a (4.4.1) Build id: 20150109-0600` Does this have something to do with the javascript validation?

http://stackoverflow.com/comment/44152018
comment on: http://stackoverflow.com/a/27875144
type: AnswerComment
score: 0
has text: Well, then you might want to take a look at what the error status is, which is the second parameter of callback function. Alter the error function declaration as follows: `function(e, status)` and then `alert(status)`. If it is 404, your URL that you try to AJAX into, is wrong.
type: Comment

http://stackoverflow.com/q/27947361
has comment: http://stackoverflow.com/comment/44289657
favorite count: 0
has comment: http://stackoverflow.com/comment/44290039
has comment: http://stackoverflow.com/comment/44290628
has comment: http://stackoverflow.com/comment/44293865
has comment: http://stackoverflow.com/comment/44289973
tagged with: http://stackoverflow.com/tag/html
has body: Im trying to duplicate a class and to make it not change when the original is changed. currently I tried $(".newclass").addClass("oldclass"); which does not copy the content var _elementClone = $(".oldclass").html(); $(".newclass").html(_elementClone); this one is good and transfers all the contents of the div PROBLEM: in all cases when I change the oldclass parent. like $('.oldclass').hide(); &lt;style&gt; .oldclass{visibility:collapse} &lt;/style&gt; the new one also changes. How can I create new class which does not change when the parent is changed?
tagged with: css
has comment: http://stackoverflow.com/comment/44290025
has answer: http://stackoverflow.com/a/27948057
has title: Duplicate an element independently of the original
type: AnsweredQuestion
downvote count: 3
upvote count: 1
type: Question
score: -2
accepted answer: http://stackoverflow.com/a/27948057
tagged with: javascript
has answer: http://stackoverflow.com/a/27948161
has comment: http://stackoverflow.com/comment/44289867
answer count: 2
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27948161
has comment: http://stackoverflow.com/comment/44290002

http://stackoverflow.com/comment/44174755
comment on: http://stackoverflow.com/a/27882286
has text: @user3869231 No problem. This fiddle is inspired on my solution, but translated to your application: http://jsfiddle.net/5282y8y4/5/
type: AnswerComment
score: 0
type: Comment

flot
tags question: http://stackoverflow.com/q/27942215
tags question: http://stackoverflow.com/q/27862174
type: Tag
tags question: http://stackoverflow.com/q/27907549
tag name: flot
tags question: http://stackoverflow.com/q/27926261

css
tags question: http://stackoverflow.com/q/27959610
tags question: http://stackoverflow.com/q/27919075
tags question: http://stackoverflow.com/q/27879908
tags question: http://stackoverflow.com/q/27884020
tags question: http://stackoverflow.com/q/27861109
tags question: http://stackoverflow.com/q/27837440
tags question: http://stackoverflow.com/q/27888869
tags question: http://stackoverflow.com/q/27869063
tags question: http://stackoverflow.com/q/27883790
tags question: http://stackoverflow.com/q/27960957
tags question: http://stackoverflow.com/q/27901272
tags question: http://stackoverflow.com/q/27901605
tags question: http://stackoverflow.com/q/27816387
tags question: http://stackoverflow.com/q/27818900
tags question: http://stackoverflow.com/q/27849792
tags question: http://stackoverflow.com/q/27855749
tags question: http://stackoverflow.com/q/27821299
tags question: http://stackoverflow.com/q/27944600
tags question: http://stackoverflow.com/q/27824036
tags question: http://stackoverflow.com/q/27941628
tags question: http://stackoverflow.com/q/27833401
tags question: http://stackoverflow.com/q/27882934
tags question: http://stackoverflow.com/q/27827175
tags question: http://stackoverflow.com/q/27880431
tags question: http://stackoverflow.com/q/27919166
tags question: http://stackoverflow.com/q/27835494
tags question: http://stackoverflow.com/q/27885598
tags question: http://stackoverflow.com/q/27868330
tags question: http://stackoverflow.com/q/27887933
tags question: http://stackoverflow.com/q/27878332
tags question: http://stackoverflow.com/q/27902969
tags question: http://stackoverflow.com/q/27955242
tags question: http://stackoverflow.com/q/27926501
tags question: http://stackoverflow.com/q/27847851
tags question: http://stackoverflow.com/q/27919051
tags question: http://stackoverflow.com/q/27885808
tags question: http://stackoverflow.com/q/27856799
tags question: http://stackoverflow.com/q/27817366
tags question: http://stackoverflow.com/q/27876002
tags question: http://stackoverflow.com/q/27807692
tags question: http://stackoverflow.com/q/27868169
tags question: http://stackoverflow.com/q/27812904
tags question: http://stackoverflow.com/q/27897757
tags question: http://stackoverflow.com/q/27936936
tags question: http://stackoverflow.com/q/27915734
tags question: http://stackoverflow.com/q/27917121
tags question: http://stackoverflow.com/q/27863830
tags question: http://stackoverflow.com/q/27910929
tags question: http://stackoverflow.com/q/27954839
tags question: http://stackoverflow.com/q/27934720
tags question: http://stackoverflow.com/q/27892928
tags question: http://stackoverflow.com/q/27910458
tags question: http://stackoverflow.com/q/27949276
tags question: http://stackoverflow.com/q/27947361
tags question: http://stackoverflow.com/q/27831276
tags question: http://stackoverflow.com/q/27892515
tags question: http://stackoverflow.com/q/27907271
tags question: http://stackoverflow.com/q/27956407
tags question: http://stackoverflow.com/q/27905588
tags question: http://stackoverflow.com/q/27924066
tags question: http://stackoverflow.com/q/27886280
tags question: http://stackoverflow.com/q/27845569
tags question: http://stackoverflow.com/q/27957427
tags question: http://stackoverflow.com/q/27921528
tags question: http://stackoverflow.com/q/27832356
tags question: http://stackoverflow.com/q/27898459
tags question: http://stackoverflow.com/q/27960226
tags question: http://stackoverflow.com/q/27948475
tags question: http://stackoverflow.com/q/27947815
tags question: http://stackoverflow.com/q/27806415
tags question: http://stackoverflow.com/q/27812234
tags question: http://stackoverflow.com/q/27948912
tags question: http://stackoverflow.com/q/27849501
tags question: http://stackoverflow.com/q/27884967
tags question: http://stackoverflow.com/q/27831016
tags question: http://stackoverflow.com/q/27908755
tags question: http://stackoverflow.com/q/27877662
tags question: http://stackoverflow.com/q/27875272
tags question: http://stackoverflow.com/q/27962742
tags question: http://stackoverflow.com/q/27947824

http://stackoverflow.com/a/27826263
has comment: http://stackoverflow.com/comment/44062414
has comment: http://stackoverflow.com/comment/44059631
has body: are you look for soemthing like this?: http://jsfiddle.net/y8oL13Ld/1/ $('.Contact-form').on('click', function() { $('.cta a').removeClass('selected'); $(this).addClass('selected'); if ($('.cloned-contactform').is(':visible')) { $('.cloned-contactform').removeClass('open'); $('.cloned-contactform').hide(); } else { $('.cloned-contactform').addClass('open'); $('.cloned-contactform').show(); } }); explanation: the OP js is a little convoluted in the logic. although i'm not exactly sure exactly the functionality of what the OP wants, i ripped all unnecessary js and fulfilled the requirements that: clicking OPEN FORUM adds the class selected to the anchor (and removes selected from other links if they have class selected) the div cloned-contactform's class open gets toggled the div cloned-contactform's visibility toggles EDIT: due to the refined definition of requirements i updated the jsfiddle: http://jsfiddle.net/y8oL13Ld/2/ the following jquery handles the fact that if the other links are clicked, it closes the div cloned-contactform and are selected. $('.Globe, .Search').on('click', function() { $('.cta a').removeClass('selected'); $(this).addClass('selected'); $('.cloned-contactform').removeClass('open'); $('.cloned-contactform').hide(); }); FINAL EDIT: hopefully lol, due to scope change. http://jsfiddle.net/y8oL13Ld/4/ $('.cta a').on('click', function(){ // if clicked contact link if ($(this).hasClass('contact')) { // if already selected if ($(this).hasClass('selected')) { // toggle $('.contact-div').removeClass('open'); $(this).removeClass('selected'); } // if not already selected else { // remove selected and open classes from all others $('.cta a').removeClass('selected'); $('.section').removeClass('open'); // apply selected and open classes to this $('.contact-div').addClass('open'); $(this).addClass('selected'); } } }); and i switched the html structure a little: contact div global div search div
accepted answer of: http://stackoverflow.com/q/27825756
has comment: http://stackoverflow.com/comment/44061272
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44062200
downvote count: 0
has comment: http://stackoverflow.com/comment/44059185
has comment: http://stackoverflow.com/comment/44063414
type: Answer
has comment: http://stackoverflow.com/comment/44058226
has comment: http://stackoverflow.com/comment/44062115
has comment: http://stackoverflow.com/comment/44061509
upvote count: 1
has comment: http://stackoverflow.com/comment/44061916
has comment: http://stackoverflow.com/comment/44059689
score: 1
answers question: http://stackoverflow.com/q/27825756

http://stackoverflow.com/comment/44091698
comment on: http://stackoverflow.com/q/27843664
score: 0
has text: You're only referencing 2 out of the 6 required scripts in this post. If you are referencing the other 4 please include them in your example - in the correct order - that way we can eliminate that issue as a possibility. `jquery.jeditable.js` is required for this to work as well.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27852078
has answer: http://stackoverflow.com/a/27852442
score: 0
upvote count: 1
downvote count: 1
answer count: 1
tagged with: jquery
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/44108273
has comment: http://stackoverflow.com/comment/44108348
has body: So im trying to display a JQUERY UI dialog box just to show some stuff, ive viewing some tutorials and i finall got one that it kind of works, but it works weird, because it creates a strange result, what is what im doing wrong? im new with this MVC 4 and JQuery stuff. here is the code im using: @{ ViewBag.Title = "Exito"; } This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon. @{ ViewBag.Title = "Hola, Escribiste: "; } @ViewBag.Title @ViewBag.Message Any idea?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44108270
has title: Weird Jquery UI dialog box on MVC 4 ASP .NET
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/44108118
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/44108368

http://stackoverflow.com/comment/44116125
has text: I'm sorry that didn't work
comment on: http://stackoverflow.com/q/27841400
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27828894
answers question: http://stackoverflow.com/q/27828434
upvote count: 1
has body: Take a look at: Constructive Solid Geometries. Intro here: http://learningthreejs.com/blog/2011/12/10/constructive-solid-geometry-with-csg-js/
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44102713
type: Answer
accepted answer of: http://stackoverflow.com/q/27828434

http://stackoverflow.com/q/27877068
has answer: http://stackoverflow.com/a/46381332
tagged with: local-storage
has body: I have a simple navigation menu. Home link has a dropdown active class. I need to do this: When user press for example Article link, jquery has to remove dropdown active class from Home and set this class to selected link. I know that I can use removeClass and addClass , but I need to keep selected link class when page is reload. I heard about cookies and localstorage to set class, but I don't know how. Can someone help me? Home Articles About
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44155621
has title: Jquery add class and keep when page reload
has answer: http://stackoverflow.com/a/41250867
accepted answer: http://stackoverflow.com/a/27877198
tagged with: cookies
downvote count: 1
has answer: http://stackoverflow.com/a/27877295
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27877295
tagged with: jquery
has answer: http://stackoverflow.com/a/68156939
upvote count: 4
score: 3
has answer: http://stackoverflow.com/a/27877198
has answer: http://stackoverflow.com/a/57660629
has comment: http://stackoverflow.com/comment/44155606
answer count: 7
has answer: http://stackoverflow.com/a/34957409
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44167897
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27882654
has text: The html is looking somehow like that. by cliking the button i want to open the iframe which in css is display:none to show: this happens how ever i cannot jump to the iframe section
score: 0

http://stackoverflow.com/a/27887913
type: Answer
has comment: http://stackoverflow.com/comment/44212321
score: 3
answers question: http://stackoverflow.com/q/27887884
downvote count: 0
has comment: http://stackoverflow.com/comment/44176829
upvote count: 3
has comment: http://stackoverflow.com/comment/44176952
has body: You can assign a key to the window object. It'll be a global variable. function foo(){ var bar1; // Local variable bar1 = 11; window.bar2 = bar1; // bar2 will be global with same value. } Or In pure JavaScript, if you will declare a variable without var anywhere, it will be in the global scope. function foo(){ var bar1; // Local variable bar1 = 11; bar2 = bar1; // bar2 will be global with same value. } Note: In the above text, if bar2 won't be declared yet, it will go to the window scope, otherwise it will just update bar2. If you want to make sure about using the global one, use like window.bar2 = bar1.
has comment: http://stackoverflow.com/comment/44176817
has comment: http://stackoverflow.com/comment/44176849

http://stackoverflow.com/comment/44116913
comment on: http://stackoverflow.com/a/27855862
score: 0
type: AnswerComment
has text: @user2713706 - Please see my edited answer. And read the informative answer i have linked to.
type: Comment

http://stackoverflow.com/a/27910361
has body: You can define a named that does what you want: var fnc = function(object) { return { value: object.uf.descricaoUf, municipioId: object.municipioId, descricaoMunicipio: object.uf.descricaoUf, id: object.municipioId }; } And then use it like this: filter: function(response) { return $.map(response, function (object) { return fnc(object); }); } Or you can just write: filter: function(response) { return $.map(response, fnc); }
accepted answer of: http://stackoverflow.com/q/27910177
answers question: http://stackoverflow.com/q/27910177
type: Answer
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/44235783
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27915996
has text: Show an actual example of content that causes the problem described, and specify *how* the text may be divided into lines. Textarea formatting is very special. If you really want to have words broken at arbitrary points without indicating in any way that a word has been broken, you should include this is in the question.

jstl
tags question: http://stackoverflow.com/q/27902966
tags question: http://stackoverflow.com/q/27858926
type: Tag
tag name: jstl
tags question: http://stackoverflow.com/q/27895987
tags question: http://stackoverflow.com/q/27925219

http://stackoverflow.com/a/27852538
score: 9
type: AcceptedAnswer
has body: You could use an ng-model and access it in your ng-change callback, or just pass it through. Please select a size angular.module('app', []).controller('ctrl', function($scope) { $scope.sizes = "Small,Medium,Large,X Large,XX Large"; $scope.handleChange = function() { console.log($scope.selectedSize) } }); Please select a size
upvote count: 9
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27852492
accepted answer of: http://stackoverflow.com/q/27852492

http://stackoverflow.com/a/27822037
score: 0
answers question: http://stackoverflow.com/q/27821625
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44077821
accepted answer of: http://stackoverflow.com/q/27821625
type: Answer
has comment: http://stackoverflow.com/comment/44076927
has comment: http://stackoverflow.com/comment/44077049
has body: From my comment: As far as I can tell you cannot do this with a static file. The server must send specific data to the client to trigger the event. see: developer.mozilla.org/en-US/docs/Server-sent_events/… My best advice whould be to set up a timeout and perform a HEAD request and check to see if the Last Modified date has changes on the XML file. Similar question: $.ajax() call, only on updation $.ajax({ type: "GET", ifModified: true, url: 'js/data.xml', dataType: "xml", success: parse }); This will only call success if the XML file has been updated since the last request.

http://stackoverflow.com/q/27930010
has comment: http://stackoverflow.com/comment/44258584
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44259209
has answer: http://stackoverflow.com/a/27930992
accepted answer: http://stackoverflow.com/a/27930992
type: Question
has title: How to attach an HTML element or a DocumentFragment to the DOM?
has body: I’ve got an HTML fragment like Hello, World! and want to attach it to the container HTML page that includes There are two package that came to my mind: kotlin.js.dom.html.window.document.* kotlin.browser.document.* Which should I use and how do I access the document’s root? I’ve already tried document.getElementById("container") whereby container is the id of a DIV. But this returns null. I also tried document.appendChild(node)... Also which of the above packages should I prefer?
tagged with: javascript
tagged with: kotlin
score: 0
answer count: 1

http://stackoverflow.com/a/49128655
has body: Option 'timeSlice' is a way to time limit recording. It would be help follow example: function captureMicrophone(callback) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(function(microphone) { callback(microphone); }).catch(function(error) { log(error); }); } var blobs = []; var audio = document.querySelector('audio'); captureMicrophone(function(microphone) { setSrcObject(microphone, audio); audio.play(); recorder = RecordRTC(microphone, { recorderType: StereoAudioRecorder, mimeType: 'audio/wav', desiredSampRate: 16000, numberOfAudioChannels: 1, timeSlice: 50, // pass this parameter // getNativeBlob: true, ondataavailable: function(blob) { blobs.push(blob); var size = 0; blobs.forEach(function(b) { size += b.size; }); ///// } }); recorder.startRecording(); recorder.microphone = microphone; document.getElementById("start").disabled = true; document.getElementById("stop").disabled = false; });
score: 0
answers question: http://stackoverflow.com/q/27945484
type: Answer

http://stackoverflow.com/q/27943807
has comment: http://stackoverflow.com/comment/44283999
answer count: 0
tagged with: javascript
type: UnansweredQuestion
favorite count: 0
has title: page does not load if using redirect on angular
tagged with: angularjs
type: Question
has body: We have a site that runs on angular (link listed below) If we go to it directly everything works ok. If we redirect to the page from another page, the page doesn't load. Two examples: http://www.maaboret.com/ redirect from static page: http://maaboret.com/not-found press the HTML5 logo to go back home to see the bug Any help would be appreciated. Thanks in advance.
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44283034

http://stackoverflow.com/comment/44147029
comment on: http://stackoverflow.com/q/27865116
has text: You [can't have multiple modals open simultaneously](http://getbootstrap.com/javascript/#callout-stacked-modals) in Bootstrap in the first place...
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27939547
score: 2
has comment: http://stackoverflow.com/comment/44275490
downvote count: 0
has body: You can add '/' to separate between parameters. Also url parameters can only be integers and strings, therefore objects must be converted to json, or not being included in the url. .state('app.home', { url: '/home/:playSavedPlaylist/:playlistData', views: { 'menuContent' :{ templateUrl: 'templates/home.html', controller: 'HomeCtrl' } } }); $state.go('app.home', { playSavedPlaylist:true, playlistData: angular.toJson(dataToPass) } //, { location: false, inherit: false} &lt;-- will exclude parameters from url );
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27939447

http://stackoverflow.com/comment/44082376
type: AnswerComment
score: 0
type: Comment
has text: How can I use it in ?
comment on: http://stackoverflow.com/a/27839304

http://stackoverflow.com/a/27883716
accepted answer of: http://stackoverflow.com/q/27883641
has body: You want to attach nextButton as a click handler, not execute it immediately. You could write : $(".slick-next").click(nextButton); except for the need to pass an argument. That's what .bind() is for : $(".slick-next").click(nextButton.bind(null, timeout)); Also, the setTimeout expression will simplify : timeout = setTimeout(loadPHP, 3000);
answers question: http://stackoverflow.com/q/27883641
score: 0
has comment: http://stackoverflow.com/comment/44169244
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44191038
has comment: http://stackoverflow.com/comment/44169288
type: Answer

ascii
tags question: http://stackoverflow.com/q/27892047
type: Tag
tag name: ascii

http://stackoverflow.com/q/27867307
has comment: http://stackoverflow.com/comment/44137300
has comment: http://stackoverflow.com/comment/44137193
has comment: http://stackoverflow.com/comment/44137237
possible better answer: http://stackoverflow.com/a/27867590
has comment: http://stackoverflow.com/comment/44137221
type: AnsweredQuestion
has body: Could somebody explain how come this is only returning 1 result (there should be 4). Its only returning the most recent post title, where I would like to be getting all the post titles in the category (ID: 121) which in this case is four. &lt;script type="text/javascript"&gt; var posturl = "http://www.tropical420.com/api/get_posts/?posts_per_page=-1"; $.ajax({ type: 'GET', url: posturl, complete: function(){ }, success: function (data) { var response = data; //JSON.parse(data); //loop through posts for(var i = 0; i != response.posts.length; i++) { //get each element in the array var post = response.posts[i]; // post vars var postTitle = post.title; var postContent = post.content; var postCategory = post.categories[i].id; // output stuff so we can see things if (postCategory == '121') { $("#post").append(postTitle + "&lt;br /&gt;").trigger('create'); } } }, error:function (xhr, ajaxOptions, thrownError) { alert("Error"); } }); &lt;/script&gt; &lt;div id="post"&gt;&lt;/div&gt;
accepted answer: http://stackoverflow.com/a/27867442
has comment: http://stackoverflow.com/comment/44137225
has comment: http://stackoverflow.com/comment/44137203
has comment: http://stackoverflow.com/comment/44137299
type: Question
has comment: http://stackoverflow.com/comment/44137245
has answer: http://stackoverflow.com/a/27867442
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/27867590
score: 0
has comment: http://stackoverflow.com/comment/44137125
has comment: http://stackoverflow.com/comment/44137696
answer count: 2
has title: Only 1 result from JSON loop
upvote count: 1
has comment: http://stackoverflow.com/comment/44137241
downvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44137198
favorite count: 0
has comment: http://stackoverflow.com/comment/44137317
has comment: http://stackoverflow.com/comment/44137251
has comment: http://stackoverflow.com/comment/44137218

http://stackoverflow.com/q/27840056
tagged with: jquery
answer count: 3
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44083774
has answer: http://stackoverflow.com/a/27840115
score: 3
has body: How to find anchor link within anchor tag and click on that link automatically in jquery. example mytestinglink
linked to: http://stackoverflow.com/q/9666471
upvote count: 3
has title: How to find anchor link within anchor tag and click on that link automatically using jquery
type: Question
has answer: http://stackoverflow.com/a/27840213
has answer: http://stackoverflow.com/a/27840076
tagged with: javascript

http://stackoverflow.com/a/27933736
downvote count: 0
answers question: http://stackoverflow.com/q/27933628
accepted answer of: http://stackoverflow.com/q/27933628
type: Answer
has body: All praise Jasper as I was building this fiddle with the same suggestion: Needs $(this) instead of this http://jsfiddle.net/o8bm0vxx/
score: 2
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/27808478
answer count: 2
has body: Everything seems to work fine when I add records using my form. They all show up nicely on the page. When I press on the delete button that is generated with each record, it removes the record and reloads the page. This also works. The second time I do this though, my records seem to vanish. For example, I add 5 records titled : a,b,c,d,e. They show up, I delete record b, the list reloads with a,c,d,e without a problem. The moment I delete c from the newly generated list my e record vanishes, so it shows only a and d. Clearly I am doing something horribly wrong, I am hoping someone can show me what that is. If it's bad programming practice this way, please let me know in what direction to search for the right way. I have 3 seperate pages: Storing records: function storeEntry(){ var myId = localStorage.length; addBtn.addEventListener("touchstart", submitEntry, false); addBtn.addEventListener("mousedown", submitEntry, false); function submitEntry(event) { //Get the form data to store in the Array var myTitle = document.getElementById("myTitle").value; var myDate = document.getElementById("myDate").value; var myContent = document.getElementById("myContent").value; //Fill array that will be placed in localstorage var myArray = [myId,myTitle,myDate,myContent]; //Store it as a json string localStorage.setItem(myId, JSON.stringify(myArray)); //Provide feedback alert("Item: " + myTitle + " has been added with id: "+myId); //Id +1 zodat het volgende item een uniek id krijgt. myId=myId+1; //Clear the form setFields(); } } For deleting records: function deleteEntry(){ var key=localStorage.key(this.i); this.removeEventListener("click",deleteEntry); localStorage.removeItem(key); alert("Item : "+key+" is verwijderd!"); window.location.href = "showEntry.html"; } And finally for showing records: function loadEntries(){ var myEntryBox = document.getElementById("entryBox"); var myvar=""; for(var i=0;i&lt;=localStorage.length;i++){ if(localStorage.getItem(i)!==null) { var myData = JSO…
has answer: http://stackoverflow.com/a/27809699
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27819224
accepted answer: http://stackoverflow.com/a/27809699
has answer: http://stackoverflow.com/a/27819224
tagged with: local-storage
type: Question
has title: localStorage loop missing records after deleting 2 records ( on a different page )
tagged with: javascript
score: 0

http://stackoverflow.com/q/27909353
has comment: http://stackoverflow.com/comment/44218524
has comment: http://stackoverflow.com/comment/44218458
has comment: http://stackoverflow.com/comment/44218225
has comment: http://stackoverflow.com/comment/44218481
score: 0
has comment: http://stackoverflow.com/comment/44219187
has comment: http://stackoverflow.com/comment/44218793
has comment: http://stackoverflow.com/comment/44218483
type: Question
has body: I am a beginner to JavaScript and currently going through the The Complete Reference 3rd Edition by Thomas A. Powell , Fritz Schneider. I quote an extract from the same book regarding the difference b/w The constructor Property and instanceof Operator. The difference is subtle, though. The instanceof operator will recursively check the entire internal prototype chain (meaning all the ancestor types), whereas the constructor check as shown will only check the immediate object instance’s property. This ancestral checking is often very useful in inherited programming patterns with many layers of inheritance: function Robot(){ } function UltraRobot(){ } var robot = new Robot(); var guard = new UltraRobot(); alert(robot.constructor == Robot); // true alert(guard.constructor == UltraRobot); // true guard.constructor = Robot; // Set up inheritance alert(robot instanceof Robot); // true alert(guard instanceof UltraRobot); // true alert('Here'); alert(guard instanceof Robot); // true, through Inheritance alert(guard instanceof Object); // true, all objects descend from Object However, the below line in the author's book, alert(guard instanceof Robot); // true, through Inheritance for me, results in false, which leaves me in guessing how the the instanceof operator will recursively check the entire internal prototype chain.
has comment: http://stackoverflow.com/comment/44218304
has title: Setting up inheritance through the constructor Property and instanceof Operator
has comment: http://stackoverflow.com/comment/44218283
tagged with: javascript
has comment: http://stackoverflow.com/comment/44218414
tagged with: inheritance
has comment: http://stackoverflow.com/comment/44218624
has comment: http://stackoverflow.com/comment/44220638
has comment: http://stackoverflow.com/comment/44218586
answer count: 1
has comment: http://stackoverflow.com/comment/44218674
has comment: http://stackoverflow.com/comment/44218348
has answer: http://stackoverflow.com/a/29527647
has comment: http://stackoverflow.com/comment/44218280
tagged with: instanceof
has comment: http://stackoverflow.com/comment/44219044
tagged with: constructor
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44218124

mouseevent
tags question: http://stackoverflow.com/q/27826040
tags question: http://stackoverflow.com/q/27826877
type: Tag
tags question: http://stackoverflow.com/q/27882822
tag name: mouseevent

http://stackoverflow.com/a/27823638
downvote count: 0
has body: Just the relevant field: schedule: paramsObj.isfirst ? firstSched : paramsObj.issecond ? secondSched : paramsObj.isthird ? thirdSched : undefined Full call: $.ajax({ type: 'POST', name: 'Submitting Request', url: '/breadcrumbs/crumb', dataType: 'json', data: { parameters: paramsObj, schedule: paramsObj.isfirst ? firstSched : paramsObj.issecond ? secondSched : paramsObj.isthird ? thirdSched : undefined, success: function(){}, error: function(jqXHR, status, error) {} }); Note As others have pointed out, chaining ternaries can be hard to read, which can lead to bugs and maintenance problems. I personally don't mind chaining them, as long as they are broken out per line, as shown, so that they are easy to follow...
score: 6
type: Answer
has comment: http://stackoverflow.com/comment/44054002
accepted answer of: http://stackoverflow.com/q/27823561
upvote count: 6
answers question: http://stackoverflow.com/q/27823561
type: AcceptedAnswer

http://stackoverflow.com/comment/60975648
comment on: http://stackoverflow.com/a/27829383
score: 0
has text: I'm surprised this doesn't have more upvotes... excellent answer
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27924862
type: Answer
has body: add css #siteSealFauxBadge div:first-child { margin: 0 auto; } You will get the result as shown in picture
score: 0
answers question: http://stackoverflow.com/q/27924609

http://stackoverflow.com/comment/44212709
comment on: http://stackoverflow.com/q/27902548
score: 0
type: Comment
type: QuestionComment
has text: @BasiaMadej I tried, no success :\ I got one error (that also appear locally, but locally everything works perfectly) " Uncaught TypeError: Cannot read property 'getPropertyValue' of nullapplication-e2786e56672a7d4ac3f163e21d385be2.js:18"

http://stackoverflow.com/comment/44272283
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27937844
has text: This needs `role="button"`, `tabindex="0"` and you need to trigger the click for space bar as well.
type: AnswerComment

http://stackoverflow.com/comment/44112956
type: Comment
comment on: http://stackoverflow.com/a/27854518
has text: Yes, that's right! It's a totally different behaviour when using `window.open()`.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27855223
has title: know when data has finished loading(promised) from Infinite scroll factory
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44121184
has body: Below Infinite-scroll factory i am using to get data from backend, is there any where to apply $promise to this method as in controller i need to know when data has finished loading . Factory : app.factory('Gallery', function($http) { var Gallery = function(media, album_type) { this.items = []; this.busy = false; this.next = '/upload/list/'+ media +'/?album='+album_type+'&amp;page=1'; this.end=false; }; Gallery.prototype.nextPage = function() { if (this.busy) return; this.busy = true; if (this.next){ var url = this.next; } else{ this.end=true; this.busy = false; return } $http.get(url).success(function(data) { var items = data.results; for (var i = 0; i &lt; items.length; i++) { this.items.push(items[i]); } this.next=data.next; this.busy = false; if (!data.next) this.end=true; this.count=data.count; }.bind(this)); }; return Gallery; }); In Controller; $scope.images = $scope.images || new ScrollGallery('image', 'CRP');
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27861361
score: 0

http://stackoverflow.com/q/27954229
score: 3
upvote count: 3
type: Question
has title: Upload file to Google Cloud Storage using AngularJS multipart form data
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: file-upload
favorite count: 0
has answer: http://stackoverflow.com/a/27992276
tagged with: angularjs
type: UnansweredQuestion
tagged with: google-app-engine
has body: I'm trying to upload an image file to Google Cloud Storage from AngularJS using the multipart method specified in https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#multipart I generate an 'Authorization' header token server side and use that for authentication. I can successfully upload the image using postman (https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en) by attaching the image in the 'binary' field. I've been using this jsfiddle.net/JeJenny/ZG9re/ fiddle to try manual upload but it's returning me 400 bad request error and I've checked all the header fields and they seem to be all good. I was wondering if anyone has had experience in uploading images to Google Cloud Storage using AngularJS. Thanks

ios
tags question: http://stackoverflow.com/q/27832823
tags question: http://stackoverflow.com/q/27950072
tags question: http://stackoverflow.com/q/27855802
type: Tag
tags question: http://stackoverflow.com/q/27907024
tags question: http://stackoverflow.com/q/27905761
tags question: http://stackoverflow.com/q/27860346
tags question: http://stackoverflow.com/q/27894835
tags question: http://stackoverflow.com/q/27940858
tags question: http://stackoverflow.com/q/27810716
tags question: http://stackoverflow.com/q/27944130
tags question: http://stackoverflow.com/q/27832927
tags question: http://stackoverflow.com/q/27837068
tags question: http://stackoverflow.com/q/27945592
tags question: http://stackoverflow.com/q/27878450
tag name: ios
tags question: http://stackoverflow.com/q/27812158
tags question: http://stackoverflow.com/q/27819584
tags question: http://stackoverflow.com/q/27906965
tags question: http://stackoverflow.com/q/27910776
tags question: http://stackoverflow.com/q/27916518
tags question: http://stackoverflow.com/q/27853020
tags question: http://stackoverflow.com/q/27936269
tags question: http://stackoverflow.com/q/27858192
tags question: http://stackoverflow.com/q/27866004
tags question: http://stackoverflow.com/q/27879983
tags question: http://stackoverflow.com/q/27849465
tags question: http://stackoverflow.com/q/27941075
tags question: http://stackoverflow.com/q/27898769
tags question: http://stackoverflow.com/q/27956441
tags question: http://stackoverflow.com/q/27915310
tags question: http://stackoverflow.com/q/27909938

http://stackoverflow.com/comment/44214821
has text: "jscript way" so loop through every 'a' tag, do a find and replace of the href attribute, that's very doable
comment on: http://stackoverflow.com/q/27907745
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28012727
upvote count: 1
has body: Paper.js deals with 2D vector graphics. While in theory you can represent a cube if you want to, using skewed squares for example, it will take a lot of effort and a lot of time to just create 1 cube. You are much better of using a 3D library, e.g - Three.js. Here is an already cooked up example using raycasting to detect the clicks on a side of the cube: http://mrdoob.github.io/three.js/examples/canvas_interactive_cubes.html
downvote count: 0
answers question: http://stackoverflow.com/q/27817542
type: Answer
score: 1

http://stackoverflow.com/comment/44237570
comment on: http://stackoverflow.com/q/27919965
type: Comment
type: QuestionComment
score: 0
has text: yes, exactly! It is possible?

splunk
tags question: http://stackoverflow.com/q/27841198
type: Tag
tag name: splunk

http://stackoverflow.com/q/27915909
tagged with: javascript
has comment: http://stackoverflow.com/comment/44263275
has title: Google Diff Charts using JSON datatable returning [all series on a given axis must be of the same data type]
has body: I am trying to generate a diff chart to compare two set of data using Google Visualization. (https://developers.google.com/chart/interactive/docs/gallery/diffchart) Data A: {"cols":[{"label":"Month","type":"string"},{"label":"Total","type":"number"},{"type":"string","role":"style","p":{"role":"style"}}],"rows":[{"c":[{"v":"8","f":"2014-08"},{"v":"68435.52"},{"v":"orange"}]}]} Data B: {"cols":[{"label":"Month","type":"string"},{"label":"Total","type":"number"},{"type":"string","role":"style","p":{"role":"style"}}],"rows":[{"c":[{"v":"9","f":"2014-09"},{"v":"67348.25"},{"v":"orange"}]}]} But I keep getting this error whenever I draw the chart: all series on a given axis must be of the same data type Here is my code: var dataA = new google.visualization.DataTable(data1); var dataB = new google.visualization.DataTable(data2); var chart = new google.visualization.ColumnChart(document.getElementById('chart_div')); var diffData = chart.computeDiff(dataA, dataB); chart.draw(diffData); -- EDIT: jsFiddle: http://jsfiddle.net/9svvm1rj/
score: 0
answer count: 1
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27935292
type: Question
tagged with: charts
tagged with: google-visualization
accepted answer: http://stackoverflow.com/a/27935292

http://stackoverflow.com/q/27941693
type: UnansweredQuestion
tagged with: contextmenu
has answer: http://stackoverflow.com/a/27941694
type: Question
has body: I have tried anything to get the selected text for a context menu, but it is not working in IE11. For context menu adding I have added some code in registry, and a htm file with a Javascript. First I have tried this: var parentwin = external.menuArguments; var doc = parentwin.document; var sel = doc.selection; var rng = sel.createRange(); var selectedtext = new String(rng.text); then I have read in IE11 documentation, the document.selection has been repalced in the API with window.getSelection(); So I have tried any variant, window.getSelection... nothing works... Any idea how I can access the selected text? And I have searching also how I can copy to the clipboard.. in chrome I have used this script: function copyToClipboard(text){ var copyDiv = document.createElement('div'); copyDiv.contentEditable = true; document.body.appendChild(copyDiv); copyDiv.innerHTML = text; copyDiv.unselectable = "off"; copyDiv.focus(); document.execCommand('SelectAll'); document.execCommand("Copy", false, null); document.body.removeChild(copyDiv); }
tagged with: internet-explorer
tagged with: javascript
score: 0
has title: How I can access the selected text in IE11 from context menu, and copy to Clipboard
answer count: 1

http://stackoverflow.com/a/27863983
type: Answer
answers question: http://stackoverflow.com/q/27862687
has comment: http://stackoverflow.com/comment/44131499
upvote count: 1
downvote count: 0
score: 1
has body: You will probably find that it is more efficient to do this when parsing your JSON string by using a reviver function. Something like this. var json = '[{"a1" : "a1Val", "a2" : "a2Val", "a3" : "a3Val"},{"b1" : "b1Val", "b2" : "b2Val", "b3" : "b3Val"},{"z1" : "z1Val", "z2" : "z2Val", "z3" : "z3Val"}]', data = JSON.parse(json, function (key, value) { if (key !== "" &amp;&amp; typeof value === 'object') { Object.keys(value).forEach(function (name) { if (name.slice(-1) !== '2') { delete value[name]; } }); } return value; }); document.body.appendChild(document.createTextNode(JSON.stringify(data)));

http://stackoverflow.com/comment/44278489
has text: Not having clearInterval(intervalID) in the function itself would have left me stranded for a bit figuring that out. Thanks!
comment on: http://stackoverflow.com/a/27941022
type: AnswerComment
score: 0
type: Comment

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

http://stackoverflow.com/comment/44114338
has text: Hey you use jQuery i need to use native javascript sorry. If you will look on my markup you'll see a tag. What I want to do is by default dispaly inside the tag the default value of data-email which is "youremail@email.com" now when button was click it will then change to this "newemail@email.com" got it?
type: AnswerComment
comment on: http://stackoverflow.com/a/27855534
score: 0
type: Comment

http://stackoverflow.com/comment/44160490
has text: what is `$('#requestButton')` ... is this form related?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27879399
score: 0

http://stackoverflow.com/comment/44127535
comment on: http://stackoverflow.com/q/27862687
score: 1
has text: I expect you mean you want a dictionary with only the pairs specified? The problem is that dictionaries are not ordered. Do the keys actually contain numbers?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27894030
type: Question
upvote count: 2
answer count: 2
has body: I am trying to create a Chrome extension which would get a URL from image or link right clicked by user and passing this URL to Google search, all from within the context menu. I have it working perfectly on Firefox XPI: var cm = require("sdk/context-menu"); var tabs = require("sdk/tabs"); var searchMenu = cm.Item({ label: "defi!", data: "https://www.google.co.il/search?hl=iw&amp;gl=il&amp;tbm=nws&amp;authuser=0&amp;q=", context: cm.SelectorContext("a[href]"), contentScript: 'self.on("click", function (node, data) {' + ' var searchURL = data + node.href;' + ' window.location.href = searchURL;' + '});', items: [searchMenu] }); I want the same thing to happen on a Chrome context-menu Extension. almost similar to this question: Chrome Extension that copies image URL on click I had this script working just before posting a question but always got undefined for srcUrl: Damn.js chrome.contextMenus.create({ title: "Blah", contexts:["image", "link"], onclick:function(info){ handleImageURL(info.srcUrl); } }); function handleImageURL(info) { var data = "https://www.google.co.il/search?hl=iw&amp;gl=il&amp;tbm=nws&amp;authuser=0&amp;q="; var searchURL = data + [info.srcUrl]; chrome.tabs.create({url: searchURL}); } and Manifest.json { "name": "blah", "description": "blah", "version": "1.0", "permissions":["tabs", "contextMenus"], "background": {"scripts":["damn.js"]}, "manifest_version": 2 } But it's not working now at all.. not sure why.. Edited script above working all the way to google search but don't fetch image or link url
tagged with: javascript
has answer: http://stackoverflow.com/a/33451017
tagged with: google-chrome-extension
has title: chrome extension to copy image or link target url
downvote count: 1
linked to: http://stackoverflow.com/q/10423670
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27894174
has comment: http://stackoverflow.com/comment/44198591
score: 1
has comment: http://stackoverflow.com/comment/44217324

http://stackoverflow.com/q/27852954
answer count: 1
has answer: http://stackoverflow.com/a/27854482
tagged with: javascript
tagged with: jquery
downvote count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has title: Center binary tree with css or js
favorite count: 0
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27854482
type: Question
score: -2
has body: TRANSLATED: I need to centralize this binary tree with css or js . Jquery is an available option. The html code will be generated by php script nested array format. I have created this Fiddle for help. thanks in advance Html: root name 150 lft name 200 lft name 100 lft name 200 lft name 50 lft name 50 rgt name 100 rgt name 150 rgt name 50 rgt name 0 rgt name 100 lft name 50 rgt name 100 lft name 50 lft name 150 rgt name 200 rgt name 50 Css: .root { position: absolute !important; margin:0; padding:0; overflow-x: auto; display:block; text-align:center; background-color: #ddd; } .node { width: auto; height:auto; } .lft, .rgt { margin:5px; margin-top: 20px; min-width:60px; min-height:60px; position:relative; } .rgt { border:1px solid #000; float:right; background-color: #ccc; } .lft { border:1px solid #fff; float:left; background-color: #eee; }

http://stackoverflow.com/q/27872683
has title: Exporting citation of a journal article using R
possible better answer: http://stackoverflow.com/a/27873999
tagged with: web-scraping
type: AnsweredQuestion
has body: I want R to: Go THIS page. Select "Bibtex" as Format, "Citation and Abstract" for "Export type". Press "Submit" and download the citation file to a designated folder. Is it possible? How can I do that with R? (I don't know JavaScript and I couldn't understand earlier topics much related to this issue. 1, 2, 3) Eventually, I want to download all bibtex (and possibly Endnote) citations of a journal (for example THIS journal).
has answer: http://stackoverflow.com/a/27873240
type: Question
answer count: 2
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r
score: 0
accepted answer: http://stackoverflow.com/a/27873240
has answer: http://stackoverflow.com/a/27873999

http://stackoverflow.com/comment/44175421
type: Comment
type: QuestionComment
has text: Have a look at [this other answer](http://stackoverflow.com/questions/27886425/how-to-check-whether-user-has-checked-at-least-one-checkbox-from-a-group-of-chec#answer-27886488), it seems to do this perfectly.
comment on: http://stackoverflow.com/q/27886425
score: 0

http://stackoverflow.com/comment/44302753
has text: You need to add `.listen()` after your `add()` call to bind to the var.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27953240

http://stackoverflow.com/q/27816115
favorite count: 0
type: UnansweredQuestion
score: 1
tagged with: forms
upvote count: 1
has title: How to test form .submit() with Jasmine
type: Question
linked to: http://stackoverflow.com/q/7418217
has body: I have method like that: function submitMe() { if(someVal == true) { $('#myForm').submit(); } } I would like to test it with jasmine, but I really don't know how... I've found this answer: How do I test a form submit in Jasmine? but it looks like creating new form within test, and moreover this won't work... I can't just spyOn(form, "submit"). I've tried spy on callback also... Should I rewrite my code? I want to know, whether my form was submitted or not?
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/34545531
tagged with: submit
answer count: 1
tagged with: jasmine

http://stackoverflow.com/comment/59117936
has text: fatbotdesigns, do you want to post an answer for that ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27958186
type: Comment

http://stackoverflow.com/a/28060922
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/119352885
type: Answer
has body: Steven here from Segment. We recommend loading analytics.js on a background page, so as not to interfere with the analytics tools that have already been loaded onto the page. In either case, you would do the following: Create a file called snippet.js with the analytics.js snippet inside it. Inject the file onto the current page: chrome.tabs.executeScript(null, {file: 'snippet.js'});
has comment: http://stackoverflow.com/comment/120054569
downvote count: 1
accepted answer of: http://stackoverflow.com/q/27912213
upvote count: 5
answers question: http://stackoverflow.com/q/27912213
score: 4
has comment: http://stackoverflow.com/comment/123659278

http://stackoverflow.com/comment/44083984
score: 0
type: AnswerComment
type: Comment
has text: how can i disable / return false in the page load
comment on: http://stackoverflow.com/a/27840029

http://stackoverflow.com/comment/44119361
type: QuestionComment
score: 0
has text: @Hacketo Thanks, I did search but didn't find that post. - Edit: No that's a different issue in the post. Although the answer is useful.
comment on: http://stackoverflow.com/q/27858168
type: Comment

http://stackoverflow.com/q/27880167
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44162278
upvote count: 3
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44162373
accepted answer: http://stackoverflow.com/a/27880269
answer count: 1
has comment: http://stackoverflow.com/comment/44162229
tagged with: javascript
tagged with: jquery
has title: Understanding Crockford's walk_the_dom ("The Good Parts")
has comment: http://stackoverflow.com/comment/44162503
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27880269
favorite count: 0
has body: I'm trying to work through to understand Crockford's walk_the_dom function below. Here is my logic and the DOM tree I am working with. I don't see when node.nextSibling is reached. function walk(node, func) { func(node); node = node.firstChild; while (node) { walk(node, func); node = node.nextSibling; } }; func(node) runs a function on the given node. node=node.firstChild() is now equal to the firstChild of document.body, or in this case, H1 while(node) runs a loop where the walk function is run again. func(node) now runs a function on H1 node = node.firstChild() is now equal to the firstChild of H1, also known as #text in this case while(node) runs a loop where the walk function is run again func(node) runs a function on #text node = node.firstChild() --> what is the firstChild of #text? when is node.nextSibling reached?
tagged with: recursion
score: 2

http://stackoverflow.com/comment/44276362
has text: I guess the important question is when/where is `if(confirm_flag) {... }` executed.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27940053
score: 0

http://stackoverflow.com/q/27898720
tagged with: javascript
score: 0
answer count: 3
has body: The following url provide a great example for getting elevation by clicking on a map.. https://developers.google.com/maps/documentation/javascript/examples/elevation-simple I want to enter specific latitude and longitude values instead of clicking. Using the following HTML and javascript results in "undefined" on entering lat-long. What did I miss? Enter Lat-Long to get Google Earth Level Lat: Long: Submit
tagged with: elevation
has answer: http://stackoverflow.com/a/36184755
has title: google earth elevation from latitude and longitude values
has answer: http://stackoverflow.com/a/27902606
type: UnansweredQuestion
tagged with: dictionary
has answer: http://stackoverflow.com/a/27900327
type: Question

http://stackoverflow.com/comment/44075331
score: 1
has text: Hi @dori naji Thanks man it worked!!!! I would like to add a correction it should be (class_level_grid) not (class_level_grid_div) while checking for registery.. if(typeof registry.byId("class_level_grid") != "undefined"){ registry.byId("class_level_grid").destroyRecursive(); } marking it as answered.. thanks once again
comment on: http://stackoverflow.com/a/27821535
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44147387
comment on: http://stackoverflow.com/q/27872499
type: Comment
type: QuestionComment
has text: Have you even tried an attempt at implementing the idea or you want some one to write it for you ?
score: 0

http://stackoverflow.com/q/27817818
answer count: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/27817909
has answer: http://stackoverflow.com/a/27817988
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27817909
type: Question
has title: Create directive in angularJs
has body: I'm trying to create a directive in angularJS. But it's not working. What I have done is as follow. my main html code Hello Plunker! My Js code : var app = angular.module('birthdayToDo', []); app.controller('main', function($scope) { $scope.employees=[ { Name:"Amit", Email:"Amit@gmail.com" }, { Name:"Ajay", Email:"Ajay@gmail.com" }, { Name:"Rahul", Email:"Rahul@gmail.com" }, { Name:"Aakash", Email:"Aakash@gmail.com" }, { Name:"Rohit", Email:"Rohit@gmail.com" }, ]; }); app.directive('myCustomer', function() { var directive = {}; directive.restrict = 'E'; /* restrict this directive to elements */ directive.templateUrl = "directiveFile.html"; return directive; }); my directiveFile.html code SNo. Name Email {{$index+1}} {{employee.Name}} {{employee.Email}} But this code is not working . What's wrong I'm doing. Plunker link
possible better answer: http://stackoverflow.com/a/27817944
has answer: http://stackoverflow.com/a/27817944
score: 0

http://stackoverflow.com/q/27882288
has title: Pass value to factory angularjs
tagged with: angularjs
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44166778
accepted answer: http://stackoverflow.com/a/27882352
has comment: http://stackoverflow.com/comment/44166885
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44166479
has body: I would like to pass article id from url to factory but I can't get the value from $routeChangeSuccess callback. myApp.controller('editCtrl', function($rootScope, $scope, getArticleById, $filter, $route, $routeParams) { var article_id = $rootScope.$on('$routeChangeSuccess', function () { return $routeParams.id; }); getArticleById.get(article_id).then(function(data) { $scope.articles = data; }); }); myApp.factory('getArticleById', function($q, $http) { return { get: function(article_id) { var deferred = $q.defer(); $http.get('/api/admin/article/edit/'+ article_id).success(function(result) { deferred.resolve(result); }).error(function(result) { deferred.reject(result); }); return deferred.promise; } } }); $routeProvider var myApp = angular.module('myApp',['ngRoute','ui.utils','ngSanitize','ui.tinymce']) .config(function ($routeProvider, $locationProvider) { //configure the routing rules here $routeProvider.when('/admin/article/edit/:id', { controller: 'editCtrl' }); //routing DOESN'T work without html5Mode $locationProvider.html5Mode(true); } );
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27882459
type: Question
has answer: http://stackoverflow.com/a/27882459
has answer: http://stackoverflow.com/a/27882352
has comment: http://stackoverflow.com/comment/44166762
has comment: http://stackoverflow.com/comment/44166395

http://stackoverflow.com/q/27867386
tagged with: javascript-objects
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27867557
has answer: http://stackoverflow.com/a/27867557
type: Question
has answer: http://stackoverflow.com/a/27867435
tagged with: javascript
score: 0
answer count: 2
has title: Object property is undefined when it comes from method parameter
has comment: http://stackoverflow.com/comment/44137330
accepted answer: http://stackoverflow.com/a/27867435
has body: I'm stuck on this: var Names = function (name,integer) { this.name = name; this.integer = integer; }; var Discount = { applyDiscount: function(person) { console.log("person name is: " + person); //Eve console.log("person integer is: " + person["integer"]); //undefined console.log("person integer is: " + Eve["integer"]); // 23 } }; var Eve = new Names("Eve Something", 23); Discount.applyDiscount("Eve"); When I try to get Eve.integer value (using person parameter) - I've get undefined. Why person["integer"] isn't working in this case?

http://stackoverflow.com/q/27937671
accepted answer: http://stackoverflow.com/a/27937703
has title: How to apply more than 1 CSS styles in javaScript?
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/27937702
has answer: http://stackoverflow.com/a/27937703
has comment: http://stackoverflow.com/comment/44272038
tagged with: javascript
duplicate of: http://stackoverflow.com/q/3968593
favorite count: 0
has comment: http://stackoverflow.com/comment/44272306
linked to: http://stackoverflow.com/q/3968593
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 0
possible better answer: http://stackoverflow.com/a/27937702
has comment: http://stackoverflow.com/comment/44272661
has comment: http://stackoverflow.com/comment/44272274
score: 2
type: AnsweredQuestion
has body: I want to apply more than 1 CSS styles to the button (its id is name_button). Here is my javaScript code. var name_button = document.getElementById('name_button'); name_button.style.display = 'block'; name_button.style.margin-left = '125px'; name_button.style.padding-right = '0px'; But with the last two lines (name_button.style.margin-left = '125px'; and name_button.style.padding-right = '0px';) my code is not working.

http://stackoverflow.com/q/27953990
has answer: http://stackoverflow.com/a/50753112
has answer: http://stackoverflow.com/a/28011411
has title: Twit API reply does not really reply
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28844945
tagged with: twitter
accepted answer: http://stackoverflow.com/a/28844945
has body: I'm currently writing a small Twitter Bot using nodejs and the Twit API Client. When I'm replying to a tweet, I use the following code: T.post('statuses/update', { status: '@' + username + " " + id, in_reply_to_status_id: id}, function(err, data, response) { if(err){ console.log("Error"); console.log(err); } console.log(response); }) Where T is the correctly authenticated client, username is the username of the user with the tweet which I want to reply to and id is the id_str of the tweet I want to reply to. But something wierd happens. If i check my notifications, It looks like I replied to the tweet, showing them tied together. But if I click on the tweet on my timeline, the response is not shown. Unfortunaly, I can't post pictures, due to missing reputation, I hope you understand my problem. :)
answer count: 3
tagged with: api
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: node.js
score: 2
possible better answer: http://stackoverflow.com/a/50753112
upvote count: 2

http://stackoverflow.com/comment/44130136
type: Comment
comment on: http://stackoverflow.com/q/27863927
type: QuestionComment
score: 0
has text: that's my current thoughts on it, but will this cause any issues if the script isn't there sometimes (e.g. 404s) ?

http://stackoverflow.com/q/27874174
accepted answer: http://stackoverflow.com/a/27874200
type: Question
linked to: http://stackoverflow.com/q/27868388
linked to: http://stackoverflow.com/q/18484986
tagged with: javascript
has body: as an extension of a question I asked earlier (thanks for all the help!), I'm having trouble getting my 2nd returned promise working (in a chain of 3 or more) I've check out this, this but can't get any clues to my current code app and controller look like: myApp.controller('Controller_1', function($scope, myService) { var myName = "Ben"; myService.slowService(myName) .then(function(result){myService.slowService2(result);}) .then(function(result){myService.fastService(result);}); $scope.myName = myName; }); service provider looks like: myApp.service('myService', function($q, $timeout) { this.slowService = function (name) { var deferred = $q.defer(); console.log('Start of slowService1:', name, Date.now()); $timeout(function() { name = 'Hello, ' + name + " is learning Angularjs"; alert(name); deferred.resolve(name); console.log('End of slowService1 timeout:', name, Date.now()); }, 1500); return deferred.promise; }; this.slowService2 = function (name) { var deferred = $q.defer(); console.log('Start of slowService2:', name, Date.now()); $timeout(function() { name = 'Hello, ' + name + " is learning Angularjs"; alert(name); deferred.resolve(name); console.log('End of slowService2 timeout:', name, Date.now()); }, 1000); return deferred.promise; }; this.fastService = function(name){ var deferred = $q.defer(); console.log('Start of fastService:', name, Date.now()); alert('Hello ' + name + ' - you are quick!'); deferred.resolve(); console.log('End of fastService:', name, Date.now()); return deferred.promise; }; }); Console output looks like: Start of slowService1: Ben 1420877247858 End of slowService1 timeout: Hello, Ben is learning Angularjs 1420877250982 Start of slowService2: Hello, Ben is learning Angularjs 1420877250983 Start of fastService: undefined 1420877250984 End of fastService: undefined 1420877251641 End of slowService2 timeout: Hello, Hello, Ben is learning Angularjs is learning Angularjs 1420877254148 So while the 1st slowService1 $q.defer() works, the 3rd func…
has answer: http://stackoverflow.com/a/27874200
score: 0
answer count: 1
tagged with: deferred
tagged with: promise
tagged with: angularjs
tagged with: angular-promise
type: AnsweredQuestion
has title: AngularJS : promise chain not deferring past 2nd function
linked to: http://stackoverflow.com/q/27605881

http://stackoverflow.com/a/60688809
answers question: http://stackoverflow.com/q/27918563
upvote count: 4
downvote count: 0
score: 4
has body: You could use 'none' property none : No filter is applied. Initial value. const canvas = document.getElementById('canvas'); const ctx = canvas.getContext('2d'); const image = document.getElementById('source'); ctx.filter = 'contrast(1.4)'; ctx.drawImage(image, 10, 10, 180, 120); ctx.filter = 'none'; https://developer.mozilla.org/fr/docs/Web/API/CanvasRenderingContext2D/filter
type: Answer

http://stackoverflow.com/comment/44125748
comment on: http://stackoverflow.com/a/27861630
score: 0
type: AnswerComment
has text: The time complexity of my solution is O(NlogN + MlogM + N) where N and M are the sizes of arrays. That of the other solution above is O(2*N + M). I'd thought that obj.hasOwnProperty was linear time, however it seems to be O(1) from http://stackoverflow.com/questions/6012242/whats-the-efficiency-in-big-o-notation-of-the-in-operator-or-obj-hasownproper . Sorry for my bad Javascript knowledges. In C++ I would do the way in my answer.
type: Comment

storage
tag name: storage
tags question: http://stackoverflow.com/q/27914055
tags question: http://stackoverflow.com/q/27929547
type: Tag

angularjs-directive
tags question: http://stackoverflow.com/q/27953553
tags question: http://stackoverflow.com/q/27875624
tags question: http://stackoverflow.com/q/27932759
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/27944929
tags question: http://stackoverflow.com/q/27847847
tags question: http://stackoverflow.com/q/27819739
tags question: http://stackoverflow.com/q/27942812
tags question: http://stackoverflow.com/q/27854458
tags question: http://stackoverflow.com/q/27929479
tags question: http://stackoverflow.com/q/27830168
tags question: http://stackoverflow.com/q/27962378
tags question: http://stackoverflow.com/q/27863573
tags question: http://stackoverflow.com/q/27878866
tags question: http://stackoverflow.com/q/27817379
tags question: http://stackoverflow.com/q/27936572
tags question: http://stackoverflow.com/q/27856646
tags question: http://stackoverflow.com/q/27902365
tags question: http://stackoverflow.com/q/27952132
tags question: http://stackoverflow.com/q/27865566
tags question: http://stackoverflow.com/q/27961850
tags question: http://stackoverflow.com/q/27851078
tags question: http://stackoverflow.com/q/27926611
tags question: http://stackoverflow.com/q/27852492
tags question: http://stackoverflow.com/q/27956348
tags question: http://stackoverflow.com/q/27914782
tags question: http://stackoverflow.com/q/27948341
tags question: http://stackoverflow.com/q/27957720
tags question: http://stackoverflow.com/q/27895735
tags question: http://stackoverflow.com/q/27893950
tags question: http://stackoverflow.com/q/27939497
tags question: http://stackoverflow.com/q/27894689
tags question: http://stackoverflow.com/q/27830304
tags question: http://stackoverflow.com/q/27862094
tags question: http://stackoverflow.com/q/27920293
tags question: http://stackoverflow.com/q/27895409
tags question: http://stackoverflow.com/q/27959205
tags question: http://stackoverflow.com/q/27878371
tags question: http://stackoverflow.com/q/27808609
tags question: http://stackoverflow.com/q/27898397
tags question: http://stackoverflow.com/q/27957403
tags question: http://stackoverflow.com/q/27897291
tags question: http://stackoverflow.com/q/27816690
tags question: http://stackoverflow.com/q/27903088
tags question: http://stackoverflow.com/q/27916617
tags question: http://stackoverflow.com/q/27952772
tags question: http://stackoverflow.com/q/27807668
tags question: http://stackoverflow.com/q/27940472
tags question: http://stackoverflow.com/q/27869320
type: Tag
tags question: http://stackoverflow.com/q/27884063
tags question: http://stackoverflow.com/q/27845899
tags question: http://stackoverflow.com/q/27874116
tags question: http://stackoverflow.com/q/27837557
tags question: http://stackoverflow.com/q/27848095
tags question: http://stackoverflow.com/q/27895904
tags question: http://stackoverflow.com/q/27843047
tags question: http://stackoverflow.com/q/27849034
tags question: http://stackoverflow.com/q/27962193
tags question: http://stackoverflow.com/q/27817367
tags question: http://stackoverflow.com/q/27911754
tags question: http://stackoverflow.com/q/27916836
tags question: http://stackoverflow.com/q/27818307
tags question: http://stackoverflow.com/q/27810450
tags question: http://stackoverflow.com/q/27850653
tags question: http://stackoverflow.com/q/27937606
tags question: http://stackoverflow.com/q/27895058
tags question: http://stackoverflow.com/q/27921542
tags question: http://stackoverflow.com/q/27953229
tags question: http://stackoverflow.com/q/27857362

http://stackoverflow.com/a/27919155
score: 23
downvote count: 0
has body: In the form tag there is a field onsubmit to specify your validation function. Something like that:
type: Answer
upvote count: 23
answers question: http://stackoverflow.com/q/27918843
has comment: http://stackoverflow.com/comment/139102909

http://stackoverflow.com/a/27813164
answers question: http://stackoverflow.com/q/27812173
type: Answer
has body: I've created a bookmarklet using almost the same code and it worked for me using IE11 javascript:(function(){ var close = document.createElement('button'); close.type = 'button'; close.appendChild(document.createTextNode('CLOSE')); document.getElementsByTagName('body')[0].appendChild(close); })();
score: 0

title
tags question: http://stackoverflow.com/q/27835768
tags question: http://stackoverflow.com/q/27817698
tag name: title
tags question: http://stackoverflow.com/q/27939318
type: Tag

http://stackoverflow.com/a/27806973
upvote count: 1
has body: Well, here is an example where you can set any number of resources, associating them with a key and setting the quantity of the units you want and the cost for each resource. Has 2 functions, one which gets the maximum units possible with the resources you have, and one which spends those resources: function Request(qty){ this.quantity = qty; // quantity of units to make this.required = {}; // required resources var request = this; this.checkAvailability = function(resources){ var available = request.quantity; var spent = {}; var left = {}; for(var key in request.required){ // for each required resource var max = Math.min(request.quantity, Math.floor(resources[key].quantity/request.required[key])) // set max as wanted quantity or available quantity if it is less than wanted available = Math.min(max, available) // update max of units you can make } return available } this.spendResources = function(resources, qty){ // spend required resources for(var key in request.required){ resources[key].quantity -= request.required[key]*qty; } } } function Resource(qty){ this.quantity = qty; } var available = { 1: new Resource(200), 2: new Resource(140) } var request = new Request(7) request.required = {1: 40, 2: 30} var availableQty = request.checkAvailability(available) request.spendResources(available, availableQty) console.log(availableQty, available) Working Jsfiddle: http://jsfiddle.net/fk6coz8a/
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27805598
answers question: http://stackoverflow.com/q/27805598
type: Answer
score: 1

http://stackoverflow.com/a/27840597
has body: Works with toLowerCase() or toUpperCase() methods: if (userAnswer.toLowerCase()=='yes') { console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!"); } else { console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'"); }
has comment: http://stackoverflow.com/comment/44084701
has comment: http://stackoverflow.com/comment/44084716
has comment: http://stackoverflow.com/comment/44085224
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44085433
has comment: http://stackoverflow.com/comment/44111381
has comment: http://stackoverflow.com/comment/44085230
has comment: http://stackoverflow.com/comment/44085182
answers question: http://stackoverflow.com/q/27840557

http://stackoverflow.com/a/27836379
score: 1
has body: Check this .You are not including script correctly. &lt;link rel="stylesheet" type="text/css" href="&lt;?php bloginfo('template_directory'); ?&gt;/includes/jquery.counterup.js"&gt; You need to en-queue scripts properly using wp_enqueue_script wp_enqueue_script('mycounter',bloginfo('template_directory').'/includes/jquery.counterup.js',array('jquery')); Also load jquery before other scripts if there are any dependencies. WordPress comes with bundled jQuery,it's recommended to use that instead using external ones.
has comment: http://stackoverflow.com/comment/44077432
has comment: http://stackoverflow.com/comment/44078027
has comment: http://stackoverflow.com/comment/44077765
accepted answer of: http://stackoverflow.com/q/27836241
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27836241
has comment: http://stackoverflow.com/comment/44077564
has comment: http://stackoverflow.com/comment/44078128
type: Answer
has comment: http://stackoverflow.com/comment/44077364
downvote count: 0

http://stackoverflow.com/q/27821111
has title: Why am I getting undefined output Javascript?
has answer: http://stackoverflow.com/a/27821236
has comment: http://stackoverflow.com/comment/44047976
tagged with: arrays
has answer: http://stackoverflow.com/a/27821172
tagged with: javascript
score: 0
answer count: 3
type: UnansweredQuestion
type: Question
has body: I keep getting undefined before my output text in JS. Here is my code. Learning javascript This is my JS var arrayString; var myArray=["Ms.Vickies", "Old Dutch", "Lays"]; for (var i=0; i<myArray.length; i++) { arrayString=arrayString+myArray[i]; } document.getElementById("arrayString").innerHTML=arrayString; my output is undefinedMs.VickiesOld DutchLays In addition why no spaces? I am new to JS but am working my way up. Cannot figure this out.
has answer: http://stackoverflow.com/a/27821131

http://stackoverflow.com/q/27826678
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44059206
has comment: http://stackoverflow.com/comment/44059268
type: Question
has title: Javascript: Passing a function as argument which will be executed at onclick event
tagged with: http://stackoverflow.com/tag/html
has body: I would like to creat a confirm box based on the idea that when the button is clicked, a div is appended to the body, and its OK button executes a function given as argument. I managed to do it if the function name is not a variable, but in this case I would need as many confirm boxes as many types of functions I have. Here's the html button: SHOW Here's the confirm box function: function execAfterConfirmed( functionToExecute , arg ){ $("body").prepend(" CONFIRM ? YES NO "); } However, I got Unexpected token (
has comment: http://stackoverflow.com/comment/44059885
has answer: http://stackoverflow.com/a/27827087
score: 0
answer count: 3
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27826825
has answer: http://stackoverflow.com/a/27826841
accepted answer: http://stackoverflow.com/a/27826841
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27826825
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44059397

http://stackoverflow.com/comment/44068383
has text: @Billy , @ Deryck - Thank you soo much!! The id is getting displayed in the alertbox. But on clicking ok, instead of taking me to the next page with the details, its logging me out of the application. Next obstacle!! Will work on that..
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27830786

http://stackoverflow.com/q/27958438
tagged with: facebook
tagged with: regex
score: 8
has body: I'm using the graph api endpoint /PAGE_ID/posts to get all posts from a facebook page. Now I want the full sized image from these posts. The picture property of the returned objects gives me only a cropped version of that image. With the object id from these posts and the API endpoint /OBJECT_ID/picture I get the only the small, normal and album sized version of the picture. But with a little modification to the URL I managed to get the full sized image. Example This URL: https://graph.facebook.com/10152843929471041/picture redirects to this URL: https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpa1/t31.0-8/s720x720/10838228_10152843929471041_5251228402651650719_n.jpg I removed the 720x720 from that URL to get this URL: https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpa1/t31.0-8/s/10838228_10152843929471041_5251228402651650719_n.jpg which is finally the full sized image. I think, that I can achieve this modification with a regex pattern. But now is my question, how I can get the URL after the redirect from the original URL (the first one). Any ideas or simpler solutions?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27958835
tagged with: http-redirect
type: Question
has title: Get full sized picture from facebook graph API
answer count: 2
possible better answer: http://stackoverflow.com/a/49263480
has answer: http://stackoverflow.com/a/49263480
downvote count: 0
tagged with: javascript
tagged with: facebook-graph-api
has answer: http://stackoverflow.com/a/27958835
linked to: http://stackoverflow.com/q/10650730
favorite count: 0
upvote count: 8

http://stackoverflow.com/q/27818260
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/27818314
has answer: http://stackoverflow.com/a/27818376
has comment: http://stackoverflow.com/comment/44043221
has comment: http://stackoverflow.com/comment/44042980
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27819226
possible better answer: http://stackoverflow.com/a/27818376
tagged with: oop
tagged with: instance
has body: I have this very simple JavaScript code that should return a Fullname using parameters firstname and lastname All works fine when I alert out the fullname within the function. But I'm struggling how to make the fullname variable accessible from outside the function/instance? here's my code: var getName = function () { this.name = function (firstname, lastname, success) { var fullName = firstname + " " + lastname; success(fullName); }; }; var test = new getName(); test.name("John", "Smith", function (output) { var fullname = output; alert(fullname); //this works fine return fullname; // I need this variable to be accessed from outside this function }); var myName = fullname; //I need to create the variable here alert(myName); //this does not work Here's Fiddle Thank you very much for your help. Edit: I'm building an iPad app where I'm using cordova and javascript plugins. One of the plugin gives me access to the file inside the device. Now, I need to be able to get the path and use it outside the callback so that I can use anywhere in the scope: Here's the plugin code: var FileManager = function(){ this.get_path = function(todir,tofilename, success){ fail = (typeof fail == 'undefined')? Log('FileManager','read file fail'): fail; this.load_file( todir, tofilename, function(fileEntry){ var sPath = fileEntry.toURL(); success(sPath); }, Log('fail') ); } this.load_file = function(dir, file, success, fail, dont_repeat){ if(!dir || dir =='') { Log('error','msg')('No file should be created, without a folder, to prevent a mess'); fail(); return; } fail = (typeof fail == 'undefined')? Log('FileManager','load file fail'): fail; var full_file_path = dir+'/'+file; var object = this; // get fileSystem fileSystemSingleton.load( function(fs){ var dont_repeat_inner = dont_repeat; // get file handler console.log(fs.root); fs.root.getFile( full_file_path, {create: true, exclusive: false}, success, function(error){ if(dont_repeat == true){ Log('FileManager','error')('recurring error, ge…
has comment: http://stackoverflow.com/comment/44049488
type: Question
has title: how to access a variable from outside a function/instance
has answer: http://stackoverflow.com/a/27818314
has comment: http://stackoverflow.com/comment/44043438
has comment: http://stackoverflow.com/comment/44048182
tagged with: javascript
has comment: http://stackoverflow.com/comment/44049746
tagged with: jquery

http://stackoverflow.com/comment/44268843
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27934616
has text: @RonRosenfeld: `(?=\.)\.` => `\.`

http://stackoverflow.com/comment/44291394
score: 2
has text: jQuery('#mythbuster').each is already wrong. IDS have to be unique
comment on: http://stackoverflow.com/q/27948230
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27856758
linked to: http://stackoverflow.com/q/14994391
upvote count: 3
has body: I am developing a web-application using Angular Js framework, with HTML5 and with the help of jQuery, when it is needed. The question is: I have some fields whose values depend on the result of an AJAX call. This request returns a JSON and the fields of this JSON become the values of many tags. For example, in the HTML code, I have: Data Nascita: {{patient.birthDate}} And in my controller, I have this request: $.ajax({ type: "GET", url: url, async: true, crossDomain: true, success:function(result){ $scope.person = result; }, error: function(xhr,status,error){ console.log ("error in receiving person's data"); } }); This data-binding works properly. The question is: how can I intercept the end of the operation of data-binding (the end of the filling of the {{patient.birthDate}} field) to somehow call on this field another javascript method? My goal is to "shorten" the value of this field, after the filling made by Angular, with a jQuery plugin, with a call of this type: $("#patientBirthdate").shorten({showChars: 15, moreText: ' >>', lessText: ' <<'}); Thanks in advance.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44116767
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: How to intercept the end of data-binding in Angular Js
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/44117371
has answer: http://stackoverflow.com/a/27856834
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44096933
has text: yeah i get that you're trying to provide an alternative, but if you got beat to a much simpler answer, no real reason to most a much longer one.
comment on: http://stackoverflow.com/a/27846339
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27825376
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44057279
has comment: http://stackoverflow.com/comment/44056847
linked to: http://stackoverflow.com/q/20037491
score: 0
has comment: http://stackoverflow.com/comment/44056732
tagged with: jsonp
has comment: http://stackoverflow.com/comment/44058189
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: We are trying to build an embedded widget witch will be called from another domains. My widget works fine in my local as a webpage. The problem comes when i try to call it from another page. Let's call that another site as A. When A add my script tag, i want to make a call to my widget and embed it into A. This is how to make call to my widget: var widget = { initialize : function(containerId) { (function($) { var url = 'http://localhost:8002/widget.html'; $.ajax({ type: 'GET', url: url, async: false, jsonpCallback: 'jsonCallback', contentType: "application/json", dataType: 'jsonp', success: function(html) { console.log(html); $("#" + containerId).html(html); }, error: function(e) { console.log(e.message); } }); })(jQuery); } } The problem is, after reading dozens of tutorials i still could not understand how callback functions should work. I don't know if i can achieve this with a little touch or i am on the wrong way. is it possible to return whole html page with call? I will be grateful to all advices.
has comment: http://stackoverflow.com/comment/44056898
tagged with: jquery-callback
tagged with: jquery
has title: How to build callback function to return html page
has comment: http://stackoverflow.com/comment/44057011
type: Question

http://stackoverflow.com/comment/44124791
has text: What PhantomJS version do you have and what is shown when you register to the `page.error` event? Have you tried to run it with `--ssl-protocol=any --ignore-ssl-errors=true`?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27861253

http://stackoverflow.com/q/27824050
has comment: http://stackoverflow.com/comment/44054108
type: Question
has body: So I'm trying to make the page continue to add the list items without breaking past the body element as shown. I would like to keep the all the list items within the body and div like the first few. My best idea on how to go through this is by using if statement at the bottom of the JS to rerun autoResizeDiv. Thanks for any help!! JS $(function() { var $newItemButton= $('#newItemButton'); var $newItemForm= $('#newItemForm'); var $textInput= $('input:text'); $newItemButton.show(); $newItemForm.hide(); $('#showForm').on('click', function() { $newItemButton.hide(); $newItemForm.show(); }); $newItemForm.on('submit', function(e) { e.preventDefault(); // this prevents the form from submitting which you need var newText=$('input:text').val(); $('li:last').after(' '+ newText + ' '); $newItemForm.hide(); $newItemButton.show(); $textInput.val('') // this empties the text box so you can add a new entry }); function autoResizeDiv() { document.getElementById('page').style.height = window.innerHeight +'px'; // document.getElementById('newItemButton').style.height = window.innerHeight +'px'; } window.onresize = autoResizeDiv; autoResizeDiv(); if(document.getElementById('addButton').clicked == true) { autoResizeDiv(); } }) CSS @media screen and (max-width:700px) { body { background: #111; background-size: 780px; font-family: 'Dosis', sans-serif; color: white; display: block; height:100%; } h1, h2, p { text-align: center; } img { max-width: 50px; /* display: inline-block; */ /* margin: 4% 0 0% 165px;*/ padding: 10% 45% 0 44%; /* vertical-align: middle;*/ /* position: absolute;*/ } h1 { margin: -1% 0 0 0; font-size: .8rem; letter-spacing: 1.2px; } h2 { min-width: 70%; letter-spacing: 8px; text-transform: uppercase; margin: 5% 0 4% 0%; font-size: 1.4rem; } div { margin: auto; background: #222; width: 360px; } #page { /* padding: auto;*/ /* display: inline-block;*/ height: 465px; } ul { list-style: none; padding: 0; margin: 5%; } li:nth-child(-n+3) { background-color: #B80000; } li:nth…
answer count: 2
has title: I'm adding via my submit button and it is pushing past my div. My js function can't fix it
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44054103
favorite count: 0
has answer: http://stackoverflow.com/a/27824196
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
downvote count: 3
has answer: http://stackoverflow.com/a/27824171
upvote count: 1
has comment: http://stackoverflow.com/comment/44054151
score: -2

http://stackoverflow.com/comment/44231127
type: QuestionComment
comment on: http://stackoverflow.com/q/27916145
score: 0
type: Comment
has text: It is an array - how do we convert it to string and print to Apache logs?

http://stackoverflow.com/q/27827410
accepted answer: http://stackoverflow.com/a/27827978
has answer: http://stackoverflow.com/a/27828315
has comment: http://stackoverflow.com/comment/44060892
possible better answer: http://stackoverflow.com/a/27828128
has title: Can't pass a variable as an argument in a onClick function
has comment: http://stackoverflow.com/comment/44060959
has answer: http://stackoverflow.com/a/27828128
upvote count: 1
type: Question
tagged with: escaping
type: AnsweredQuestion
score: 1
has body: I want to have a table and its cells are filled with data from MySQL. The table have many TDs, which have an Id. I want to pass the id of the cell to a function, so that I can edit its content: document.getElementById(IndexedActionButton).innerHTML = '&lt;input type="Button" name = "EditActionButton" id="EditActionButton" onClick="SaveUpdateToActionList(&amp;quot;Cell_ID&amp;quot;)" value="Edit Action" /&gt;'; function SaveUpdateToActionList(Cell) { alert(Cell); document.getElementById(Cell).innerHTML = 'Here'; } When I have alert(Cell); displayed, I see this sends the Text "Cell_ID", whereas I wanted to see the data ActionButton386 there. Any help appreciated.
answer count: 3
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27827978
favorite count: 0

http://stackoverflow.com/comment/44068516
type: AnswerComment
comment on: http://stackoverflow.com/a/27831305
type: Comment
has text: This will only do the next one, not the current one as well. "But what if I wanted to make the next element in line turn green *as well* on the click?"
score: 1

http://stackoverflow.com/q/27962908
tagged with: javascript
tagged with: jquery
has title: Angular controllers: Accessing correct variable in controller using custom attribute with variable name
tagged with: controller
score: 0
has comment: http://stackoverflow.com/comment/44329550
tagged with: attributes
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44319038
answer count: 0
has body: I created a custom &lt;select&gt; dropdown element using a directive, which has a selecting attribute that is used in the directive to pull the correct data from the controller to populate the list of options. I'd like to know if this is an appropriate use of AngularJS's different pieces. I'm new to Angular, but this is how it occurred to me to accomplish this task. In the HTML partial for a page needing my version of select, this is all that needs to be written: &lt;sliding-select selecting="areas"&gt;&lt;/sliding-select&gt; In the controller there is a corresponding variable on the main object called areas which contains within it an array called options, whose members should be the options of the area select. And here is the part of the directive that takes that data and creates an option element for each member of the areas array : .directive('slidingSelect', function($timeout) { return { restrict: 'E', compile: function(element, attrs) { var selecting = attrs.selecting; // ng-repeated options come from selecting attr var dropDownList = $('&lt;div class="sliding-select-list"&gt;&lt;/div&gt;'); dropDownList.append('&lt;div class="sliding-select-option" ng-repeat="item'+ ' in home.'+selecting+'.options"&gt;{{item.name}}&lt;/div&gt;'); element.append(dropDownList); } }; I'm just a bit worried that it seems hacky to create an element whose ng-repeat phrase uses the variable name by creating a string from it. Maybe there's a totally different approach to this problem that's preferred by the Angular community?
type: Question

http://stackoverflow.com/comment/44097166
has text: How are you converting it to an app? What exactly does not work? When the code is called within a mobile device it is very probable that the page `new_user.asp` is not accessible from there. Try using the path to the website/url where that file is located.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27846537

http://stackoverflow.com/comment/44073196
has text: The idea is that you have to actually write code to do the search. It doesn't magically happen if you have some html on a page. Where is your search code?
score: 0
comment on: http://stackoverflow.com/q/27832945
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44203287
has text: Thanks for the answer ! The timeout was not needed in the original code but I would not have found for the `href`. Would you know if this behaviour is described somewhere ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27901320
type: Comment

http://stackoverflow.com/q/27962232
has comment: http://stackoverflow.com/comment/55039414
score: 7
has answer: http://stackoverflow.com/a/27963265
downvote count: 1
type: Question
has title: AngularJS filter in React Component
tagged with: reactjs
accepted answer: http://stackoverflow.com/a/27963265
tagged with: javascript
has body: I'm totally new to ReactJS, but I love its awesome performance over AngularJS. My question is, in AngularJS we use filters in the view templates before rendering the expression or model, how we can achieve that in ReactJS. Now I'm trying to replace few view parts as React Components(still it is in AngularJS). For example, now my below angular code works fine to render a emoticon in p tag, &lt;div ng-init='{messageWithAngularEmoji = "This is a :smile:"}'&gt; &lt;p ng-bind="{messageWithAngularEmoji | emoji | to_trusted }"&gt;&lt;/p&gt; &lt;/div&gt; In the above example you can see I had used two filters: emoji and to_trusted. How can I achieve this in ReactJS ? Note: I can't rewrite those filters in React.
answer count: 3
has answer: http://stackoverflow.com/a/36296796
favorite count: 0
possible better answer: http://stackoverflow.com/a/27965188
upvote count: 8
tagged with: angularjs
has answer: http://stackoverflow.com/a/27965188
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44319264

http://stackoverflow.com/comment/44154877
score: 0
type: Comment
has text: Than you, I forgot to do that. But that doesn't fully solve the problem. The error is still "Template has no method 'render'" and when I print out the value of 'template = require "./core/template"' I get '[method: Template]' which is undefined
comment on: http://stackoverflow.com/a/27876691
type: AnswerComment

http://stackoverflow.com/q/27821900
favorite count: 0
has body: So basicly i'm trying to get custom variables trough to google analytics panel while using ecommerce extension. My main goal is to give every item a set of custom values. My "code" looks like this: ga('require', 'ecommerce'); ga('ecommerce:addTransaction', { 'id': 'id', 'affiliation': 'affiliation', }); ga('ecommerce:addItem', { 'id': 'id', 'name': 'Loan - name', 'sku': '{RIDA:success_loan_id}', 'loanSumEur': 'Sum', 'loanSumLit': 'Sum LTL', 'loanLength': 'length', 'loanData': 'data' }); ga('ecommerce:send'); ga('ecommerce:clear'); How should I declare those loanSumEur, loanSumLit, loanlength, loanData variables so Google would pass them trough to the google analytics admin panel. Is it even possible ? It's quite easy to declare custom variables for site tracking, however I got a little bit stuck trying to do the same thing on transaction items. BR's
accepted answer: http://stackoverflow.com/a/27838676
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/44078540
type: Question
has comment: http://stackoverflow.com/comment/44050947
tagged with: google-analytics
score: 1
has title: is it possible to send custom variables to Google analytics while using ecommerce extension
has answer: http://stackoverflow.com/a/27838676
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27880010
has comment: http://stackoverflow.com/comment/44217006
has comment: http://stackoverflow.com/comment/44216912
answer count: 1
tagged with: angular-ui
has body: I'd like to be able to process parameters of the form &amp;paramN where N is a positive integer with AngularUI and ui-router. So for example: http://thingy.com/app/?param1=foo&amp;param42=towel&amp;param3021414=fubar I've read the angular documentation on setting up controllers here but I don't see any way to do this - regex only seems to work on the url path, not the params. Is this possible?
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44217092
tagged with: parameters
has answer: http://stackoverflow.com/a/27891465
has comment: http://stackoverflow.com/comment/44162014
score: 0
has comment: http://stackoverflow.com/comment/44217544
has title: Unbounded parameter counts in angular
type: Question
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/44164192
tagged with: javascript
has comment: http://stackoverflow.com/comment/44220658

http://stackoverflow.com/q/27960841
has body: I'm trying to scan some barcode to textfield contained in my browser but it opens the downloads page in any browser (chrome, firefox, ie). I'm guessing that there is some input equivalent to CTRL + J that triggers the browser to open the download page. Is anyone ran into this problem? Is there a way to pass it (assuming that I my clients can't change their scanner configuration neither the browser configuration)? Thanks.
has answer: http://stackoverflow.com/a/78229459
has answer: http://stackoverflow.com/a/45162557
tagged with: barcode-scanner
type: Question
tagged with: browser
answer count: 8
score: 8
has answer: http://stackoverflow.com/a/30140441
tagged with: javascript
has comment: http://stackoverflow.com/comment/94630750
has answer: http://stackoverflow.com/a/49251493
has answer: http://stackoverflow.com/a/27961410
has answer: http://stackoverflow.com/a/41805401
downvote count: 0
has answer: http://stackoverflow.com/a/65335609
favorite count: 0
tagged with: barcode
has title: USB Barcode scanner opens browser's downloads page
upvote count: 8
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/57018127
linked to: http://stackoverflow.com/q/10353105

http://stackoverflow.com/comment/44184175
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27882643
type: Comment
has text: With the current set up i have, I do believe this would be the best way to carry out things. However, I think i'm going to investigate the use of tokens, that way I wouldnt have to worry about a session. Thank you!

http://stackoverflow.com/a/27900832
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44201267
downvote count: 0
has body: $(document).on ('click', '.tab_addclass', function(){ $('.tab_addclass').each(function() { if($(this).hasClass('tab_focus')) { suc_flg=1; $(this).removeClass('tab_focus'); } }); $(this).addClass('tab_focus'); }); $(document).on ('click', '#btn', function(){ var test = $('.tab_focus').html()||$('.tab_focus').val() alert(test); }); 4 Validate
has comment: http://stackoverflow.com/comment/44201306
answers question: http://stackoverflow.com/q/27900717

http://stackoverflow.com/comment/44188357
comment on: http://stackoverflow.com/q/27893431
has text: Wow thank you so much. I dunno why I thought it was a server error. Thanks so much. If you give an answer I'll accept it.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27914450
has comment: http://stackoverflow.com/comment/44251418
has comment: http://stackoverflow.com/comment/44250293
has comment: http://stackoverflow.com/comment/44257188
has comment: http://stackoverflow.com/comment/44252330
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44229169
has title: tags not working following jQuery post
has comment: http://stackoverflow.com/comment/44228323
has comment: http://stackoverflow.com/comment/44228915
has comment: http://stackoverflow.com/comment/44256001
has comment: http://stackoverflow.com/comment/44251105
has comment: http://stackoverflow.com/comment/44228633
score: 2
has comment: http://stackoverflow.com/comment/44250353
has comment: http://stackoverflow.com/comment/44258117
has comment: http://stackoverflow.com/comment/44251535
has comment: http://stackoverflow.com/comment/44246420
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44229007
tagged with: ajax
has comment: http://stackoverflow.com/comment/44257078
has comment: http://stackoverflow.com/comment/44251359
has comment: http://stackoverflow.com/comment/44228360
has comment: http://stackoverflow.com/comment/44228556
type: Question
has comment: http://stackoverflow.com/comment/44257121
has comment: http://stackoverflow.com/comment/44246685
has comment: http://stackoverflow.com/comment/44258213
has body: I am having a problem with jQuery where by it is not loading inside a requested div. Setup: On index.php I have 4 Morris charts on 4 tabs all working fine. On each tab there is a list. Each item in the list is a link Upon clicking the link the div within the tab reloads with new data via post: $(document).ready(function () { $('.click5').click(function () { companyId = $(this).attr('id'); $.post('./ajax/donut5.php', { clickthrough5: $('#company5-'+companyId+' .clickthrough5').val(), ref_date_from5: $('#company5-'+companyId+' .ref_date_from5').val(), ref_date_to5: $('#company5-'+companyId+' .ref_date_to5').val() }, function (data) { $('.donut5').html(data); }); }); }); The new div contains a back button to take you back to a replica of the 1st graph but on a different page (donut1.php), for my personal ease: $(document).ready(function () { $('.backref2').click(function () { companyId = $(this).attr('id'); $.post('./ajax/donut1.php', { clickthrough6: $('#company6-'+companyId+' .clickthrough6').val(), ref_date_from6: $('#company6-'+companyId+' .ref_date_from6').val(), ref_date_to6: $('#company6-'+companyId+' .ref_date_to6').val() }, function (data) { $('.donut5').html(data); }); }); }); All this code works fine up until landing on donut1.php. At this point I proceeded to pull out chunks of my hair for several hours looking through Inspect Element in Chrome to identify the issue. 1 bald person later I realised the jQuery was not loading although it is correctly requested in a script tag. I confirmed this by placing the following on both donut1.php and donut5.php: donut5.php displays the output fine while donut1.php does not. I then tried to load an external source and a different version using the Google snippets found here but this still did not work. Some points to note: I currently have jquery loading in my header and footer as part of trying to work this out. As the 2 pages donut1.php and donut5.php do not include header or footer I have manually included them both …
has comment: http://stackoverflow.com/comment/44256432
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44250389
has comment: http://stackoverflow.com/comment/44250418
has comment: http://stackoverflow.com/comment/44250364
has comment: http://stackoverflow.com/comment/44256383
has comment: http://stackoverflow.com/comment/44229286
has comment: http://stackoverflow.com/comment/44228306
has comment: http://stackoverflow.com/comment/44228509
has comment: http://stackoverflow.com/comment/44229208
has comment: http://stackoverflow.com/comment/44256043
has answer: http://stackoverflow.com/a/27926972
linked to: http://stackoverflow.com/q/889967
has comment: http://stackoverflow.com/comment/44251080
has comment: http://stackoverflow.com/comment/44229123
upvote count: 3
has comment: http://stackoverflow.com/comment/44228420
has comment: http://stackoverflow.com/comment/44228348
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44250184
has comment: http://stackoverflow.com/comment/44249237
has comment: http://stackoverflow.com/comment/44228706
has comment: http://stackoverflow.com/comment/44249697
has comment: http://stackoverflow.com/comment/44248425
has comment: http://stackoverflow.com/comment/44250112
has comment: http://stackoverflow.com/comment/44254545
has comment: http://stackoverflow.com/comment/44259431

http://stackoverflow.com/a/27924434
type: Answer
has comment: http://stackoverflow.com/comment/44276493
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27924356
has body: localStorage.getItem will return null in case nothing found and so is JSON.parse(null). So you're ending up with companies being null. Try this: var companies=[]; if (localStorage.getItem("companies")) companies=JSON.parse(localStorage.getItem("companies")); //IMP line companies.push(company); localStorage.setItem("companies", JSON.stringify(companies)); See MDN

http://stackoverflow.com/comment/44070622
type: AnswerComment
score: 0
type: Comment
has text: You not missing anything. There might be a tiny hit to memory but again it's a grain of sand compared to the size of the earth. Focus on the readability of the code first and don't fret over the grains of sand. Code for humans first.
comment on: http://stackoverflow.com/a/27830925

http://stackoverflow.com/comment/59677263
type: Comment
comment on: http://stackoverflow.com/a/27857154
has text: @rakesh I believe you should replace the double quotes with single ones.
type: AnswerComment
score: 0

http://stackoverflow.com/a/27812562
score: 2
answers question: http://stackoverflow.com/q/27812529
downvote count: 0
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: This is not name: value; this is label: statement. See more at MDN. This code is equivalent to: var bar = 1, foo = {}; { 2; ++bar; }; foo.baz + foo.bar + bar;
has comment: http://stackoverflow.com/comment/44032637
has comment: http://stackoverflow.com/comment/44032614
accepted answer of: http://stackoverflow.com/q/27812529

http://stackoverflow.com/comment/44108381
has text: What I mean by using `new Function()` is calling this in place of your new constructor generation: `return new Function(args.join(","), "return function " + funcname + "(" + args.join() + ") {" + args.map(function(name, index){ return "\n\tthis." + name + " = " + name + ";" }).join("") + funcbody + "};")();`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27842939

http://stackoverflow.com/q/27807762
has answer: http://stackoverflow.com/a/27807891
type: Question
score: 1
has body: In Integrating a medium-editor on the Atmosphere with a Telescope App I have unknown parts that I can not make search for Atmosphere package pages makes only references to the github pages of clones. I want to integrate a medium-editor clone with my Telescope app, say CitizenKevin/meteor-medium-editor on the Atmosphere. Instructions on the Github page of the clone is regarding non-Meteor apps, refrencing libs to html etc. What is the thing with meteor. How I just start to use it. I see one skips the referencing in html parts. issuing meteor add citizenKevin:medium-editor will do those settings. Is that right? I have skipped this and just added a: adasdasd to my main.html file, I am using Discovering Meteor book. And added initialising to the main.js file as: editor = new MediumEditor('.editable'); But my div above is not editable now. What is the missing thing in my setup and try?
has answer: http://stackoverflow.com/a/29727570
answer count: 2
has title: Integrating a medium-editor on the Atmosphere with a Telescope App
downvote count: 0
tagged with: javascript
tagged with: telescope
tagged with: jquery
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/44203083
has text: I made some progress by using the following - elements.closest('.file-uploader-attachment-Class').prepend(' Uploaded '); - however the same approach will not allow me to remove the qq-uploader class, so now I have "Uploaded" and "Upload File" btn in the same cell ??
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27824917

http://stackoverflow.com/q/27884459
has answer: http://stackoverflow.com/a/27884493
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27884491
score: -3
favorite count: 0
has answer: http://stackoverflow.com/a/27884491
has body: I want to display one "Hi." every second, but following code does 7 "Hi." one second. What should I do? script.js var main = function(){ for(var i=0; i<7; i++){ setTimeout(function(){$('div').append("Hi.");},1000); }; }; $(document).ready(main); index.html
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27884493
has comment: http://stackoverflow.com/comment/44170487
has comment: http://stackoverflow.com/comment/44170503
type: AnsweredQuestion
downvote count: 3
has title: "setTimeout" and "for"
type: Question

http://stackoverflow.com/comment/44167583
type: AnswerComment
has text: What do you mean by "full class"?
comment on: http://stackoverflow.com/a/27878468
score: 0
type: Comment

http://stackoverflow.com/comment/44103269
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27844055
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68439/discussion-between-brandon-shega-and-stekhn).
score: 0

http://stackoverflow.com/comment/44073654
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68388/discussion-between-aniket-sinha-and-psl).
type: Comment
comment on: http://stackoverflow.com/a/27828503
score: 0

http://stackoverflow.com/q/27829772
has answer: http://stackoverflow.com/a/27849123
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: css-position
accepted answer: http://stackoverflow.com/a/27849123
has body: I want to get the exact positions of the div using its class name. Here is the screenshot. . My script which is finding a div position is highlighted in yellow and the div i am looking for is at the bottom highlighted red. Since my script is placed above the div so i am finding the parent div of the document and then comparing the div class with the div class i am looking for and thats how i am getting the positions. The positions are not exact. For example if the Top and Left position of the div is 50,150 then i am getting like 55,155. function getPosition(element) { var xPosition = 0; var yPosition = 0; var left = 0; var top = 0; var i = 0; while (element) { xPosition = (element.offsetLeft); yPosition = (element.offsetTop); console.log("TOP Pos: "+yPosition+"Left Pos: "+xPosition); if (i == 1) { left = xPosition; top = yPosition; } element = element.offsetParent; i++; } return { x: left, y: top }; } And this is how i am using this method. function ReadDivPos(selector) { var _divPos = ""; var parentDoc = window; while (parentDoc !== parentDoc.parent) { parentDoc = parentDoc.parent; } parentDoc = parentDoc.document; var parentDiv = parentDoc.getElementsByTagName('div'); var divs = []; for (var i = 0; i &lt; parentDiv.length; i++) { if (parentDiv[i].className == "content") { var pos = getPosition(parentDiv[i]); var x = pos["x"]; var y = pos["y"]; console.log("Values+ Top: " + y + " Left: " + x); var w = parentDiv[i].offsetWidth; _divPos += x + "," + w + "," + y + "," + (x + w) + ","+window.screen.availWidth+"\\n"; } } console.log("Values+ x: " + _divPos); return _divPos; } This is working fine but i am just wondering is there any other better way to make it done using jquery or any other method. Thanks in advance!.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44187077
tagged with: css
score: -1
has title: Getting the exact position of the div
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44067245
downvote count: 1
type: Question

http://stackoverflow.com/comment/44212238
comment on: http://stackoverflow.com/q/27906480
type: QuestionComment
has text: You're adding a property to the object, it doesn't change the length of an array.
type: Comment
score: 0

http://stackoverflow.com/comment/127646350
type: Comment
type: QuestionComment
score: 0
has text: If you are adding content to your page after you have created your event handler(s) and then expecting your new content to be included in your event handling then you will need to use deferred event handling, or destroy/recreate your event handler(s)
comment on: http://stackoverflow.com/q/27945596

http://stackoverflow.com/comment/44154557
score: 0
has text: Yeah, sure, immediately after you'll answer A. Wolff's question ; ).
type: Comment
comment on: http://stackoverflow.com/q/27876475
type: QuestionComment

http://stackoverflow.com/a/27829242
answers question: http://stackoverflow.com/q/27825990
has comment: http://stackoverflow.com/comment/44065237
upvote count: 1
has body: To save all this data, save them on Gridfs And the easiest way to convert the xml, is to use this tool to convert it to json and save it: https://stackoverflow.com/a/10201405/861487 import xmltodict doc = xmltodict.parse(""" ... ... ... elements ... more elements ... ... ... element as well ... ... ... """) doc['mydocument']['@has'] Out[3]: u'an attribute'
type: Answer
has comment: http://stackoverflow.com/comment/44092809
has comment: http://stackoverflow.com/comment/44065848
score: 1
downvote count: 0

angularjs-validation
tags question: http://stackoverflow.com/q/27952132
tag name: angularjs-validation
type: Tag

http://stackoverflow.com/comment/44320360
has text: so how do i call the onload event? I want a script to start after the entire webpage has been loaded ?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27961004
type: Comment

http://stackoverflow.com/q/27926849
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44250782
has comment: http://stackoverflow.com/comment/44280521
tagged with: visibility
has body: I'm trying to hide a parent div if the child items are all invisible. I can hide the parent if there are no children but cannot determine how to hide based on visibility; &lt;div ng-repeat="group in section.groups" ng-show="group.fields.length &gt; 0"&gt; &lt;input ng-if='field.isVisible' type="text" name="{{ field.id }}" id="{{ field.id }}" ng-model="field.value" /&gt; &lt;/div&gt; Can someone please provide an example of how to show the outer div only when there are inputs that meet the ng-if condition of field.isVisible? Thanks, Brian
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44254629
favorite count: 0
tagged with: angularjs
has title: How do I hide a div if there are no visible children in AngularJS?
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27926915
type: Question
score: 2
has comment: http://stackoverflow.com/comment/44250802

http://stackoverflow.com/comment/44078768
has text: Please keep link to original article but also provide a summary here. Link-only answers may be broken if link become unavailable (and they're often downvoted for that).
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27837202
score: 1

http://stackoverflow.com/q/27879745
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44166002
has comment: http://stackoverflow.com/comment/44162226
upvote count: 3
tagged with: multithreading
type: Question
linked to: http://stackoverflow.com/q/25940806
has comment: http://stackoverflow.com/comment/44163716
has answer: http://stackoverflow.com/a/27880359
tagged with: javascript
has comment: http://stackoverflow.com/comment/44165945
answer count: 2
score: 3
has answer: http://stackoverflow.com/a/27880512
has body: I am trying to make multiple API calls asynchronously in Meteor. I want to run some functions at the same time, and then when they are done, be able to use all those results to do something else. Below outlines what I mean: Http.get(something) Http.get(something else) Http.get(something more) Http.get(something even else more) I want to be able to run these at the same time, and then when they are done, access the data all at once. What is the best way to do something like this in Meteor?
downvote count: 0
tagged with: meteor
tagged with: asynchronous
favorite count: 0
has title: How can I run asynchronous calls in batches in Meteor?

http://stackoverflow.com/comment/44112810
type: Comment
has text: This isn't quite right: the `style` attribute has two CSS properties in it but you've ended the attribute after the first one.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27854535

http://stackoverflow.com/a/39369672
answers question: http://stackoverflow.com/q/27813308
type: Answer
score: 2
upvote count: 3
downvote count: 1
has body: But, now run_prettify.js was removed by google. So, you can use this CDN version of this cloudfare link

http://stackoverflow.com/comment/44049151
has text: I have some existing application, just for update. There is quite a lot of files, and sub files for review :)
comment on: http://stackoverflow.com/q/27821683
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44118737
score: 0
type: AnswerComment
has text: Great! one question, can I place an "if(spotId)" inside the link function and load only when it is set other wise show "no posts"
type: Comment
comment on: http://stackoverflow.com/a/27857404

http://stackoverflow.com/comment/44302615
comment on: http://stackoverflow.com/q/27953702
has text: Which line is the error on? Have you used the Javascript debugger to look at the variables? What does `valString.splice` return?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27893544
has comment: http://stackoverflow.com/comment/44188369
has body: I'm trying to make a quiz powered by jQuery (and maybe JSON), with the values stored in a database. It works fine so far, but I'd like to hide the radio buttons (CSS: display: none) and make each question look like a button (much easier to select than a tiny radio button). However, when I do this, the following JavaScript doesn't work, and the quiz isn't scored. var imgpath = "/images/sections/test/"; var jsonpath = "/2b/inc/pages/quiz-php/json/"; var jsonfile = "key"; $(document).ready(function(){ //Make sure radio buttons are not disabled or checked (helpful when refreshing) $("input[type='radio']").attr("disabled", false); $("input[type='radio']").attr("checked", false); $(".submit").click(function(e){ e.preventDefault(); //Check the quiz results checkQuiz(); }); //Build the json filename jsonfile = $("#quiz").attr("rel")+".php"; }); //Load json file function getData(update){ $.getJSON(jsonpath+jsonfile, function(json){ //Execute the callback update(json); }).error(function(){alert("error");}); } function checkQuiz(){ $(".submit").remove(); getData(function(data){ var ans = data.key; var result = {}; $(".Question").each(function(){ //Get the question id var _q = $(this).attr("id"); //Get the selected answer class var _a = $("#"+_q+" input:checked").closest("li").attr("class"); //Add the values to the result object result[_q] = _a; //Compare the selected answer with the correct answer if(ans[_q]==_a){ $(this).addClass("correct"); }else{ $(this).addClass("wrong"); } }); //Build the feedback var fdbck = "You got "+$(".correct").length+" out of "+$(".Question").length+" correct. " if($(".correct").length==0){ fdbck += "Better luck next time."; }else if($(".correct").length&gt;$(".Question").length/2){ fdbck += "Good job!"; }else{ fdbck += "Not bad."; } $(".feedback").text(fdbck); $(".feedback").show(); }); } So I wondered if there's some way to record scores besides a radio button. I created a JSFiddle @ http://jsfiddle.net/9j7fz99w/6/ to illustrate how I'm using jQu…
has comment: http://stackoverflow.com/comment/44225929
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44191955
accepted answer: http://stackoverflow.com/a/27894188
score: 0
has comment: http://stackoverflow.com/comment/44188613
has comment: http://stackoverflow.com/comment/44189070
answer count: 1
has title: Replacing radio button with "selected" in JavaScript
has comment: http://stackoverflow.com/comment/44188673
has comment: http://stackoverflow.com/comment/44188558
has comment: http://stackoverflow.com/comment/44189094
has answer: http://stackoverflow.com/a/27894188
has comment: http://stackoverflow.com/comment/44188632
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44188387
has comment: http://stackoverflow.com/comment/44188574
has comment: http://stackoverflow.com/comment/44226750
type: Question

http://stackoverflow.com/comment/44117247
score: 0
type: Comment
has text: I have added code to show how I am loading the scripts. I do not know exactly what changes I made. Just small amendments here and there. I have not added anything major and not changed the JQuery for this script.
type: QuestionComment
comment on: http://stackoverflow.com/q/27845510

http://stackoverflow.com/comment/44146135
score: 0
type: Comment
type: QuestionComment
has text: I'd also like to be the first to point out here that, on that other question, I got credit for an answer I don't understand. :(
comment on: http://stackoverflow.com/q/27871802

http://stackoverflow.com/q/27936841
has title: How can I handle a potentially pre-filled form with Jade?
has comment: http://stackoverflow.com/comment/45019084
has body: I have this huge form that only gets pre-filled data if data already exists in a database. Otherwise, none of the text boxes should have the value parameter in them. I thought it would just ignore the value parameters if the variable I get data from does not exist. But instead, I get an error. How to I handle this case? Will I have to do an if check before each text box in Jade like the following? if (typeof(prefilled_data) !== 'undefined') input.form-control#prevalence(type="text", name="prevalence") else input.form-control#prevalence(type="text", name="prevalence", value=prefilled_data.tb_burden_estimates.prevalence) While I don't mind doing this (Sublime Text will help with all the copy-pasting), there are quite a few form fields, so it might get ugly. Is there a way to consolidate this into one check somewhere?
has comment: http://stackoverflow.com/comment/44288787
has comment: http://stackoverflow.com/comment/44271282
tagged with: javascript
type: UnansweredQuestion
tagged with: pug
has answer: http://stackoverflow.com/a/34529938
has comment: http://stackoverflow.com/comment/45019461
has answer: http://stackoverflow.com/a/27954356
type: Question
answer count: 2
tagged with: node.js
score: 0

http://stackoverflow.com/comment/44306805
has text: Thank you, didn't see it a second ago. Thanks for the two different solutions. Cheers.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27955958
type: Comment

http://stackoverflow.com/comment/126258190
score: 0
type: AnswerComment
type: Comment
has text: Same for Android webview :D
comment on: http://stackoverflow.com/a/27852788

http://stackoverflow.com/comment/44242616
score: 0
type: Comment
type: QuestionComment
has text: var addrow = ' '; $('#askQuestion').append(addrow);
comment on: http://stackoverflow.com/q/27921394

http://stackoverflow.com/a/27871710
upvote count: 2
answers question: http://stackoverflow.com/q/27871648
has body: //case 1 var str = 'x=12'; str.replace(/\s*=\s*/,' = '); // str = 'x = 12'; //case 2 var str = 'x =12'; str.replace(/\s*=\s*/,' = '); // str = 'x = 12'; //case 3 var str = 'x= 12'; str.replace(/\s*=\s*/,' = '); // str = 'x = 12';
type: Answer
downvote count: 0
score: 2

http://stackoverflow.com/q/27958359
type: AnsweredQuestion
has body: I have an existing model compiled from java to javascript using GWT 2.7. Each property in this model has a getValue() and a setValue() method. The method names are not mangled. I want to use these properties in {{}} expressions, specifically for binding using ngModel. I'm using the "getterSetter" option and a function in the $scope that wraps getValue()/setValue() in an angularJS getterSetter function. The problem is that I don't want to duplicate this function in each scope. Is there any way of accessing a global function in an angularJS expression?
accepted answer: http://stackoverflow.com/a/28018001
type: Question
answer count: 2
has title: Adapting non-standard properties in angularjs
tagged with: javascript
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28018001
possible better answer: http://stackoverflow.com/a/27958621
has answer: http://stackoverflow.com/a/27958621
tagged with: gwt

twitter-bootstrap
tags question: http://stackoverflow.com/q/27858767
tags question: http://stackoverflow.com/q/27868675
tags question: http://stackoverflow.com/q/27855200
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/27859845
tags question: http://stackoverflow.com/q/27948439
tags question: http://stackoverflow.com/q/27870393
tags question: http://stackoverflow.com/q/27832945
tags question: http://stackoverflow.com/q/27878431
tags question: http://stackoverflow.com/q/27828990
tags question: http://stackoverflow.com/q/27926924
tags question: http://stackoverflow.com/q/27804225
tags question: http://stackoverflow.com/q/27884020
tags question: http://stackoverflow.com/q/27901506
tags question: http://stackoverflow.com/q/27886618
tags question: http://stackoverflow.com/q/27865116
tags question: http://stackoverflow.com/q/27926156
tags question: http://stackoverflow.com/q/27885187
tags question: http://stackoverflow.com/q/27887279
tags question: http://stackoverflow.com/q/27889698
tags question: http://stackoverflow.com/q/27834079
tags question: http://stackoverflow.com/q/27930161
tags question: http://stackoverflow.com/q/27899601
tags question: http://stackoverflow.com/q/27938635
tags question: http://stackoverflow.com/q/27884824
tags question: http://stackoverflow.com/q/27885849
tags question: http://stackoverflow.com/q/27918307
tags question: http://stackoverflow.com/q/27939992
tags question: http://stackoverflow.com/q/27912726
tags question: http://stackoverflow.com/q/27884559
tags question: http://stackoverflow.com/q/27826598
tags question: http://stackoverflow.com/q/27930455
tags question: http://stackoverflow.com/q/27902060
tags question: http://stackoverflow.com/q/27939146
tags question: http://stackoverflow.com/q/27875890
tags question: http://stackoverflow.com/q/27810217
tags question: http://stackoverflow.com/q/27879884
tags question: http://stackoverflow.com/q/27831670
tags question: http://stackoverflow.com/q/27867304
tags question: http://stackoverflow.com/q/27878717
tags question: http://stackoverflow.com/q/27823627
tags question: http://stackoverflow.com/q/27894209
tags question: http://stackoverflow.com/q/27911701
tags question: http://stackoverflow.com/q/27952162
tags question: http://stackoverflow.com/q/27928243
tags question: http://stackoverflow.com/q/27849237
tags question: http://stackoverflow.com/q/27944961
tags question: http://stackoverflow.com/q/27916697
tags question: http://stackoverflow.com/q/27934286
tags question: http://stackoverflow.com/q/27956284
tags question: http://stackoverflow.com/q/27858229
tags question: http://stackoverflow.com/q/27865368
type: Tag
tags question: http://stackoverflow.com/q/27942599
tags question: http://stackoverflow.com/q/27834535
tags question: http://stackoverflow.com/q/27867912
tags question: http://stackoverflow.com/q/27909805
tags question: http://stackoverflow.com/q/27816090
tags question: http://stackoverflow.com/q/27926788
tags question: http://stackoverflow.com/q/27817802
tags question: http://stackoverflow.com/q/27808961
tags question: http://stackoverflow.com/q/27851115
tags question: http://stackoverflow.com/q/27863932
tags question: http://stackoverflow.com/q/27897889
tags question: http://stackoverflow.com/q/27927690
tags question: http://stackoverflow.com/q/27863610
tags question: http://stackoverflow.com/q/27919008
tags question: http://stackoverflow.com/q/27851459
tags question: http://stackoverflow.com/q/27832360
tags question: http://stackoverflow.com/q/27843769
tags question: http://stackoverflow.com/q/27942688
tags question: http://stackoverflow.com/q/27902737
tags question: http://stackoverflow.com/q/27902966
tags question: http://stackoverflow.com/q/27872136
tags question: http://stackoverflow.com/q/27924609
tags question: http://stackoverflow.com/q/27952414
tags question: http://stackoverflow.com/q/27900112
tags question: http://stackoverflow.com/q/27935737
tags question: http://stackoverflow.com/q/27887777
tags question: http://stackoverflow.com/q/27861435

http://stackoverflow.com/a/27936520
has comment: http://stackoverflow.com/comment/44304459
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44331254
answers question: http://stackoverflow.com/q/27935946
has body: You're adding the data twice Style tags outside the &lt;head&gt; URL in $.ajax not quoted, ends up being an undefined variable Invalid HTML,spans and LI's in a strange mix Here's what it should look like function hideContactErrors() { $('#contactFormErrors, #nameErrorShow, #emailErrorShow, #phoneErrorShow, #messageErrorShow').hide(); } $('#contactUsForm').on('submit', function(e) { e.preventDefault(); hideContactErrors(); $.ajax({ url : 'mailer.php', type : 'POST', dataType : 'json', data : $(this).serialize() }).done(function(data) { if (data.status == "success") { $(".successHolder").show().delay(2000).hide(1); $("#name, #email, #phone, #comments, #subject").val("") } else { $("#contactFormErrors").hide(); $("#nameErrorShow").show().find('span').html(function(_, html) {return data.name||html;}); $("#emailErrorShow").show().find('span').html(function(_, html) {return data.email||html;}); $("#phoneErrorShow").show().find('span').html(function(_, html) {return phone.name||html;}); $("#messageErrorShow").show().find('span').html(function(_, html) {return comments.name||html;}); } }); });
has comment: http://stackoverflow.com/comment/44338936
upvote count: 1
has comment: http://stackoverflow.com/comment/44333902

http://stackoverflow.com/comment/44222272
score: 2
comment on: http://stackoverflow.com/q/27911366
type: Comment
type: QuestionComment
has text: Change type from `type: 'POST'`, to `type: 'GET'`,

http://stackoverflow.com/comment/44242070
comment on: http://stackoverflow.com/q/27922535
type: QuestionComment
has text: Please refer to this [link](http://stackoverflow.com/help/how-to-ask) to show how to ask a good question. Your post is not very clear, please explain exactly what the issue is, what you have tried already, provide sample JSON response that you get etc
score: 5
type: Comment

http://stackoverflow.com/q/27819771
upvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27819901
tagged with: http://stackoverflow.com/tag/html
has body: I'm using angularjs, i want to search from a table called cycle as shown below, i want to search data using weeks in cycle searching to screenshot 1 . When i search to screen shot 1 the data must display on screen shot 2 and when i select on screenshot 2 must go back to screen shot 1 and display the selected details how can i achieve this please help. model public partial class Cycle { public int CycleID { get; set; } public Nullable&lt;System.DateTime&gt; StartDate { get; set; } public Nullable&lt;System.DateTime&gt; EndDate { get; set; } public string Cycle1 { get; set; } public Nullable&lt;int&gt; WeeksInCycle { get; set; } } screenshot 1 screenshot 2
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
downvote count: 2
has title: how to do search using angular?
score: -2
type: Question
tagged with: c#

http://stackoverflow.com/comment/44166393
comment on: http://stackoverflow.com/q/27882281
score: 0
type: Comment
type: QuestionComment
has text: Actually, it's a very good security feature. If this weren't the case, websites could hack your accounts on other websites.

http://stackoverflow.com/comment/44060340
comment on: http://stackoverflow.com/q/27823908
score: 0
type: Comment
type: QuestionComment
has text: If you have access to Sitecore Support then I would consider raising a ticket and see if they can provide some insight.

http://stackoverflow.com/comment/121706796
has text: You start at https://en.wikipedia.org/wiki/MIME and follow the links to RFCs for more complete details.
type: AnswerComment
comment on: http://stackoverflow.com/a/27952099
score: 0
type: Comment

http://stackoverflow.com/q/27842700
score: 0
has comment: http://stackoverflow.com/comment/44089365
tagged with: http://stackoverflow.com/tag/html
has title: cloning html element doesnt seem to have prototype methods
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44089433
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/44089332
tagged with: javascript
has body: I am trying to clone the contents of a modal before it disappears. basically when the ok button is clicked it passes a clone of object to function like so $ok.onclick = function(e){ if(params.ok) var $cont = $content.cloneNode(true); params.ok($cont); closeSlert($slert); } however later I am trying to use getElementById() but it returns that this is not a function I thought that Element.clone clones the prototype as well. just incase someone thinks to suggest $content.cloneNode(true) that doesnt seem to pass prototype methods either. is there a way to reapply the prototype methods or better yet clone them with the element here is the entire slert function function genSlert(params) { var slerts = getSlerts(), $slert = document.createElement('div'), $buttons = document.createElement('div'), $ok = document.createElement('button'), $cancel = document.createElement('button'), $content = document.createElement('div'); for(var i = 0; i &lt; slerts.length; i++){ slideUp(slerts[i]); } $buttons.className = 'buttons'; $content.innerHTML = params.content; $content.className = 'content'; $slert.className = 'slert'; $slert.appendChild($content); $slert.appendChild($buttons); $buttons.appendChild($cancel); $buttons.appendChild($ok); $ok.innerHTML = 'OK'; $cancel.innerHTML = 'CANCEL'; wrapper.appendChild($slert); wrapper.classList.remove('hidden'); document.body.classList.add('no-scroll'); $cancel.onclick = function (e) { if (params.cancel) { params.cancel(e); } //close modal closeSlert($slert); } $ok.onclick = function(e){ if(params.ok){ var $cont = $content.cloneNode(true); params.ok($cont); } closeSlert($slert); } }
has comment: http://stackoverflow.com/comment/44089409
has comment: http://stackoverflow.com/comment/44089661

http://stackoverflow.com/comment/44204784
comment on: http://stackoverflow.com/a/27902532
type: Comment
has text: Yes, because `document.childNodes` is a property stub while `document.querySelectorAll(*);` is a function stub that give results after execution, Thats why property stub is always faster then others,
score: 1
type: AnswerComment

http://stackoverflow.com/a/27816144
type: Answer
has body: No it's not possible in PHP. PHP is a server side language, you can't pass him variables without a call to php script. Javascript is a client-side language and it is NOT secure. The best answer for your question is : Use JS on client-side to get the ID Call from JS (ajax for example) a PHP script and send it the ID in parameter (post/get). On server-side (php), you make the SQL request (and secure the ID : intval()) and you get the result. From php you send back the result (json for example). JS get the result and parse/use it !
score: 0
answers question: http://stackoverflow.com/q/27815702

http://stackoverflow.com/q/27888176
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27888603
type: Question
has title: Asynchronous validation in angularjs 1.2
tagged with: javascript
score: 0
has body: I am trying to create an email exists validation directive which makes an ajax call to see if email exists.I am unable to have the validation updated for the field with this code. app.directive('uniqueValidator', ['UniqueValidatorService',function(uniqueValidatorService) { var linkFn=function(scope, elem, attrs,ngModel) { var vm=this; vm.ngModel=ngModel; vm.scope=scope; var config=scope.$eval(attrs.uniqueValidator); console.log('Value of the atribute'+window.angular.toJson(config)); /*If the value is truly unique then we would want to set validation as passed*/ vm.successCallback=function successCallback(unique){ vm.ngModel.$setValidity('unique',false); console.log('Value of validity success case'+vm.ngModel.$valid); }; /*Set validity as false to make sure we have a */ vm.errorCallback=function errorCallback(error){ ngModel.$setValidity('unique',true); console.log('Value of validity'+ngModel.$valid); }; var blurHandler=function(event){ console.log('In blur'+ngModel); if (!ngModel || !elem.val()) return; var currentValue=elem.val(); uniqueValidatorService.checkUniqueness(config.url,config.property,currentValue).then(function(data){ vm.successCallback(data); },function(error){vm.errorCallback(error)}); } elem.bind('blur',blurHandler.bind(vm)); }; return { restrict: 'A', scope:{}, require:'ngModel', link: linkFn }; } ]) .directive('uniqueErrorMessage',function(){ var linkFn= function(scope, elem, attrs,ngModel){ scope.message='Email is in use'; console.dir(scope.registrationForm.email.$error); }; return { restrict: 'E', replace:true, template:'&lt;span ng-show="registrationForm.email.$dirty &amp;&amp; registrationForm.email.$error.unique" &gt;{{message}}&lt;/span&gt;', link: linkFn }; }); The unique error message directive is not getting updated properly as per the validation outcome.Even if the validation passes,it still shows on DOM. Also I am seeing that ngModel.$valid for the input element is coming as true even if the validation is failed.I have tried encapsulatin…
tagged with: validation
answer count: 1
accepted answer: http://stackoverflow.com/a/27888603

http://stackoverflow.com/q/27941510
has body: browser.switchTo().alert() not working in protractor. sample code: browser.get('http://google.com'); browser.switchTo().alert().accept(); Message: UnexpectedAlertOpenError: unexpected alert open (Session info: chrome=39.0.2171.95) (Driver info: chromedriver=2.12.301325 (962dea43ddd90e7e4224a03fa3c36a421281abb7),platform=Windows NT 6.1 SP1 x86_64) Stacktrace: UnexpectedAlertOpenError: unexpected alert open C:\Users\Vikas.Gahlaut\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113 var template = new Error(this.message); ^ UnexpectedAlertOpenError: unexpected alert open Tried everything and it is not related to chrome driver issue as same is working fine with webdriver-java native APIs.
tagged with: angularjs
has answer: http://stackoverflow.com/a/27950490
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44294854
answer count: 4
score: 3
tagged with: protractor
tagged with: selenium
has answer: http://stackoverflow.com/a/34148836
tagged with: webdriver
has comment: http://stackoverflow.com/comment/44281515
type: Question
has answer: http://stackoverflow.com/a/45562890
has answer: http://stackoverflow.com/a/34034497
tagged with: javascript
has title: browser.switchTo().alert() not working in protractor
downvote count: 1
upvote count: 4
linked to: http://stackoverflow.com/q/38779693
favorite count: 0

http://stackoverflow.com/comment/44281515
score: 0
type: Comment
type: QuestionComment
has text: Are you sure there is an alert opened?
comment on: http://stackoverflow.com/q/27941510

http://stackoverflow.com/comment/44210128
has text: Done, also left the original one in with a usage notice, Thanks.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27904670
type: Comment

http://stackoverflow.com/comment/44279271
type: Comment
has text: It would certainly make sense for that to be the case, here. [@Andreas](http://stackoverflow.com/users/402037/andreas)' [comment](http://stackoverflow.com/questions/27941288/unexpected-behavior-in-empty-arrays-with-a-set-length#comment44278813_27941288) seems to confirm this.
comment on: http://stackoverflow.com/a/27941615
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44168673
score: 0
comment on: http://stackoverflow.com/q/27883399
type: Comment
type: QuestionComment
has text: Ah. what is the "triangles" list? does it exist in the javascript context? I'm not super familiar with rhino, but I doubt you can modify the context of a list in javascript if the list only exists in the java context.

ajax
tags question: http://stackoverflow.com/q/27937644
tags question: http://stackoverflow.com/q/27823187
tags question: http://stackoverflow.com/q/27919915
tags question: http://stackoverflow.com/q/27837967
tags question: http://stackoverflow.com/q/27879605
tags question: http://stackoverflow.com/q/27963673
tags question: http://stackoverflow.com/q/27955818
tags question: http://stackoverflow.com/q/27907234
tags question: http://stackoverflow.com/q/27907909
tags question: http://stackoverflow.com/q/27915421
tags question: http://stackoverflow.com/q/27821767
tags question: http://stackoverflow.com/q/27814350
tags question: http://stackoverflow.com/q/27873277
tags question: http://stackoverflow.com/q/27844230
tags question: http://stackoverflow.com/q/27871657
tags question: http://stackoverflow.com/q/27899767
tags question: http://stackoverflow.com/q/27818794
tags question: http://stackoverflow.com/q/27933652
tags question: http://stackoverflow.com/q/27943634
tags question: http://stackoverflow.com/q/27933946
tags question: http://stackoverflow.com/q/27903664
tags question: http://stackoverflow.com/q/27804827
tags question: http://stackoverflow.com/q/27934581
tags question: http://stackoverflow.com/q/27806574
tags question: http://stackoverflow.com/q/27833175
tags question: http://stackoverflow.com/q/27883475
tags question: http://stackoverflow.com/q/27933188
tags question: http://stackoverflow.com/q/27853672
tags question: http://stackoverflow.com/q/27902780
tags question: http://stackoverflow.com/q/27810118
tags question: http://stackoverflow.com/q/27926682
tags question: http://stackoverflow.com/q/27937366
tags question: http://stackoverflow.com/q/27888285
tags question: http://stackoverflow.com/q/27936742
tags question: http://stackoverflow.com/q/27881071
tags question: http://stackoverflow.com/q/27829200
tags question: http://stackoverflow.com/q/27953781
tags question: http://stackoverflow.com/q/27883296
tags question: http://stackoverflow.com/q/27910811
type: Tag
tags question: http://stackoverflow.com/q/27925586
tags question: http://stackoverflow.com/q/27911761
tags question: http://stackoverflow.com/q/27897851
tags question: http://stackoverflow.com/q/27888719
tags question: http://stackoverflow.com/q/27865670
tags question: http://stackoverflow.com/q/27877660
tags question: http://stackoverflow.com/q/27961278
tags question: http://stackoverflow.com/q/27887862
tags question: http://stackoverflow.com/q/27913627
tags question: http://stackoverflow.com/q/27815442
tags question: http://stackoverflow.com/q/27923147
tags question: http://stackoverflow.com/q/27893675
tags question: http://stackoverflow.com/q/27815642
tags question: http://stackoverflow.com/q/27904159
tags question: http://stackoverflow.com/q/27905814
tags question: http://stackoverflow.com/q/27889580
tags question: http://stackoverflow.com/q/27892182
tags question: http://stackoverflow.com/q/27945919
tags question: http://stackoverflow.com/q/27850860
tags question: http://stackoverflow.com/q/27805015
tags question: http://stackoverflow.com/q/27818450
tags question: http://stackoverflow.com/q/27937480
tags question: http://stackoverflow.com/q/27853868
tags question: http://stackoverflow.com/q/27879488
tags question: http://stackoverflow.com/q/27929376
tags question: http://stackoverflow.com/q/27940570
tags question: http://stackoverflow.com/q/27853912
tags question: http://stackoverflow.com/q/27833815
tags question: http://stackoverflow.com/q/27919759
tags question: http://stackoverflow.com/q/27869088
tags question: http://stackoverflow.com/q/27854875
tags question: http://stackoverflow.com/q/27826583
tags question: http://stackoverflow.com/q/27930577
tags question: http://stackoverflow.com/q/27930094
tags question: http://stackoverflow.com/q/27847747
tags question: http://stackoverflow.com/q/27923582
tags question: http://stackoverflow.com/q/27919645
tags question: http://stackoverflow.com/q/27893029
tags question: http://stackoverflow.com/q/27884061
tags question: http://stackoverflow.com/q/27875109

http://stackoverflow.com/q/27847847
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/44099645
has body: I have a directive with a template (basically two buttons with ng-click on them). app.directive('foo', function(){ return { scope: { onNext: "=", onPreviousClick: "=" }, restrict: "E", template: " Prev Next ", link: function($scope){ $scope.onPreviousClick = function(){ console.log("Prev click event from directive"); } $scope.onNextClick = function(){ console.log("Next click event from directive"); } } } }); Now when I use the directive, I want to set the click handler to do work in the controller. app.controller("myController", function($scope){ this.onPreviousClick = function(){ console.log("Prev click from the controller."); } }); Basically I want the click event to "pass-through" both the directive and controller. I want both event handlers to fire for the previous button click. But I can only get one or the other click handler to work. If I comment out my directive handler, the controller works, and vis versa.
tagged with: angularjs-ng-click
has title: How do you handle a template ng-click in both a directive and controller?
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44099835
has answer: http://stackoverflow.com/a/27848078
score: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27848078
has comment: http://stackoverflow.com/comment/44099869
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44099799

http://stackoverflow.com/q/27934586
tagged with: tooltip
tagged with: javascript
has answer: http://stackoverflow.com/a/27945364
has title: Struts Option tooltip not working
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
type: Question
tagged with: struts
has body: I wanted tooltip on Html:options element, when mouseover to each, displays opition name of that property. <logic:present name = "xxx"> <html:options collection="" name="" property="" labelProperty=""/> </logic:present> tried with JScript, showToolTips(), also dint work is there anyway around tooltip inside html:options tag or html:select tag thanks for any help,
answer count: 1

http://stackoverflow.com/comment/44232928
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27917248
type: Comment
has text: ok. first you need to give some ID to tag. In my case I assume this as second you need to give ID to buttin which you want to alter on select of option which is then just apply this script

onbeforeunload
tags question: http://stackoverflow.com/q/27956067
tag name: onbeforeunload
type: Tag
tags question: http://stackoverflow.com/q/27933022

http://stackoverflow.com/a/27849731
type: Answer
downvote count: 1
has body: First sort the array var data = [ ];(your data) data.sort(sort); function sort(a,b) { if (a.articlecategoryid &lt; b.articlecategoryid) return -1; if (a.articlecategoryid &gt; b.articlecategoryid) return 1; return 0; } Then count the duplicate values var current = null; var cnt = 0; for (var i = 0; i &lt; data.length; i++) { if (data[i].articlecategoryid != current) { if (cnt &gt; 0) { document.write('Category'+current+'--&gt;'+cnt+ ' times&lt;br&gt;'); } current = data[i].articlecategoryid; cnt = 1; } else { cnt++; } } if (cnt &gt; 0) { document.write('Category'+current+'--&gt;'+cnt+ ' times'); } see the example in here
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27848462
score: 0
upvote count: 1
answers question: http://stackoverflow.com/q/27848462
has comment: http://stackoverflow.com/comment/44104799

http://stackoverflow.com/comment/44103736
has text: If you put a breakpoint in the computed you will find that the values are being recalculated. It's just the values you generate don't appear to change within the 2 decimal places you format to
score: 0
comment on: http://stackoverflow.com/q/27847315
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/52882230
score: 0
type: Comment
has text: The passport-steam npm module should be up to date. You need to add that tiny bit of code above to `api/services/passport.js: connect function`. The `profile` object should have the data returned from the Steam API, so you can get steam id, avatar image, etc.. You also need to add the Steam Passport config to `config/passport.js`. The first post shows a boilerplate object to paste into `module.exports.passport = { /* STEAM CONFIG HERE */ }` I have not used Sails in a few months, so I am unsure if this advice is completely correct.
comment on: http://stackoverflow.com/a/29126047
type: AnswerComment

http://stackoverflow.com/q/27834551
has body: I have this page with following HTML in 'magento' shopping cart page,How can i get the relevant product name (ex.Yamaha PSRE343) on the click event of delete (class=cart_delete_bt),if I have same classes for all products,in javascript in order to be used it in macro of Google Tag Manager. IK Multimedia iRig Keys $139.00 $139.00 Yamaha PSRE343 $279.00 $279.00 on click of the delete button i want to get the text highlighted . I have tried it in jquery as follows jQuery('.cart_delete_bt').closest('.check').find('.RemovedProduct_Track').html(); also i have tried it using following jquery jQuery('.cart_delete_bt').first(1).parent().parent().first(1).children().children().attr('title'); but now i have to do it in javascript in order to implement it in GTM. Please Help.
tagged with: jquery
linked to: http://stackoverflow.com/q/18663941
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44074383
has comment: http://stackoverflow.com/comment/44077864
upvote count: 2
has comment: http://stackoverflow.com/comment/44074312
type: Question
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/44074436
tagged with: magento
has answer: http://stackoverflow.com/a/27836854
tagged with: google-tag-manager
tagged with: javascript
has title: Getting element attribute if clicked on element with similar classes
score: 2
answer count: 1
downvote count: 0

http://stackoverflow.com/a/27852821
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44110986
has body: var a, b, c, ..., v = 0; doesn't initialize all the variables. It initializes v to 0, but all the other variables are undefined. That needs to be: var a = 0, b = 0, c = 0, ..., v = 0; Or you can do: var a, b, c, ..., v; a = b = c = ... v = 0; I suggest you reconsider using separate variables for everything, and use an array. You can then use a loop that iterates over all the inputs, and sets the corresponding element to either 0 or the input value.
has comment: http://stackoverflow.com/comment/44131644
upvote count: 4
answers question: http://stackoverflow.com/q/27852767
score: 4

http://stackoverflow.com/comment/44096198
comment on: http://stackoverflow.com/a/27845757
has text: Thank you so much! It works but not completely! There's just one issue left! I get "valueexample1", "valueexample2", "valueexample3" BUT, how can I get an specific value? For example, for "items" > "i1990" > get only second value? Thanks again, you're being a big help!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27816099
has comment: http://stackoverflow.com/comment/44111398
type: Answer
has comment: http://stackoverflow.com/comment/44039500
has comment: http://stackoverflow.com/comment/44112708
has comment: http://stackoverflow.com/comment/44087199
upvote count: 1
has body: Different slider uses different name, if you name the first slider as 'slider1', please name the second as 'slider2' then. while($row = $result->fetch_assoc()) { ?> <img class="img-responsive center-block" alt="tour" src="<?php echo $this->getBaseUrl() ?>media/images/category/thumbs/<?php echo $row['thumbnail']?>" /> <img class="img-responsive center-block" alt="tour1" src="<?php echo $this->getBaseUrl() ?>media/images/category/thumbs/<?php echo $row['image']?>" /> <?php echo $row['title']?> <?php } } ?>
has comment: http://stackoverflow.com/comment/44039422
answers question: http://stackoverflow.com/q/27812608
has comment: http://stackoverflow.com/comment/44109503
downvote count: 0
score: 1

http://stackoverflow.com/comment/44120426
has text: You have a typo at the end of the 2nd line - it should be `}",`
comment on: http://stackoverflow.com/q/27857472
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44299711
score: 4
comment on: http://stackoverflow.com/q/27952345
type: Comment
type: QuestionComment
has text: Is the question, please write this for me?

http://stackoverflow.com/comment/44062588
has text: it doesn't have to be an object. He just has to do proper string concatenation and param building.
score: 2
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27828297

http://stackoverflow.com/comment/44462761
comment on: http://stackoverflow.com/a/27938590
has text: winresh24, could you help me to change my code at http://jsfiddle.net to make it clear. TQ
score: 0
type: Comment
type: AnswerComment

authentication
tags question: http://stackoverflow.com/q/27951436
tags question: http://stackoverflow.com/q/27901504
tags question: http://stackoverflow.com/q/27889580
tag name: authentication
type: Tag
tags question: http://stackoverflow.com/q/27877590
tags question: http://stackoverflow.com/q/27865209
tags question: http://stackoverflow.com/q/27863657

http://stackoverflow.com/q/27877069
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44156111
score: 0
has comment: http://stackoverflow.com/comment/44155897
has body: How do i create a navigation bar like the one in " http://www.myntra.com " where on hovering over the "men" tab a div is shown and on moving the mouse pointer outside the div goes off. I tried using the tabs in the bootstrap 3. Home Profile Messages Settings .qqq.. ..aaa. .vvv.. .zzz.. and this jquery code below to make it look like the navigation bar myntra.com. $(document).ready(function(){ $('.nav-tabs > li > a').hover( function(){ $(this).tab('show'); }); }); CSS code : .tab-pane{ border: 1px solid black; z-index: 10; position: absolute; width: 84%; height: 50%; background-color: rgba(0, 0, 0, 0.4); } Where should i make changes to give the same feel as the navigation bar in www.myntra.com ? Or is there any other approach to achieve it ? Please help me on this.
tagged with: http://stackoverflow.com/tag/html
tagged with: web
tagged with: twitter-bootstrap-3
answer count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44156634
type: Question
has title: How to make with twitter bootstrap tabs a navigation bar similar to http://www.myntra.com

http://stackoverflow.com/q/27837270
tagged with: angularjs
has answer: http://stackoverflow.com/a/36940333
has answer: http://stackoverflow.com/a/28688356
answer count: 4
tagged with: cordova
type: UnansweredQuestion
has title: Ionic ion-content not scrolling down when keyboard shows (Android)
type: Question
upvote count: 9
has body: I have a simple view with a login form. On Android, if the keyboard is opened, the content is not scrolling up to prevent it from getting behind the keyboard. I followed the Keyboard instructions from the docs, and read a lot of forum posts, but I haven't figured it out. I installed the Keyboard plugin com.ionic.keyboard. This is the structure of the page: &lt;ion-nav-view&gt; &lt;ion-view&gt; &lt;ion-content&gt; ...&lt;form&gt;..Login form..&lt;/form&gt;... &lt;/ion-content&gt; &lt;/ion-view&gt; &lt;/ion-nav-view&gt; If I put some extra dummy content in the page, it shows that ion-content is indeed scrollable. However, it's not moving up when the keyboard is opened by focusing on an input. Ionic version? 1.0.0-beta.13 Is my app fullscreen? No Did I test if the keyboard plugin is working? Yes Is there anything else I have to do?
tagged with: ionic-framework
score: 9
has comment: http://stackoverflow.com/comment/45543290
downvote count: 0
has answer: http://stackoverflow.com/a/35550114
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/35004902

http://stackoverflow.com/q/27834442
has answer: http://stackoverflow.com/a/27834613
has title: hide all the date before the selected date
type: Question
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27834537
has body: I am very new to jquery. I made two jquery calendar. One is the departure and another one is the arrival calendar. When the user selects the date in first calendar ( departure ) , the next calendar should hide all the dates before departure date. Example : if the user selects Jan 13 in the departure calendar, the arrival calendar should automatically hide all the dates before Jan 13. How can I achieve this. My calendar code is below. jQuery("#datepickerarr").datepicker({ dateFormat: 'dd/mm/yy', showOn: "both", buttonImage: "images/calendar.png", buttonImageOnly: true, minDate:0, maxDate: '+3M', numberOfMonths:2, buttonText:"click here to expand the calendar" }); jQuery("#datepickerdepone").datepicker({ dateFormat: 'dd/mm/yy', showOn: "both", buttonImage: "images/calendar.png", buttonImageOnly: true, minDate:0, maxDate: '+3M', numberOfMonths:2, buttonText:"click here to expand the calendar", });
has comment: http://stackoverflow.com/comment/44074043
tagged with: jquery
type: UnansweredQuestion
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44115768
type: Comment
type: QuestionComment
has text: we also faced same kinda issue, where, on hot code push app layout used to change. but we ignored it, as we are not supporting Hot code push on production app. if this is the case please feel to ignore this issue during development\
comment on: http://stackoverflow.com/q/27856029
score: 0

http://stackoverflow.com/comment/44307612
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27956157
has text: @user254153 which json is not correctly formatted? is it the first one?
type: Comment

http://stackoverflow.com/comment/44176598
type: Comment
has text: yes but how do i get then the decoded file extension? :D
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27887492

http://stackoverflow.com/a/27840962
answers question: http://stackoverflow.com/q/27840854
accepted answer of: http://stackoverflow.com/q/27840854
type: Answer
upvote count: 4
downvote count: 0
has body: You're correct that the syntax is excessive, but for ES5 and before, that's just how it is. However, in ES6 you can use the new "arrow function" lambda syntax: func(x =&gt; x * x, 2); See http://www.es6fiddle.net/i4o5uj2l/ FWIW, the above func isn't great since it only supports unary functions, i.e. those taking a single parameter. You could expand func to use ES6 "spread arguments": function func(f, ...args) { console.log(f.apply(this, args)); } func((x, y) =&gt; x * y, 3, 7); &gt; 21
type: AcceptedAnswer
score: 4

http://stackoverflow.com/q/27903677
has answer: http://stackoverflow.com/a/27903795
type: AnsweredQuestion
has title: Insert a loading text message before a div gets populated?
has body: I am tweaking my function below and had an issue. I'd like a loading text message to be inserted right before #project-container fills up with HTML and disappear once response has been inserted. However, if I insert: $('#project-container').html("my text here"); ...right before: $('#project-container').html(response); Then, response doesn't show since the div is already populated with "my text here". Is there another method I can use? function projectShow() { $.ajax({ type: 'POST', cache: false, url: ajaxURL, data: {'action': 'load-content', post_id: post_id }, success: function(response) { $('#project-wrapper').addClass('activated'); $('#project-container').html(response); &lt;---I want it inserted $('.post-container').addClass('fadeInUp'); before this line. $('.close-button').addClass('fadeOutDown'); $('#project-wrapper .entry-title').shuffleLetters(); return false; } }); }
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27903769
has comment: http://stackoverflow.com/comment/44206572
has comment: http://stackoverflow.com/comment/44206569
downvote count: 0
has answer: http://stackoverflow.com/a/27903769
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27903795
favorite count: 0
has comment: http://stackoverflow.com/comment/44206559
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44206585

http://stackoverflow.com/q/27928230
has comment: http://stackoverflow.com/comment/44255589
accepted answer: http://stackoverflow.com/a/27931251
score: 0
has comment: http://stackoverflow.com/comment/44256340
answer count: 1
tagged with: angularjs
has body: I am using ckeditor for editing the content, I injected the module and also linked all files which are required by ckeditor, but it's throwing error like TypeError: this[a] is undefined, I am new in Angular, I didn't get any proper solution from myself. Can anybody help me why I am getting this error? Here is my code stuff app.controller('editAboutUsCtrl', function ($scope) { $scope.editorOptions = { language: 'eu' // uiColor: '#000000' }; $scope.$on("ckeditor.ready", function( event ) { $scope.isReady = true; }); }); And here is my HTML Initialising ...
type: AnsweredQuestion
has title: ckeditor throwing error in Angular.js
type: Question
has answer: http://stackoverflow.com/a/27931251
has comment: http://stackoverflow.com/comment/44257836
tagged with: javascript

http://stackoverflow.com/q/27918566
type: UnansweredQuestion
has title: Nodejs and mysql, multiple criteria in a query
tagged with: node.js
has answer: http://stackoverflow.com/a/27919268
tagged with: mysql
tagged with: coffeescript
type: Question
tagged with: javascript
score: 0
answer count: 1
has body: I m actually using the mysql module to query my database and I m facing a problem. In fact, I need to escape a full object and parse it in a query that mysql could understand. Actually, I have : getByCriteria: (collectionName, criteria)-&gt; sql = 'SELECT * FROM ?? WHERE ?' inserts = [collectionName, criteria] sql = MySql.format(sql, inserts) deferred = Q.defer() MysqlAdapter.CONNECTION.query(sql, (err, rows, fields)-&gt; console.log err if err deferred.reject(new Error(err)) else deferred.resolve(rows) ) return deferred.promise But the console.log(sql) prints : SELECT * FROM user WHERE username = 'admin', id=1 So I have guessed that the "Mysql.format" returns a string for the INSERT/UPDATE SQL actions. How can I do it with mysql, without parsing the entire string with a homemade solution ? THanks for advance

http://stackoverflow.com/comment/44275006
comment on: http://stackoverflow.com/q/27939257
score: 1
has text: Your javascript itself works: http://jsfiddle.net/dqr0bdr2/ So we need to see your CSS and HTML to know what's wrong.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44189161
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27893757
has text: I understand your example. But these dates confuses me, I can not set the condition.

http://stackoverflow.com/comment/44311542
has text: @ Kraig Brockschmidt Sure, here it is: ` <div id="listView" class="win-selectionstylefilled" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: Sample.ListView.data.dataSource, itemTemplate: select('.smallListIconTextTemplate'), groupDataSource: Sample.ListView.data.groups.dataSource, groupHeaderTemplate: select('.listLayoutTopHeaderTemplate'), selectionMode: 'none', tapBehavior: 'none', swipeBehavior: 'none', layout: { type: WinJS.UI.ListLayout, groupHeaderPosition: 'top'} }"> ` BTW, I used [this sample](http://try.buildwinjs.com/#listview).
comment on: http://stackoverflow.com/q/27886365
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27894448
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44190107
upvote count: 3
has comment: http://stackoverflow.com/comment/44189999
type: Question
has answer: http://stackoverflow.com/a/27894908
has comment: http://stackoverflow.com/comment/44190070
score: 3
has comment: http://stackoverflow.com/comment/44190005
has comment: http://stackoverflow.com/comment/44190573
linked to: http://stackoverflow.com/q/7056666
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27894908
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/276660
has comment: http://stackoverflow.com/comment/44191411
has comment: http://stackoverflow.com/comment/44190011
has body: I have a website with an AJAX cart. The concept is pretty simple: you end up on a page with a product and can click the Buy Now button. When you do so, the JavaScript code adds the product to the cart, changes the cart visual with the new count, and sends an AJAX request to the server to report the change. What I'm wondering about, since the client and the server may take a while to process the AJAX request, is... will the client clicking a link to move to another page (i.e. "next product") before the AJAX is reported as successful stop the AJAX request at all? // prepare request... ...snip... // send request (usually a POST) jQuery.ajax(uri, ajax_options); // return to user // will a click on a link cancel the AJAX call after this point? Further, I have timed AJAX requests. If the user clicks on a link before those timed requests happen, they will be lost for sure. Assuming that the click does not cancel an AJAX request, would starting one in the unload event work? Would using a cookie be better/safer than attempting another AJAX request? (although if the user clicks an external link, the unload is really the only solution I can think of to save that data...) As a side note: I do not want to darken the screen when the user adds an item to the cart so that way the user can continue to do things... but if the AJAX needs to be confirmed before a link can be clicked, I'd have to make sure clicks cannot be used until then. Update: I thinks that some of you are missing the point. I do not care about the done() or completed() functions getting called on the client side. What I do care about is making sure that in the end I get all the data on the server. I understand that's asynchronous, but what I want to make sure of is avoiding loss of data, especially if the link goes to another website (to the same website, I am really thinking to make use of a cookie to make sure that the data of delayed AJAX requests get to the server no matter what.) Also, the idea of timed data r…
has title: Is an AJAX request killed when a link gets clicked?

http://stackoverflow.com/q/27948599
has answer: http://stackoverflow.com/a/27950220
has title: Display different messages in grid view for not having bound data and no results retrieved
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27950220
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44311221
tagged with: javascript
score: 0
answer count: 1
has body: I have a ASP.NET GridView which I want to populate with a message "No results found" when there are no results to be displayed. Initially I do not want to bind data and have the grid view display "You still need to search". Using an EmptyDataTemplate and just binding null to the grid view only displays one type of message. Is there a way to accomplish that the initial message is as above and a different message is displayed when searched and no results are bound to the GridView? Thanks.
has comment: http://stackoverflow.com/comment/44292925
tagged with: asp.net

http://stackoverflow.com/comment/44181667
comment on: http://stackoverflow.com/q/27890242
type: Comment
type: QuestionComment
has text: if that other page is in iframe then you can use this using jQuery `$("#iFrame").contents().find("#pEmployeeCB").attr('disabled', false);`
score: 0

http://stackoverflow.com/q/27806890
has title: Add class to select element when select element is closed
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27807089
favorite count: 0
has answer: http://stackoverflow.com/a/27807008
has comment: http://stackoverflow.com/comment/44023786
has comment: http://stackoverflow.com/comment/44022898
has body: I am removing a class from a select element when the select element is clicked via a jQuery mousedown event. How can i re-add this class once the select menu closes? JSFiddle http://jsfiddle.net/YvCHW/4274/ $("select.desired").mousedown(function(){ $(this).removeClass('desired'); }); select { margin: 30px 10px; border: 1px solid #111; background: transparent; border: 1px solid #ccc; padding: 5px 10px; -webkit-appearance: none; -moz-appearance: none; appearance: none; } select.desired { font-size: 30px; color: blue; } Apples Pineapples Chocklate Pancakes
upvote count: 2
answer count: 5
type: UnansweredQuestion
tagged with: css
downvote count: 1
has answer: http://stackoverflow.com/a/27808497
has comment: http://stackoverflow.com/comment/44022847
has answer: http://stackoverflow.com/a/27807062
has answer: http://stackoverflow.com/a/27807003
score: 1
type: Question

http://stackoverflow.com/q/27956779
upvote count: 15
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27956812
accepted answer: http://stackoverflow.com/a/27956812
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/42219636
score: 15
has title: Splitting up class definition in ES 6 / Harmony
tagged with: ecmascript-6
tagged with: ecmascript-harmony
answer count: 2
has body: Suppose I have a class in one big file like this: export default class { constructor () {} methodA () {} methodB () {} methodC () {} } And I want to break up the class definition so that methodA, methodB, and methodC are each defined in their own separate files. Is this possible?
favorite count: 0
has answer: http://stackoverflow.com/a/42219636

http://stackoverflow.com/comment/44310499
score: 0
comment on: http://stackoverflow.com/q/27957535
has text: allCategories contains the search results which contains (I think - I'm a newbie and allCategories is my first query ever) an array of objects that are one word strings from the primary column of the bizCategories collection.
type: Comment
type: QuestionComment

asp.net-mvc
tags question: http://stackoverflow.com/q/27943496
tags question: http://stackoverflow.com/q/27815304
tags question: http://stackoverflow.com/q/27815825
tags question: http://stackoverflow.com/q/27851166
tags question: http://stackoverflow.com/q/27805947
tags question: http://stackoverflow.com/q/27899984
tags question: http://stackoverflow.com/q/27871123
tags question: http://stackoverflow.com/q/27852078
tags question: http://stackoverflow.com/q/27925586
tags question: http://stackoverflow.com/q/27911040
tags question: http://stackoverflow.com/q/27921256
tags question: http://stackoverflow.com/q/27907745
tags question: http://stackoverflow.com/q/27880682
tags question: http://stackoverflow.com/q/27916805
tags question: http://stackoverflow.com/q/27903271
tags question: http://stackoverflow.com/q/27902171
tags question: http://stackoverflow.com/q/27942746
tags question: http://stackoverflow.com/q/27917255
tags question: http://stackoverflow.com/q/27864158
tags question: http://stackoverflow.com/q/27892441
tags question: http://stackoverflow.com/q/27871932
tags question: http://stackoverflow.com/q/27857338
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/27823283
tags question: http://stackoverflow.com/q/27862823
tags question: http://stackoverflow.com/q/27863350
tags question: http://stackoverflow.com/q/27963201
tags question: http://stackoverflow.com/q/27847410
tags question: http://stackoverflow.com/q/27825039
tags question: http://stackoverflow.com/q/27850253
tags question: http://stackoverflow.com/q/27959510
tags question: http://stackoverflow.com/q/27844446
tags question: http://stackoverflow.com/q/27929647
tags question: http://stackoverflow.com/q/27938415
tags question: http://stackoverflow.com/q/27881235
tags question: http://stackoverflow.com/q/27885702
tags question: http://stackoverflow.com/q/27826598
tags question: http://stackoverflow.com/q/27829340
type: Tag
tags question: http://stackoverflow.com/q/27857696
tags question: http://stackoverflow.com/q/27932544
tags question: http://stackoverflow.com/q/27945632
tags question: http://stackoverflow.com/q/27938447
tags question: http://stackoverflow.com/q/27844729

http://stackoverflow.com/a/27949587
has comment: http://stackoverflow.com/comment/44294791
has comment: http://stackoverflow.com/comment/44311812
has comment: http://stackoverflow.com/comment/44294754
has comment: http://stackoverflow.com/comment/44311586
has comment: http://stackoverflow.com/comment/44314239
answers question: http://stackoverflow.com/q/27948739
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44313650
has comment: http://stackoverflow.com/comment/44311397
type: Answer
has comment: http://stackoverflow.com/comment/44311496
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27948739
has body: In a parent controller, add the following: $scope.isHome = function(){ return $state.is("home"); } Then change your template like this: Check this plunkr here to see some live code. Another method would be using $stateChangeSuccess, something like this: $scope.$on("$stateChangeSuccess", function(event, toState){ $scope.isHome = (toState.name == "home") }) I also recommend checking out $state.includes, $state.current and others. Just get through the documentation here
score: 3

http://stackoverflow.com/q/27884028
favorite count: 0
accepted answer: http://stackoverflow.com/a/27884098
upvote count: 1
tagged with: design-patterns
tagged with: unit-testing
type: AnsweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/27884098
has body: Overview I've been using the Revealing Module Pattern for a few months and I'm looking for an alternative or variation on this pattern that will solve both issues I'm currently having with event handlers and testability. I know I could come up with some combination of what I have below to solve my problem, but I'm hoping to find a clean alternative that I could use consistently that addresses both of my current concerns. Revealing Module Pattern So in this example, I have no issues with event handlers, but I can't mock calls to functions within functions to test in isolation: var Lion = (function () { // Reference to rawr works as expected when the click event is triggered function watch() { document.addEventListener('click', rawr); } function rawr() { console.log('rawr'); } function attack() { console.log('attack'); } /* * Can't test goCrazy() in isolation. Mocking rawr() and attack() * has no effect as demonstrated below. */ function goCrazy() { rawr(); attack(); // Important "crazy" logic } return { watch: watch, rawr: rawr, attack: attack, goCrazy: goCrazy }; }()); module.exports = Lion; Example Test Case (Jasmine) describe('Mock Check', function () { it('should mock rawr() and attack() and test only goCrazy logic', function () { var lion = require('Lion'); spyOn(lion, 'rawr').and.reutrnValue(true); spyOn(lion, 'attack').and.reutrnValue(true); var crazy = lion.goCrazy(); expect(lion.rawr).toHaveBeenCalled(); // &lt;-- Fails expect(lion.attack).toHaveBeenCalled(); // &lt;-- Fails // can't test goCrazy() logic in isolation :( }); }); Same Module using this instead and invoked using new In this example, I can successfully mock calls to functions within functions, but if I attempt to add an event handler, this becomes undefined when the event is triggered. var Lion = function () { // Reference to 'this' becomes undefined when event is triggered this.watch = function () { document.addEventListener('click', this.rawr); } this.rawr = function () { console.log('rawr'); …
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44169828
tagged with: javascript
tagged with: jasmine
has comment: http://stackoverflow.com/comment/44169747
has title: Revealing Module Alternative or Variation for Testing

http://stackoverflow.com/comment/44240258
type: QuestionComment
has text: You didn't add any code, bud.
type: Comment
score: 2
comment on: http://stackoverflow.com/q/27921528

http://stackoverflow.com/q/27904740
possible better answer: http://stackoverflow.com/a/27904915
has answer: http://stackoverflow.com/a/27904915
type: AnsweredQuestion
has title: Add angular field validation dynamically
has answer: http://stackoverflow.com/a/27905457
type: Question
tagged with: javascript
score: 0
answer count: 2
tagged with: validation
accepted answer: http://stackoverflow.com/a/27905457
tagged with: angularjs
has body: I am trying to create form builder application in Angular.js and I got stuck on validating fields. Angular provides great validation but one thing is missing for my usecase, and that is turning various validation on / off dynamically. I want to let my user add new form fields and then specify a validation (Angular default minlength, maxlength, ...) for each field alone. Lets say that I want to create a button, that will add / remove minlength validation on a specified field (fields are stored in my model and are displayed through custom form and field directives), how should I do this? I created a simple Plunker - http://plnkr.co/edit/pCXgwgnNbZkcAcl263JN?p=preview can you tell me what shoud be inside the toggleValidation() function? HTML Name Validation error. Toggle minlength validation JS validationApp.controller('mainController', function($scope) { $scope.toggleValidation = function() { // ??? } });

http://stackoverflow.com/q/27952162
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27952891
upvote count: 5
has comment: http://stackoverflow.com/comment/44301576
has comment: http://stackoverflow.com/comment/44299736
has body: I have a bootstrap modal set up but I populate it with data retrieved via the jQuery ajax function. If the modal is opened using the following code, then it opens fine, and is scrollable. &lt;button type="button" class="btn btn-warning btn-xs" data-toggle="modal" data-target="#editContact"&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt;&lt;/button&gt; However, as I populate it with data, I call a JavaScript function to do the ajax call, and populate it with the data. The function is called on button click, like so: &lt;button type="button" class="btn btn-warning btn-xs" onclick="open_contact(2);"&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt;&lt;/button&gt; Which calls the follow JavaScript function: function open_contact(id) { $.post("contacts/get", { // Posts relevant details to show the right content }, function(data, status) { // Code here to check for valid response etc $('#editContact').modal('show'); }); } This JavaScript works fine - it throws no error and it retrieves the data fine. It also opens the modal fine. However, when the modal is opened with the JavaScript rather than with the first button (with the data-target), the whole browser window scrolls rather than just the modal. For reference, the modal opening tags: &lt;div class="modal fade" id="editContact" tabindex="-1" role="dialog" aria-labelledby="editContact" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; Does anyone have any suggestions please? Edit I should just clarify that my issue isn't the fact that I don't have scroll bars. The issue I'm having is when I scroll using the mouse wheel for example, the page behind the modal will scroll, but the modal doesn't move. Therefore, any text hidden from view in the modal, never comes into view.
has title: Bootstrap Modal not scrollable when opened with jQuery
favorite count: 0
downvote count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44301423
has comment: http://stackoverflow.com/comment/44301514
type: Question
has comment: http://stackoverflow.com/comment/44301536
has comment: http://stackoverflow.com/comment/44310028
has comment: http://stackoverflow.com/comment/44301484
has comment: http://stackoverflow.com/comment/44299916
has comment: http://stackoverflow.com/comment/44300277
score: 5
has comment: http://stackoverflow.com/comment/44301561
answer count: 1

http://stackoverflow.com/q/27861003
favorite count: 0
has answer: http://stackoverflow.com/a/27861150
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/44124589
has title: Angular Js RouteProvider
accepted answer: http://stackoverflow.com/a/29507039
answer count: 3
upvote count: 1
tagged with: javascript
has body: I am using $routeProvider service in my angular js but problem is on templateURl it provides me error from server here is the error what i received Failed to load resource: the server responded with a status of 500 (Internal Server Error) angular.js:11594 Error: [$compile:tpload] Failed to load template: /Testing/TestCompleted and here is my angular code for app.js var app = angular.module('app', ['ngRoute']); app.controller('CreateController', CreateController); app.config(function ($routeProvider) { $routeProvider .when('/', { templateUrl: "/Testing/TestCompleted", controller:"AppCtrl" }) }); app.controller("AppCtrl",function ($scope) { $scope.newmodel = { } });
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27861463
downvote count: 0
has answer: http://stackoverflow.com/a/29507039
has comment: http://stackoverflow.com/comment/44124876
score: 1
possible better answer: http://stackoverflow.com/a/27861150

http://stackoverflow.com/q/27869879
accepted answer: http://stackoverflow.com/a/27870239
score: 0
possible better answer: http://stackoverflow.com/a/27869953
has answer: http://stackoverflow.com/a/27869953
has answer: http://stackoverflow.com/a/27870645
answer count: 5
has answer: http://stackoverflow.com/a/27869961
has comment: http://stackoverflow.com/comment/44142204
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27870239
has comment: http://stackoverflow.com/comment/44142221
has title: jQuery height doesn't equal scrollTop
type: Question
has body: In my jquery I am trying to calculate when the scrollbar is 100px from the bottom, and when it gets there I will do an ajax query (for now I am doing an alert as you can see). $(document).on("scroll", function(e){ var scrollHeight = $(document).height(); var offset = $(document).scrollTop(); console.log(scrollHeight); console.log(offset); if(scrollHeight - offset &lt;= 100){ alert("here"); } }); For some reason that I can not figure out it doesn't work. If I scroll to the bottom I would assume that the height() would equal scrollTop() but it doesn't, and here is what it shows: scrollHeight = 1923 offset = 998 Am I using the wrong methods for this?
linked to: http://stackoverflow.com/q/3898130
has answer: http://stackoverflow.com/a/27869962
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44026882
has text: I feel like the problem now is something that isn't shown like you are using the wrong helper in the html or something. Is there a repo we can look at?
type: AnswerComment
comment on: http://stackoverflow.com/a/27806359
score: 0
type: Comment

http://stackoverflow.com/q/27902910
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44240571
tagged with: qml
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44205558
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27921928
has comment: http://stackoverflow.com/comment/44209259
answer count: 1
has title: Access to Javascript array elements from ListModel in QML
has body: I've some javascript data containing a list of objects which contains other objects and arrays, and append that to a ListModel. Such as (assume that the data is generated elsewhere and I would like to avoid its structure): import QtQuick 2.0 Rectangle { width: 600 height: 300 ListView { anchors.fill: parent model: ListModel { id: listModel } delegate: Text { text: 'key: '+ key + ', subdict["subkey1"]: ' + subdict.subkey1 + ', sublist.count: '+ sublist.count + ', sublist[0]: '+ sublist[0] + ', sublist.get(0): '+ sublist.get(0) wrapMode: Text.WordWrap width: parent.width color: index % 2 == 0 ? "darkgreen" : "brown" } Component.onCompleted: { var values = [ {'key': 'foo1', 'subdict': {'subkey1': 'subfoo1', 'subkey2': 'subbar1'}, 'sublist': ['subvalue1', 'subvalue2']}, {'key': 'foo2', 'subdict': {'subkey1': 'subfoo2', 'subkey2': 'subbar2'}, 'sublist': ['subvalue3', 'subvalue4', 'subvalue5']}, {'key': 'foo3', 'subdict': {'subkey1': 'subfoo3', 'subkey2': 'subbar4'}, 'sublist': []} ] for (var i in values) listModel.append(values[i]); } } } Most parts work well, but I can't find a way to access to the sublist elements. All I can get is the count of them as they're actually a new ListModel, but since I can't use something such as sublist.get(0) it's seems impossible to get the actual content. Is this a bug, or am I missing something?
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/27921928

http://stackoverflow.com/comment/44281517
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27941549
has text: @AvinashRaj as you probably know it's not always easy or obvious which answer to accept like in this case. I picked @TimPietzcker's answer because although it isn't perfect (like you've said it matches too many cases) it explains the trick to match only one `+` before a word. After all I mixed his and @hsz's answer with my own pattern and solved it. We need another option like _partial answer_ ;-)

http://stackoverflow.com/q/27863114
type: AnsweredQuestion
upvote count: 2
tagged with: cookies
tagged with: http-redirect
type: Question
accepted answer: http://stackoverflow.com/a/27907055
has body: I'll try to explain it as easy as possible. Replication: I'm doing an auth/login system where: The user input him credentials and send the data to the server [classic form]. The server check everything and then (if it's ok) set up a session in the server and response an static view which is rendered using handlebars and by passing one variable: sessionName. This view includes a js snipet which add a cookie using the code below: document.cookie += ';session_name={{ sessionName }}'. At this moment, all is still correct. And the cookie is added correctly. And then it redirects to the root of the website. At this point, I expect to have the cookie I set before. But there's not. Relevant data: The variable sessionName is compiled properly. The Analytics [Mixpanel and Google Analytics] cookies are persistent. I tested in Chrome 39 and Firefox Developers Edition using Mac OSX Yosemite. The server uses node.js and hapi.js of Wallmart Labs with the hapi.js plugin hapi-auth-cookie I also tested to set the cookie manually but it doesn't persists neither. Any kind of the ones that I use. The cookie is a simple string; accurately: hubato so: ;session_name=huabto. TL;DR My cookies doesn't persist when navigating. Regardless how or what I set in the cookie.
has comment: http://stackoverflow.com/comment/44129397
tagged with: javascript
has comment: http://stackoverflow.com/comment/44129218
has comment: http://stackoverflow.com/comment/44131693
has comment: http://stackoverflow.com/comment/44130145
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44131107
tagged with: persistence
has comment: http://stackoverflow.com/comment/44213094
favorite count: 0
has title: My cookie disappears
has comment: http://stackoverflow.com/comment/44131502
has answer: http://stackoverflow.com/a/27907055
has comment: http://stackoverflow.com/comment/44131147
has comment: http://stackoverflow.com/comment/44129312
tagged with: node.js
score: 2

http://stackoverflow.com/comment/44306681
type: QuestionComment
comment on: http://stackoverflow.com/q/27955881
score: 1
type: Comment
has text: You can use CSS Media Queries to control the display of the elements on the page based on screen size. https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

http://stackoverflow.com/comment/44187642
has text: I tried using this and was very quirksome to implement, trying to keep my website plugin free as it slows it down. If needs be, will go back to it
score: 0
comment on: http://stackoverflow.com/a/27893158
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44058298
type: QuestionComment
comment on: http://stackoverflow.com/q/27825845
type: Comment
has text: Could it be the combination of the setTimeout functions going on below?
score: 0

http://stackoverflow.com/comment/133031983
type: Comment
type: QuestionComment
has text: @karthickkannan
score: 0
comment on: http://stackoverflow.com/q/27854289

http://stackoverflow.com/comment/44251938
comment on: http://stackoverflow.com/a/27927313
has text: Yes sorry for that i changed it to setInterval
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27936464
score: 0
has body: I would suggest to expose this property as polymer attribute and then access that from outside using setAttribute window.addEventListener('polymer-ready', function() { var app = document.querySelector('#app'); app.setAttribute('chapters',[{id: one, label: one}, {id: two, label: two}]); });
type: Answer
answers question: http://stackoverflow.com/q/27924745

http://stackoverflow.com/a/27888622
score: 4
accepted answer of: http://stackoverflow.com/q/27888611
has comment: http://stackoverflow.com/comment/60929757
type: Answer
answers question: http://stackoverflow.com/q/27888611
upvote count: 4
has body: You should use querySelectorAll for such things: document.querySelectorAll('#topbarsection &gt; li &gt; a');
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44104383
type: QuestionComment
has text: also check it here: https://github.com/JimLiu/angular-ui-tree/issues/320
comment on: http://stackoverflow.com/q/27825770
score: 0
type: Comment

http://stackoverflow.com/comment/44018987
type: QuestionComment
has text: "Its worked and nothing wrong, i got the result i want but i want", ok, so that's certainly one definition of "correct".
type: Comment
comment on: http://stackoverflow.com/q/27804902
score: 0

http://stackoverflow.com/comment/44026453
has text: The html, css, and javascript. Create your own html file. Run it in your local machine. You'll need to download the jquery or link to it.
type: Comment
comment on: http://stackoverflow.com/a/27807878
score: 0
type: AnswerComment

http://stackoverflow.com/a/27903630
answers question: http://stackoverflow.com/q/27888617
has comment: http://stackoverflow.com/comment/44241562
has comment: http://stackoverflow.com/comment/44225452
upvote count: 1
has comment: http://stackoverflow.com/comment/44242710
has comment: http://stackoverflow.com/comment/44225432
score: 1
has body: Ok have a look at this code below, here were are just using a local fixed data source but in your example you would point this at your c_places.php with an appropriate proxy. Since in the example there data source is fixed it is always returning the same data but in your instance you'd have to check for the typed value. Ext.application({ name: 'Fiddle', launch: function() { addressModel = Ext.define("Addresses", { extend: 'Ext.data.Model', proxy: { type: 'jsonp', url: 'https://jsonp.nodejitsu.com', reader: { type: 'json', root: 'results', totalProperty: 'totalCount' } }, fields: ['formatted_address'] }); var ds = Ext.create('Ext.data.Store', { model: 'Addresses' }); var panel = Ext.create('Ext.panel.Panel', { renderTo: Ext.getBody(), title: 'Search the Addresses', width: 600, bodyPadding: 10, layout: 'anchor', items: [{ xtype: 'combo', store: ds, displayField: 'title', typeAhead: false, hideLabel: true, hideTrigger: true, anchor: '100%', enableKeyEvents: true, listConfig: { loadingText: 'Searching...', emptyText: 'No matching posts found.', // Custom rendering template for each item getInnerTpl: function() { return '&lt;div class="search-item"&gt;{formatted_address}&lt;/div&gt;'; } }, // override default onSelect to do redirect listeners: { select: function(combo, selection) { var address = selection[0]; if (address) { alert('you picked ' + address.data.formatted_address); } }, keyup: function(combo) { queryString = combo.getValue(); console.log(queryString); console.log(addressModel); addressModel.getProxy().setExtraParam('url', 'http://maps.google.com/maps/api/geocode/json?address=' + queryString + '&amp;sensor=false'); } } }, { xtype: 'component', style: 'margin-top:10px', html: 'Live search requires a minimum of 4 characters.' }] }); } }); Demo: https://fiddle.sencha.com/#fiddle/g70
has comment: http://stackoverflow.com/comment/44235901
has comment: http://stackoverflow.com/comment/44242014
has comment: http://stackoverflow.com/comment/44242538
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27888617
has comment: http://stackoverflow.com/comment/44235712
type: Answer

http://stackoverflow.com/comment/44322225
type: QuestionComment
comment on: http://stackoverflow.com/q/27951843
has text: ...but I would be using JavaScript to create the message and whatever else was needed to interface with some unknown solution. I've hunted high and low myself for a solution. I did not ask anyone else to look for me, I asked if someone had an approach that I had not thought of.
score: 0
type: Comment

http://stackoverflow.com/q/27962419
answer count: 1
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
score: 2
tagged with: google-chrome-extension
downvote count: 0
has answer: http://stackoverflow.com/a/27962587
favorite count: 0
type: Question
has body: I have a Google Chrome extension with a popup.html page. The only script that starts when the page loads is: document.addEventListener('DOMContentLoaded', function () { window.domain = ""; chrome.tabs.getSelected(function (tabs) { window.domain = tabs.url; console.log(window.domain); }); window.enabled = true; domain = window.domain; checkStatus(); }); the function checkStatus is: function checkStatus() { if (enabled === true) { $(".status").html("Enabled"); $(".statusContainer").css("background-color", "rgb(24, 150, 71)"); $(".powerButton").attr("src", "images/enabled.png"); $(".questionContainer").show("fast"); $(".domain").html("on " + window.domain); } else if (enabled === false){ $(".status").html("Disabled"); $(".statusContainer").css("background-color", "rgb(102, 102, 102)"); $(".powerButton").attr("src", "images/disabled.png"); $(".questionContainer").hide("fast"); } } however, when I click on the extension's icon to open the page, I only see "on " instead of "on google.com," for example. When I inspect popup and switch to console and run checkStatus again, however, the extension shows "on google.com," if I am on google, for example. I'm not sure what is causing this, but the console.log shows the url as it should, so I think it's a problem with the checkStatus function, since the tab is loaded when I open the popup.
upvote count: 2
accepted answer: http://stackoverflow.com/a/27962587
has title: Chrome Extension won't get URL on the first try

http://stackoverflow.com/comment/44256125
type: Comment
type: QuestionComment
has text: Okey, I see. First problem with $this. It was taken from documentation so I didn't think it can be wrong.
comment on: http://stackoverflow.com/q/27928836
score: 0

http://stackoverflow.com/comment/44075792
type: Comment
comment on: http://stackoverflow.com/a/27835449
score: 0
type: AnswerComment
has text: @user3766722 Yes, you can use a meta redirect. It's going to be tough getting the username in though.

http://stackoverflow.com/comment/44079171
type: QuestionComment
comment on: http://stackoverflow.com/q/27837289
has text: did you tried printing FacesContext instance and FacesContext.getCurrentInstance()?
score: 0
type: Comment

http://stackoverflow.com/q/27889302
has answer: http://stackoverflow.com/a/27889435
tagged with: ruby
has comment: http://stackoverflow.com/comment/44179599
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/27889486
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44179690
has comment: http://stackoverflow.com/comment/44179631
has title: javascript not executing on rails edit page
has body: I've run into something interesting that I don't quite understand. When using a standard rails scaffold for a model, I navigate to the #edit action by clicking the 'Edit' link (/user/1/edit) and JavaScript doesn't execute. As soon as I refresh this edit page, JavaScript runs as expected. I'm assuming this is some caching mechanism in rails but I can't figure it out. Does anyone have any ideas on this? /Edit In fact, JavaScript doesn't seem to execute on all of the page actions until I do a hard refresh.
type: Question
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27889486
score: 0
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/44179746
possible better answer: http://stackoverflow.com/a/27889435

http://stackoverflow.com/comment/44243863
has text: ​+1 for mentioning `call` and `apply`.
type: AnswerComment
comment on: http://stackoverflow.com/a/27923278
type: Comment
score: 2

http://stackoverflow.com/a/27929201
downvote count: 0
type: AcceptedAnswer
upvote count: 2
has comment: http://stackoverflow.com/comment/44255604
type: Answer
answers question: http://stackoverflow.com/q/27928988
score: 2
accepted answer of: http://stackoverflow.com/q/27928988
has body: you can't do $('*[data-salesforceprojectid="' + focusedProject + '"]').addClass('ui-state-active'); to make the hard coded part into a variable?

http://stackoverflow.com/a/27841184
type: Answer
has body: rather than assigning you need to push that object to the array $scope.result.push($scope.persons[i]);
answers question: http://stackoverflow.com/q/27841081
score: 0

http://stackoverflow.com/comment/44051173
score: 1
has text: I don't see a `return` statement in that `if`. `mytimeout = $timeout(....` will be executed regardless of what happens in that `if`. Also `$timeout.cancel(mytimeout)` won't work either because right after the `if` you are redefining it.
type: Comment
comment on: http://stackoverflow.com/q/27822669
type: QuestionComment

http://stackoverflow.com/a/27877413
type: Answer
answers question: http://stackoverflow.com/q/27877353
has body: How about $('tbody').each(function(){ if ($(this).has("&gt; tr:visible").length === 0){ $(this).closest('table').hide(); } }); It checks for visible trs in the tbody, if there isn't any the table is hidden.
has comment: http://stackoverflow.com/comment/44156832
score: 0

http://stackoverflow.com/comment/44337568
type: QuestionComment
has text: try to use .active not #section1 -> $('.active').fadeOut(); $('.active').next().fadeIn(); make a fiddle from this and i sort this out.
score: 0
comment on: http://stackoverflow.com/q/27883042
type: Comment

http://stackoverflow.com/q/27867608
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27868134
possible better answer: http://stackoverflow.com/a/27867881
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44137905
has comment: http://stackoverflow.com/comment/44137730
has comment: http://stackoverflow.com/comment/44137958
tagged with: jsp
tagged with: javascript
has comment: http://stackoverflow.com/comment/44137774
score: 0
has comment: http://stackoverflow.com/comment/44137719
has answer: http://stackoverflow.com/a/27868134
has body: I've got a hidden value in my jsp: &lt;html:hidden property="user.strRegistered" value="user.strRegistered"/&gt; How can I access it in my js file? I have: var regChk = $('[name="user.strRegistered"]'); alert(regChk); but that doesn't work. I've also tried these two: var regChk = $('user.strRegistered'); alert($('#user.strRegistered').val()); but they both come up as undefined. The value in the html is correct though, and when I look, it shows: &lt;input type="hidden" name="user.strRegistered" value="yes"&gt;
has answer: http://stackoverflow.com/a/27867881
has title: accessing hidden value in javascript

http://stackoverflow.com/q/27957726
has body: I'm trying to build an chrome extension similar to the chromecast one. I am using chrome.tabCapture to successfully start a audio/video stream. How do I stop the screen capture? I want to have a stop button, but I am not sure what to call to stop it. I can stop the LocalMediaStream, but the tab is still capturing and does not allow me to start a new capture without closing the tab. Any suggestions or maybe an api page I may have missed?
answer count: 1
downvote count: 0
tagged with: webrtc
favorite count: 0
tagged with: google-chrome-extension
upvote count: 6
linked to: http://stackoverflow.com/q/34715357
has comment: http://stackoverflow.com/comment/44312371
type: UnansweredQuestion
score: 6
tagged with: chromecast
has comment: http://stackoverflow.com/comment/44315519
tagged with: google-chrome
has answer: http://stackoverflow.com/a/34718954
has title: How to stop chrome from capturing a tab?
tagged with: javascript
has comment: http://stackoverflow.com/comment/57178052
type: Question

http://stackoverflow.com/a/27878770
type: Answer
accepted answer of: http://stackoverflow.com/q/27878431
answers question: http://stackoverflow.com/q/27878431
has body: I had the same problem using your code on jfiddle. Some of your code is off. Bootstrap, by default is supposed to do what you want it to do - the collapsed should be coming down under the logo. You just left off the navbar-header div surrounding the buttons and brand.. see below: LOGO HERE HOME PAGE 1 PAGE 2 PAGE 3 PAGE 4 PAGE 5
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/40786044
answers question: http://stackoverflow.com/q/27865483
score: 0
has body: Helper function for setting initial/default location programmatically - e.g. from geolocation API. var triggerLocation = function(autocompleteInput, addressString) { var $locationInput = $(autocompleteInput).val(addressString).trigger('focus'); var maxTries = 500; var autocompleteSelectionInterval = setInterval(function() { if (!--maxTries) { clearInterval(autocompleteSelectionInterval); } if ($('.pac-container .pac-item').length) { google.maps.event.trigger($locationInput[0], 'keydown', { keyCode : 40 }); google.maps.event.trigger($locationInput[0], 'keydown', { keyCode : 13 }); clearInterval(autocompleteSelectionInterval); } }, 10); }; Example: var autocomplete = new google.maps.places.Autocomplete($('#location')[0]); triggerLocation('#location', 'New York');
type: Answer

http://stackoverflow.com/q/27853281
accepted answer: http://stackoverflow.com/a/27853310
has body: Using JQuery I'm trying to create a drop-down menu and then change a certain value on a search input element based on what people select in the menu. So far I've figured out how to target the value I need to change. I've also gotten as far as having it so that if someone makes any selection from the menu, it changes the search input value to one specific value: Select A Color Blue Red Yellow What I need now is something that sets the value according to the menu selection, matched up something like this: Blue = 9999 Red = 8888 Yellow = 7777 I'm still looking at examples and will keep trying, but kind of stuck. Any advice appreciated.
has comment: http://stackoverflow.com/comment/44110648
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44110549
tagged with: javascript
has title: JQuery to change value based on selection in a drop down menu
has comment: http://stackoverflow.com/comment/44110620
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44110583
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27853310

http://stackoverflow.com/comment/44267481
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27934397
has text: Try "tempData/tweet_example.tsv"

http://stackoverflow.com/comment/44215597
type: Comment
comment on: http://stackoverflow.com/a/27852845
score: 0
type: AnswerComment
has text: Back now after being gone for the weekend. vm.$watch() generates the error Error: vm.$watch is not a function, but $scope.$watch() makes no errors. countrySelected generates not defined, but vm.countrySelected works. The function definition for hideStateSelector() (your checkState) inherits variables from above so an arguement in hideStateSelector() generates errors. When I make those changes, I get no Console errors and pages load correctly, but State input does not hide when I click on the AI country (Anguilla) in the select dropdown.

http://stackoverflow.com/comment/44156158
score: 0
has text: @pld32 ok, that looks like big project, can you point out where it is not being used ?
type: AnswerComment
comment on: http://stackoverflow.com/a/27833104
type: Comment

http://stackoverflow.com/comment/44158848
score: 0
type: Comment
type: QuestionComment
has text: I found examples to use data.targetScope.gridId, but whats that? it returns ng1420908599317
comment on: http://stackoverflow.com/q/27876162

http://stackoverflow.com/comment/44265406
comment on: http://stackoverflow.com/q/27929650
has text: So usemin prepare is not finding any blocks to process. What does the entire file/folder structure look like (`tree` is your friend here)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27936263
has comment: http://stackoverflow.com/comment/44270144
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44270270
has body: try this.. $('.show-popup').hover(function(event){ event.preventDefault(); // disable normal link function so that it doesn't refresh the page var docHeight = $(document).height(); //grab the height of the page var scrollTop = $(window).scrollTop(); //grab the px value from the top of the page to where &gt;you're scrolling var selectedPopup = $(this).data('showpopup'); //get the corresponding popup to show $('.overlay-bg').show().css({ 'height' : docHeight }); //display your popup background and set &gt;height to the page height $('.popup' + selectedPopup).show().css({ 'top': scrollTop + 20 + 'px' }); //show the appropriate popup &gt;and set the content 20px from the window top $('.show-popup').unbind('mouseenter mouseleave'); //unbind the event handler }
accepted answer of: http://stackoverflow.com/q/27936229
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44270048
answers question: http://stackoverflow.com/q/27936229
type: AcceptedAnswer

http://stackoverflow.com/a/27853360
score: 1
has body: You cannot change the text of the buttons if you are using the msls.ShowMessageBox API. The recommended approach in LightSwitch would be to use a Popup. Creating a Popup Screen in LightSwitch
answers question: http://stackoverflow.com/q/27844527
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27844527
type: AcceptedAnswer
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44213484
type: AnswerComment
has text: Let me try this .. THanks. :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27906711

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/27803734
tags question: http://stackoverflow.com/q/27906901
type: Tag
tags question: http://stackoverflow.com/q/27843499
tags question: http://stackoverflow.com/q/27809350
tags question: http://stackoverflow.com/q/27846057

http://stackoverflow.com/comment/44104789
type: QuestionComment
score: 1
has text: show your current regex. but you probably need to escape the characters `\(` and `\)`.
comment on: http://stackoverflow.com/q/27850355
type: Comment

http://stackoverflow.com/a/27897705
type: Answer
has body: Finally I got the answer.. document.head.insertBefore(style, document.head.children[0]); I should just insert the dynamic stylesheet above already present stylesheets in the head tag. Working Fiddle Unfortunately, this is not working in any IE version. I am still looking for answer.
score: 0
answers question: http://stackoverflow.com/q/27897592

http://stackoverflow.com/q/27855670
type: AnsweredQuestion
tagged with: onclick
upvote count: 1
tagged with: forms
type: Question
accepted answer: http://stackoverflow.com/a/27855761
tagged with: javascript
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
has title: Exclude form button from 'onblur' event, JavaScript
favorite count: 0
tagged with: onblur
has comment: http://stackoverflow.com/comment/44114770
has answer: http://stackoverflow.com/a/27855761
has body: I have a form that uses onblur for most of the input fields, like follows: Submit The form validates certain fields (i.e. username, email) in real time via the onblur events, but the same check happens when the user clicks the submit button. Currently, when the user clicks the submit button, the onblur event is first triggered, and then the onclick event from the button is triggered - thus running the check twice and wasting a couple extra seconds. Is there any way to override the onblur method to exclude the blur that happens when the user presses the submit button? I was thinking a simple if(/*button is clicked*/){} within myFunction(), but I wouldn't know how to check for the button click. And it seems, based on the current performance, that the button click is not even registered until after the blur. Thanks in advance.
has comment: http://stackoverflow.com/comment/44114889

http://stackoverflow.com/comment/44132847
type: QuestionComment
comment on: http://stackoverflow.com/q/27854409
score: 0
has text: I'd suggest reading the specification for these methods, http://www.w3.org/TR/dom/#dom-document-createelement, to understand how they work.
type: Comment

http://stackoverflow.com/a/27938511
answers question: http://stackoverflow.com/q/27938415
upvote count: 15
has comment: http://stackoverflow.com/comment/62158236
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44273828
type: Answer
has body: Its simple, just add one more character class at the begining ^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&amp;*()_+])[A-Za-z\d][A-Za-z\d!@#$%^&amp;*()_+]{7,19}$ [A-Za-z\d] Ensures that the first character is an alphabet or digit. [A-Za-z\d!@#$%^&amp;*()_+]{7,19} will match minimum 7 maximum 19 character. This is required as he presceding character class would consume a single character making the total number of characters in the string as minimum 8 and maximum 20. $ Anchors the regex at the end of the string. Ensures that there is nothing following our valid password Regex Demo var pattern = new RegExp(/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&amp;*()_+])[A-Za-z\d][A-Za-z\d!@#$%^&amp;*()_+]{7,19}$/); console.log(pattern.test("!@#123asdf!@#")); console.log(pattern.test("123asdf!@#")); console.log(pattern.test("12as#"));
has comment: http://stackoverflow.com/comment/44274048
accepted answer of: http://stackoverflow.com/q/27938415
score: 15

http://stackoverflow.com/comment/44131753
type: Comment
has text: Please show some effort before posting an question :)
type: QuestionComment
comment on: http://stackoverflow.com/q/27864228
score: 0

http://stackoverflow.com/q/27919431
has comment: http://stackoverflow.com/comment/44249595
tagged with: javascript
has body: We are developing an application where we have AngularJS as Front-end and on Back-end we have Spring framework with hibernate, Rest web services etc. We are planning to use Gradle build for back-end but I am not sure that Gradle can be used for building AngularJS (compiling, minifying etc.). I did find JS and CSS plugins of Gradle but I dont know how much Gradle supports AngularJS (injection minification etc.) We want to use a single build for both Front-end and Back-end. Please suggest what is the best way to achieve that with these technologies. Thanks in Advance.
downvote count: 0
answer count: 1
tagged with: build.gradle
has title: Best build tool for AngularJS frontend and Spring Framework backend
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
tagged with: spring
score: 2
has answer: http://stackoverflow.com/a/27925980
tagged with: gradle
type: Question
linked to: http://stackoverflow.com/q/25001857

http://stackoverflow.com/comment/44186476
type: QuestionComment
comment on: http://stackoverflow.com/q/27818200
has text: @nit, this doesn't work for me.. When using the mousewheel over the overflow element, the mousewheel propagate to the body :-/
score: 0
type: Comment

http://stackoverflow.com/comment/44772265
has text: Glad you got something working Zack. This code is actually used to chase text and images with a tool palette, similar to working with text or graphics in MSOffice. Let me know if there's anything I can do to make the code a bit more understandable. You can see the text tools in this Screenshot: http://shineemc.com/samples/shine.png
comment on: http://stackoverflow.com/a/28050226
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27836761
has answer: http://stackoverflow.com/a/27836902
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27866124
type: Question
answer count: 2
tagged with: javascript
has body: I have piechart.html and a barchart.html and I've included them in another html.Both charts are getting overlapped with each other.I have used svg in both pie and bar.I think this is the issue .How can I solve this problem My pie code: =========== var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .append("g") .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); My Bar code: ========== var svg = d3.select("body").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 + ")"); Thanks in advance
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: How to get all d3.js charts on one page

http://stackoverflow.com/q/27909565
tagged with: css
has comment: http://stackoverflow.com/comment/44220618
has comment: http://stackoverflow.com/comment/44219408
has comment: http://stackoverflow.com/comment/44221940
type: UnansweredQuestion
has body: I have a web page that is not responsive except the navigation menu, which is made to be tablet and mobile friendly. When i load the page on the phone, this one is not completely visible horizontally (60% of the the width is visible let's say), which is fine at this point of the project. But still i want to have the mobile menu always placed on the top right of the visible portion of the page. Right now the menu is placed top right relatively to the complete width of the page. How to realize this easily ? ( Jquery or simply CSS ) Thanks!
has comment: http://stackoverflow.com/comment/44218840
type: Question
tagged with: responsive-design
has comment: http://stackoverflow.com/comment/44221925
has answer: http://stackoverflow.com/a/27909634
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: How to fix a menu on top right of the visible portion of the web page
has comment: http://stackoverflow.com/comment/44218722
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27880076
has comment: http://stackoverflow.com/comment/44162692
type: Answer
has comment: http://stackoverflow.com/comment/44162458
has body: How about instead of restricting the users, just fix their input? would be much more convenient for both sides i believe: var names = ["KlAs-","KLaS-bE$@rtIl-banana","Fre-Dr-IckP-aTrick","Klas","Klas-Bertil","Fredrick-Patrick"] function FixName(name){ //remove all special characters from the name name = name.replace(/[^a-zA-Z0-9_-]/g,''); //check for hyphens and only get 1 of those, takes 2 name parts. var name_parts = name.split('-',2); //fix the first name part var Fixed_Name=(name_parts[0].charAt(0).toUpperCase() + name_parts[0].slice(1).toLowerCase()).trim(); //check if there is anything after the hyphen, and fix it too. if(name_parts[1].trim()!=""){ Fixed_Name+="-"+(name_parts[1].charAt(0).toUpperCase() + name_parts[1].slice(1).toLowerCase()).trim(); } alert(Fixed_Name); } FixName(names[1]);
has comment: http://stackoverflow.com/comment/44162408
score: 0
answers question: http://stackoverflow.com/q/27879664
has comment: http://stackoverflow.com/comment/44162744

http://stackoverflow.com/a/75624670
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27826998
has body: Encryption is the easy part, it can be done with any other API available to the web, like the Web Crypto API. The issue is that there's no way to safely persist the encryption key or passcode locally. Alternatives include: your own server-based authenticated API to remotely store and retrieve this key have the user enter a passcode at some point and just keep it in memory (for example using the chrome.storage.session API), but lose it when the browser is closed. These two methods are used by password managers and cryptocurrency wallets for example.

http://stackoverflow.com/comment/44033276
comment on: http://stackoverflow.com/q/27812187
score: 0
type: Comment
type: QuestionComment
has text: Pass values into what? I'm a little confused here. If you want to pass a value from PHP into a JavaScript function then just `echo` your function call with a value: `<?php echo " "; ?>`

http://stackoverflow.com/comment/44182269
type: AnswerComment
comment on: http://stackoverflow.com/a/27890215
score: 1
type: Comment
has text: @Count your regex does not match numbers like this `10`, I've changed regex to match numbers like these `10`, `10.10`, `10,10`.

http://stackoverflow.com/a/27909519
has comment: http://stackoverflow.com/comment/130050636
has comment: http://stackoverflow.com/comment/44219548
has comment: http://stackoverflow.com/comment/44219611
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27909392
has comment: http://stackoverflow.com/comment/44218815
has comment: http://stackoverflow.com/comment/44218853
has comment: http://stackoverflow.com/comment/44219006
has body: there is color property. states: { hover: { brightness: 0.2, color: '#ffccee' } }
answers question: http://stackoverflow.com/q/27909392
has comment: http://stackoverflow.com/comment/44219343
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44219400

http://stackoverflow.com/q/27883196
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: mocha.js
has comment: http://stackoverflow.com/comment/69644957
has title: Per test mocha results
has body: I have a folder with many mocha tests. test/ ├── api1.test.js └── api2.test.js etc… What I would like to do is run all of the tests at once but keep track of the results per file so I know that api1.test passed:1 and failed:1 while api2.test.js passed:2 and failed:3. The tests are all integration tests and i want to store each api's test results in a database so I can keep track of the "health" of each api. Any suggestions?
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1

http://stackoverflow.com/comment/44047919
type: AnswerComment
has text: Why do you need `displayAmount()` for? And the `array` at the top? Also, this will return a wrong result for 0...
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27820946

express
tags question: http://stackoverflow.com/q/27913766
tags question: http://stackoverflow.com/q/27845221
tags question: http://stackoverflow.com/q/27954834
tags question: http://stackoverflow.com/q/27820414
tags question: http://stackoverflow.com/q/27871309
tags question: http://stackoverflow.com/q/27916349
tags question: http://stackoverflow.com/q/27890182
tags question: http://stackoverflow.com/q/27913722
tags question: http://stackoverflow.com/q/27877590
tags question: http://stackoverflow.com/q/27880276
tags question: http://stackoverflow.com/q/27825155
tags question: http://stackoverflow.com/q/27907357
tags question: http://stackoverflow.com/q/27942658
tags question: http://stackoverflow.com/q/27890811
tags question: http://stackoverflow.com/q/27890619
tags question: http://stackoverflow.com/q/27872452
tags question: http://stackoverflow.com/q/27810409
tags question: http://stackoverflow.com/q/27821770
tags question: http://stackoverflow.com/q/27913112
tags question: http://stackoverflow.com/q/27913929
tags question: http://stackoverflow.com/q/27880249
tags question: http://stackoverflow.com/q/27910409
tags question: http://stackoverflow.com/q/27955055
tags question: http://stackoverflow.com/q/27867045
tags question: http://stackoverflow.com/q/27936368
tags question: http://stackoverflow.com/q/27938544
tags question: http://stackoverflow.com/q/27867428
tags question: http://stackoverflow.com/q/27925705
tags question: http://stackoverflow.com/q/27932640
tags question: http://stackoverflow.com/q/27861722
tags question: http://stackoverflow.com/q/27822495
tags question: http://stackoverflow.com/q/27839872
tags question: http://stackoverflow.com/q/27827337
tags question: http://stackoverflow.com/q/27874418
tags question: http://stackoverflow.com/q/27955121
tags question: http://stackoverflow.com/q/27927351
tags question: http://stackoverflow.com/q/27947396
tag name: express
tags question: http://stackoverflow.com/q/27926523
tags question: http://stackoverflow.com/q/27871611
tags question: http://stackoverflow.com/q/27901149
tags question: http://stackoverflow.com/q/27874750
tags question: http://stackoverflow.com/q/27893431
type: Tag
tags question: http://stackoverflow.com/q/27880171
tags question: http://stackoverflow.com/q/27931495
tags question: http://stackoverflow.com/q/27908973
tags question: http://stackoverflow.com/q/27913313
tags question: http://stackoverflow.com/q/27824859
tags question: http://stackoverflow.com/q/27959060
tags question: http://stackoverflow.com/q/27903747

http://stackoverflow.com/comment/44304945
has text: Sadly, we can't help you if the code you show is working. Try to find the problem by progressively reducing the scope of your research.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27954809
score: 1

http://stackoverflow.com/q/27806447
has comment: http://stackoverflow.com/comment/44022202
has comment: http://stackoverflow.com/comment/44021985
favorite count: 0
has answer: http://stackoverflow.com/a/27806642
type: Question
has body: I have a problem with my code &lt;tr&gt; &lt;td id="&lt;?php echo; $id ?&gt;" onclick="addrow(?php echo $id; ?&gt;)"&gt;...&lt;/td&gt; &lt;/tr&gt; &lt;tr id="&lt;?php echo $id; ?&gt;" class="ndisplay"&gt;...&lt;/tr&gt; &lt;tr id="&lt;?php echo $id; ?&gt;" class="ndisplay"&gt;...&lt;/tr&gt; &lt;tr id="&lt;?php echo $id; ?&gt;" class="ndisplay"&gt;...&lt;/tr&gt; css: .ndisplay { display: none; } JS: function addrow($id) { var id = document.getElementById($id); if (id.hasClass("ndisplay")) { id.removeClass("ndisplay"); } else { id.addClass("ndisplay"); } } That's work but just for the first tr ... The problem it's $id is the same value for each tr but i'm forced to use the same id for each &lt;tr&gt; I have testing with a div between the tr but it doesn't work.
has comment: http://stackoverflow.com/comment/44021901
has answer: http://stackoverflow.com/a/27806668
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27806607
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/44021910
has title: evenment onclick javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44021917
has comment: http://stackoverflow.com/comment/44021988

http://stackoverflow.com/comment/44241138
type: AnswerComment
score: 0
type: Comment
has text: Please don't manually create a non-promises/A+ complaint "then" method. At least wrap the callback call in a setTimeout.
comment on: http://stackoverflow.com/a/27920142

http://stackoverflow.com/comment/44264169
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27932356
score: 2
has text: @sstur did you read the link I posted? I bet Google have written permission from Facebook to do it. And according to https://www.facebook.com/robots.txt Google bot and a few other bots are allowed to scrape Facebook. But it ends with: User-agent: *, Disallow: / . Which means for anyone else it is not allowed

http://stackoverflow.com/comment/44243830
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27922955
has text: Definitely go for option 1!
score: 2

http://stackoverflow.com/comment/44127865
type: Comment
has text: try using a while loop http://www.w3schools.com/js/js_loop_while.asp
comment on: http://stackoverflow.com/q/27862915
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44254996
type: Comment
type: QuestionComment
score: 0
has text: I thin the strongest argument against the `else if` is that it disguises intent. No default `else` implies that it's possible for *neither* branch to fire. If the intent is that exactly one branch always fires, the code should look that way. There should be no edge case possible where both blocks are skipped.
comment on: http://stackoverflow.com/q/27928063

kendo-combobox
tag name: kendo-combobox
tags question: http://stackoverflow.com/q/27933006
type: Tag

http://stackoverflow.com/a/42219636
upvote count: 9
answers question: http://stackoverflow.com/q/27956779
type: Answer
has comment: http://stackoverflow.com/comment/97777949
downvote count: 1
has body: @elclanrs gave a correct answer, but I would modify it to allow for the use of this. I also think this is more readable. import methodOne from 'methodOne' import methodTwo from 'methodTwo' class MyClass { constructor() { this.methodOne = methodOne.bind(this) this.methodTwo = methodTwo.bind(this) } } export default MyClass Tip: although if your class is so large that it warrants being split into multiple files, a better solution might be to split up the class into multiple classes.
score: 8

http://stackoverflow.com/comment/44085238
type: Comment
has text: @Nima all the modern browser can use this `animationend` but others which does not have implemented it there browser or still in development then you can use vendor prefixes like`webkit, moz, o` etc.
type: AnswerComment
comment on: http://stackoverflow.com/a/27840596
score: 0

http://stackoverflow.com/a/76301589
score: 0
has body: Here is an extremely shortened version of the password strength algorithm: document.querySelector(".password").addEventListener("input",ev=&gt;{ const s=ev.target.value; strength=+(s.length&gt;5&amp;&amp;s.length&lt;9&amp;&amp;!/&amp;/.test(s)) &amp;&amp; 1 + // length between 6 and 8 and NO '&amp;' in it ... +(/[a-z]/.test(s)&amp;&amp;/[A-Z]/.test(s)) // lower and upper case letters +(/\d/.test(s)&amp;&amp;/[a-z]/i.test(s)) // letters and numbers +/[!%@#$^*?_~]/.test(s) // at least 1 special character +/(?:[!%@#$^*?_~].*){2,}/.test(s) // at least 2 special characters +!s.split("").some((c,i,a)=&gt; // no sequence of 3 characters or more i&gt;1 &amp;&amp; s.charCodeAt(i)-s.charCodeAt(i-1)==1 &amp;&amp; s.charCodeAt(i-1)-s.charCodeAt(i-2)==1 ) console.log(`${s} has a password strength of ${strength}`); }); &lt;input type="text" class="password"&gt; The console will show a number from 0 to 6 indicating the password strength of the entered password.
type: Answer
answers question: http://stackoverflow.com/q/27820724

http://stackoverflow.com/comment/44042063
comment on: http://stackoverflow.com/q/27818001
score: 0
type: Comment
type: QuestionComment
has text: Add a fragment to the URL of the tab, eg `page.html#travel` then use `window.location.hash` to select the chosen tab.

http://stackoverflow.com/comment/44021865
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27806428
has text: Just read the API *most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be*

http://stackoverflow.com/q/27882764
has body: I'd like to find a way to detect whether a observer has finished using a customized observable, which I created with Rx.Observable.create, such that the customized observable can end it and do some clean up properly. So I created some test code as below to figure out what kind of fields are available on the observer object for this purpose. var Rx = require("rx") var source = Rx.Observable.create(function (observer) { var i = 0; setInterval(function(){ observer.onNext(i); console.dir(observer); i+=1 }, 1000) }); var subscription = source.take(2).subscribe( function (x) { console.log('onNext: %s', x); } ); The output is as following onNext: 0 { isStopped: false, observer: { isStopped: false, _onNext: [Function], _onError: [Function], _onCompleted: [Function] }, m: { isDisposed: false, current: { dispose: [Function] } } } onNext: 1 onCompleted { isStopped: true, observer: { isStopped: false, _onNext: [Function], _onError: [Function], _onCompleted: [Function] }, m: { isDisposed: true, current: null } } It seems there are 3 fields on the observer object which seem to have something to do withmy goal, namely, observer.isStopped, observer.observer.isStopped and observer.m.isDiposed. I was wondering what they all are about and which one I should choose. ============================================================================== Motivations for my question Based on Andre's suggestion, I add the scenario which motivated my question. In my application, I was trying to do some UI animations based on the window.requestAnimationFrame(callback) mechanism. requestAnimationFrame will call the provided callback in a time determined by the browser render engine. The callback is supposed to do some animation step and recursively call requestAnimationFrame again until the end of animation. I want to abstract this mechanism to an observable as below. function animationFrameRenderingEventsObservable(){ return Rx.Observable.create(function(subscriber){ var fn = function(frameTimestmpIn…
tagged with: rxjs
favorite count: 0
score: 4
has title: RxJs - what's the difference among observer.isStopped, observer.observer.isStopped and observed.m.isDisposed
has answer: http://stackoverflow.com/a/27949211
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27907450
type: Question
has answer: http://stackoverflow.com/a/27907450
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27949211
upvote count: 4
answer count: 2
downvote count: 0

http://stackoverflow.com/q/27897112
upvote count: 2
possible better answer: http://stackoverflow.com/a/35548557
has answer: http://stackoverflow.com/a/34557497
tagged with: email
tagged with: smtp
favorite count: 0
has title: How to parse email on Haraka?
tagged with: node.js
answer count: 4
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35548557
downvote count: 0
has answer: http://stackoverflow.com/a/30233162
accepted answer: http://stackoverflow.com/a/30233162
type: Question
tagged with: mail-server
has body: Ive been exploring the haraka (http://haraka.github.io ) and Ive successfully install it on my linux machine. I'm wondering if there is a good tutorial on parsing an email meta headers and content body using haraka. Ive check on their manual but I couldnt find it. Any ideas/suggestions on how to do that would greatly appreciated. Thanks. Here is my script to retrieve the email body: var winston = require('winston'); exports.hook_data = function (next, connection) { winston.log('info', '----------------------------------------'); winston.log('info', 'hook_data'); // enable mail body parsing connection.transaction.parse_body = true; winston.log('info', "body="+connection.transaction.body); winston.log('info', "mail_from="+connection.transaction.mail_from); next(); } The output: {"level":"info","message":"----------------------------------------","timestamp":"2015-01-12T07:16:28.216Z"} {"level":"info","message":"hook_data","timestamp":"2015-01-12T07:16:28.217Z"} {"level":"info","message":"body=null","timestamp":"2015-01-12T07:16:28.218Z"} {"level":"info","message":"mail_from=myemail@hostname.com","timestamp":"2015-01-12T07:16:28.218Z"} As you can see the body contains a null value.
has answer: http://stackoverflow.com/a/77635401
tagged with: javascript

http://stackoverflow.com/comment/44321772
has text: https://docs.angularjs.org/api/ng/directive/script
comment on: http://stackoverflow.com/q/27961474
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27946338
has body: Prototype is (was) a fairly common library to select elements and provide helpers, generally around manipulating said elements. The $ function is generally associated with jQuery now, although Prototype still exists and is somewhat maintained (the last release appears to have been April 2014). Which to use depends heavily on what you need to do. If all you want to do is select elements by ID, then simply use document.getElementById (wrapped in methods or cached as appropriate). It is built into browsers and does what you need in a simple, reliable way. If you don't need a dependency, especially one as heavy as Protoype or jQuery are, then don't include it. However, if (or when) you start needing more complex selectors, you may have to pull in a library. jQuery and Prototype can handle much more complicated, CSS-like selectors for elements (#foo &gt; li.bar). With modern browsers, the DOM does support some more complicated selectors (such as getElementsByClassName to select by class, or querySelectorAll providing CSS selectors), which may provide enough flexibility that you never need a library. A significant difference between jQuery and Prototype is that the $ function provided by Prototype is a wrapper around getElementById, and you should use $$ for complex (CSS) selectors. jQuery, on the other hand, only provides the $ form and supports all selectors there. If all you need is Prototype's $, then getElementById will probably fill your needs without the dependencies. Note that Prototype and jQuery also provide some helpers, once you've selected elements. You can $("#foo").find(".bar").hide() to hide all elements in #foo with the bar class, for example. You should review the docs for each and see how many of the features you expect to use.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44288507
downvote count: 0
answers question: http://stackoverflow.com/q/27946168
has comment: http://stackoverflow.com/comment/44288302
has comment: http://stackoverflow.com/comment/44288556
has comment: http://stackoverflow.com/comment/44288149
has comment: http://stackoverflow.com/comment/44288619
type: Answer
upvote count: 7
has comment: http://stackoverflow.com/comment/44288736
score: 7
has comment: http://stackoverflow.com/comment/44288841
accepted answer of: http://stackoverflow.com/q/27946168

http://stackoverflow.com/a/27835595
has comment: http://stackoverflow.com/comment/44119997
has body: Try this: $.each( $('#dialog').parent().find('.ui-button-text'), function(i, btn) { var label = options.buttons[i]; btn.text(label); }); JSFiddle Demo The basic idea is to iterate through each of the button-text in the dialog and get the text for the button from the options.buttons object and set it as the text for the button. Depending on your DOM/Markup, you might require to tweak the code slightly to get it right. Please post your code/markup, in case you aren't able to get it fine. :) Here's a function you can call to change any of the button-texts you want to update: function changeBtnText(container, from, to) { var buttons = container.parent().find('.ui-button-text'); $.each(buttons, function (i, btn) { if($(btn).text() == from) { $(btn).text(to); return false; } }); } You can call it like this: changeBtnText( $('#dialog'), 'Save', 'Dont Save' ); That will change the button whose text is 'Save' to 'Dont Save'.
accepted answer of: http://stackoverflow.com/q/27834724
has comment: http://stackoverflow.com/comment/44076531
answers question: http://stackoverflow.com/q/27834724
score: 0
has comment: http://stackoverflow.com/comment/44119557
has comment: http://stackoverflow.com/comment/44086433
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44114712
has comment: http://stackoverflow.com/comment/44113150
type: Answer

http://stackoverflow.com/q/27926107
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44250027
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44251178
has body: Trying to add a Javascript on a hyperlink click event. Here, I get the Name of the hyper link, but nothing happens when i try to click on the hyperlink. tblCell = new HtmlTableCell(); List&lt;string&gt; liEmailIdsForCC = new List&lt;string&gt;(); if(some condition) { liEmailIdsForCC .add("someitem"); } HyperLink hpOwnerName = new HyperLink(); hpOwnerName.Text += string.Format("({0}) ", "FullName"); string args = string.Format("{0},{1}" , this , liEmailIdsForCC ); var onClick = String.Format("javascript:OnNameClick({0});return false;", args); hpOwnerName.Attributes.Add("onclick", onClick); tblCell.Controls.Add(hpOwnerName); Now, in this javascript, I am just trying to alert the first item in the list function OnNameClick(sender, list) { alert(li[0]); }
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44249362
downvote count: 1
tagged with: c#
has title: Adding javascript to a hyperlink control
has answer: http://stackoverflow.com/a/27926540
has comment: http://stackoverflow.com/comment/44249856
type: Question
has comment: http://stackoverflow.com/comment/44249701

multithreading
tags question: http://stackoverflow.com/q/27879745
type: Tag
tags question: http://stackoverflow.com/q/27923487
tags question: http://stackoverflow.com/q/27908520
tags question: http://stackoverflow.com/q/27884186
tags question: http://stackoverflow.com/q/27834474
tag name: multithreading

http://stackoverflow.com/comment/44206585
score: 2
comment on: http://stackoverflow.com/q/27903677
has text: better to do console.log() on response because you can't alert objects
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44333566
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27970228
has text: Great! Glad you found this helpful.
type: AnswerComment

http://stackoverflow.com/comment/44118962
has text: What do you render in the `head` section for the page? If you try and use jquery there its not loaded yet
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27857696

http://stackoverflow.com/q/27831375
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44068816
tagged with: asynchronous
tagged with: node.js
has comment: http://stackoverflow.com/comment/44069347
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27839113
has body: I'm fairly new to node and am having some trouble unravelling some callback hell. I need to perform a series of involved operations -- each of which has a lot of code in modules with lots of callbacks. But these operations need to be performed in series. I've broken the real mess down to this toy program: const a = require('async'); var myasyncproc = function( cb ) { setTimeout( console.log( '..boo') , 10000 ); var str = require('fs').createReadStream('atest.js'); str.on('data', function( data ) { console.log( data ); }) str.on('end', function() { cb(); }); }; [1,2,3].forEach( function( i ) { a.series( [ function( callback ) { console.log( 'starting ' ); myasyncproc( callback ); }, function( callback ) { console.log('too' ); callback( null, 'too'); }, function( callback ) { console.log( 'tree' ); callback( null, 'done'); } ], function (err, result ) { console.log( result); } ); }); Also note that I need to perform this series multiple times. Here I've just used the vector [1,2,3], but in my real application, these have values I need to use. If you run this, you'll see that the myasyncproc is called three times (started) before "too" and "tree" are run. That's good, but how do I use async or some other technique to prevent a second call to myasyncproc until 'tree' is done? Seems like async should do this, but I can't quite suss it out... Thanks!
has title: using async to serialize operations with multiple layers of callbacks in node js
type: Question

http://stackoverflow.com/q/27877120
tagged with: jquery
tagged with: angularjs
has answer: http://stackoverflow.com/a/27877228
accepted answer: http://stackoverflow.com/a/27877228
possible better answer: http://stackoverflow.com/a/27877250
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27877250
has comment: http://stackoverflow.com/comment/44155843
type: Question
has body: I am using ngDialod for my modal window in angularjs. i want to run some jquery code inside the modal window. I have created a fiddle My Modal. How to target id="target" on click? (Why i need this because, i am planning a simple image slider inside modal) Please help,
has comment: http://stackoverflow.com/comment/44155664
tagged with: javascript
has title: How to run jquery inside angularjs modal window?
score: 0
answer count: 2
tagged with: angular-ui

http://stackoverflow.com/a/27847681
has comment: http://stackoverflow.com/comment/57435221
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27847493
has body: .toDataURL will always capture the entire canvas, so to get a smaller image you must create a second smaller canvas: var scaledCanvas=document.createElement('canvas'); var scaledContext=scaledCanvas.getContext('2d'); scaledCanvas.width=canvas.width*scaleFactor; scaledCanvas.height=canvas.height*scaleFactor; Then scale the second canvas and draw the main canvas onto the second canvas scaledContext.scale(scaleFactor,scaleFactor); scaledContext.drawImage(canvas,0,0); And finally export that second canvas as a dataURL. var dataURL = scaledCanvas.toDataURL(); Warning: untested code above...but it should put you on the right track!
answers question: http://stackoverflow.com/q/27847493
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/42020658
downvote count: 0
has body: I went this way. I created an object - formatter and pass it into template model. And I call formatter.format(date) in the template. template.ftl Created <#if order.created??>${formatter.format(order.created)}</#if> Amount ${order.amount!} Currency ${order.currency!} OrderPresenter.java @Component public class OrderPresenter { private static final String FORMATTER_PARAM = "formatter"; private static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern(DATE_TIME_FORMAT).withZone(ZoneId.systemDefault()); private Configuration configuration = prepareConfiguration(); public String toHtmlPresentation(ClientDetails clientDetails) { try { Template template = configuration.getTemplate(CLIENT_DATA_TEMPLATE); Writer out = new StringWriter(); template.process(toMap(clientDetails), out); return out.toString(); } catch (IOException | TemplateException e) { throw new RuntimeException(e); } } private Configuration prepareConfiguration() { Configuration configuration = new Configuration(Configuration.VERSION_2_3_23); configuration.setDefaultEncoding(ENCODING); configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); configuration.setLogTemplateExceptions(NOT_TO_LOG_EXCEPTIONS); configuration.setClassForTemplateLoading(OrderPresenter.class, TEMPLATES_FOLDER); return configuration; } private Map<String, Object> toMap(ClientDetails clientDetails) { Map<String, Object> res = new HashMap<>(); res.put(CLIENT_DETAILS_PARAM, clientDetails); res.put(FORMATTER_PARAM, FORMATTER); return res; } }
type: Answer
answers question: http://stackoverflow.com/q/27857058
score: 1
upvote count: 1

http://stackoverflow.com/comment/44285495
comment on: http://stackoverflow.com/a/27944335
type: AnswerComment
type: Comment
has text: You actually should not accept this because it does not answer your question. I posted this as an answer just for sake of formatting.
score: 1

http://stackoverflow.com/q/27954723
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27955935
has comment: http://stackoverflow.com/comment/44304470
accepted answer: http://stackoverflow.com/a/27955935
tagged with: selenium
type: Question
has answer: http://stackoverflow.com/a/27954747
answer count: 2
score: 5
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27954747
tagged with: beautifulsoup
has comment: http://stackoverflow.com/comment/44306684
has comment: http://stackoverflow.com/comment/44304490
has title: Clicking a Javascript link to make a post request in Python
favorite count: 0
has comment: http://stackoverflow.com/comment/44306291
upvote count: 5
tagged with: python
tagged with: python-requests
has body: I'm writing a webscraper/automation tool. This tool needs to use POST requests to submit form data. The final action uses this link: Save URL on All Search Engines to submit data from this form: I've been using requests and BeautifulSoup. I understand that these libraries can't interact with Javascript, and people recommend Selenium. But as I understand it Selenium can't do POSTs. How can I handle this? Is it possible to do without opening an actual browser like Selenium does?

http://stackoverflow.com/q/27914668
tagged with: android
has answer: http://stackoverflow.com/a/27914748
has answer: http://stackoverflow.com/a/27914758
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27914757
tagged with: java
tagged with: http://stackoverflow.com/tag/json
type: Question
score: 0
has answer: http://stackoverflow.com/a/27914757
has title: Json string to json object conversion
has comment: http://stackoverflow.com/comment/44228681
possible better answer: http://stackoverflow.com/a/27914730
has answer: http://stackoverflow.com/a/27914730
tagged with: javascript
has body: I have looking to similar questions but i was not able to solve my problem .I have tried parsing my json response both into a Json array and Json object but every time , i am getting this exception of string to json object. I guess may be the problem is with my Json response. results = { "type": 1, "user_log": "ahsan.tahir.92_/var/www/html/2014-10-11__15-54-52__50sec.txt_res", "freq": 0.01, "coordina": [ [-37], [-9], [-20], [-12], [-22], [-9], [-22], [-15], [-25], [-7], [-20], [-12], [-20], [-9], [-25], [8], [-23], [-11], [-18], [-13], [-19], [-10], [-21], [-12], [-25], [-11], [-17], [-12], [-22], [-13], [-21], [3] ], "tot_time": 40.11, "tot_distace": 100, "stroke_each_pool": [ [16], [16] ], "tot_stroke": [ [16], [16] ], "split": [ [20.22], [19.89] ], "timing_turn": 7.04, "cycle_Rate_l": [ [2.22], [2.2680001] ], "cycle_Rate_r": [ [2.224], [2.27] ], "mean_velocity": [ [2.4727993], [2.5138261] ], "stroke_length": [ [3.125], [3.125] ], "stroke_freq": [ [79.077431], [77.419357] ], "roll_peaks": [ [-44.10043335], [55.79428101], [-61.51541138], [54.7466507], [-62.09820557], [55.01488495], [-62.48770142], [53.44023132], [-70.32449341], [51.8399353], [-65.84837341], [53.5617981], [-63.50210571], [55.9821167], [-62.37905121], [39.42669678], [-43.44207764], [63.20912933], [-59.19660187], [50.6708374], [-63.8214798], [54.57595062], [-63.31864166], [53.82037354], [-66.93650818], [52.36277008], [-65.23461151], [52.89829254], [-62.78508759], [51.17367554], [-62.87123108], [59.13114929] ], "mean_roll_dx": [ [52.475822], [54.73027] ], "mean_roll_sx": [ [61.531971], [60.950779] ], "std_roll_dx": [ [5.4471908], [4.3127728] ], "std_roll_sx": [ [7.6123171], [7.4134283] ], "mean_roll": [ [57.003899], [57.840527] ], "std_roll": [ [7.9220791], [6.6817732] ], "mean_pitch": [ [-5.5227709], [-5.2282872] ], "std_pitch": [ [-5.5227709], [-5.2282872] ], "clean_stroke_time": [ [15.92], [16.84] ], "errore": 227, "fatal_error": { "_ArrayType_": "double", "_ArraySize_": [0,0], "_ArrayData_": null }…
has comment: http://stackoverflow.com/comment/44228630
has answer: http://stackoverflow.com/a/27914789
has comment: http://stackoverflow.com/comment/44228599
answer count: 5

http://stackoverflow.com/a/27850282
has body: The other option you have is to use toggleClass('active') on the parent item (obj.dd). This way the use can close the menu by clicking on the ul as well as a li. As the parent click event still fires and remove the handler at the end. http://jsfiddle.net/cv5jahd8/ function DropDown(el) { this.dd = el; this.placeholder = this.dd.children('span'); this.opts = this.dd.find('ul.dropdown &gt; li'); this.val = ''; this.index = -1; this.initEvents(); } DropDown.prototype = { initEvents: function () { var obj = this; obj.dd.on('click', function (event) { $(this).toggleClass('active'); return false; }); obj.opts.on('click', function (e) { var opt = $(this); obj.val = opt.text(); obj.index = opt.index(); obj.placeholder.text(obj.val); }); }, getValue: function () { return this.val; }, getIndex: function () { return this.index; } } $(function () { var dd = new DropDown($('#dd')); });
type: Answer
answers question: http://stackoverflow.com/q/27849603
score: 0

http://stackoverflow.com/a/27868716
has body: The fastService is starting before the slowService completes That is because you are executing the function fastService before slowService async callback runs.Instead you would want to provide the reference of the function. i.e .then(Service_1.fastService(name)); should be .then(Service_1.fastService); or .then(function(name){ Service_1.fastService(name); }); otherwise fastservice will just run right away, before the async part of the slowService runs. Use $timeout with that the advantage is that it already returns a promise so you do not need to create a deferred object and resulting in deferred anti-pattern. myApp.service('Service_1', function($q, $timeout) { //&lt;-- Inject timeout this.slowService = function (name) { console.log('Start of slowService:', name, Date.now()); return $timeout(function() { console.log('setTimeout name:', name, Date.now()); if(name){ name = 'Hello, ' + name + " is learning Angularjs"; return name; //return data } //Reject the promise return $q.reject('No name supplied !'); }, 3000); }; //... }); and when consuming just chain through: Service_1.slowService(myName) .then(Service_1.fastService); So instead of timeout even if you are using $http in your original method just return the promise from http rather than creating a deferred object. Also just keep in mind when you use the syntax .then(Service_1.fastService); and if you are referring to this context in the fast service it wont be the service instance.
has comment: http://stackoverflow.com/comment/44144520
score: 5
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/27868388
accepted answer of: http://stackoverflow.com/q/27868388
has comment: http://stackoverflow.com/comment/44145110
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44144704
type: Answer
has comment: http://stackoverflow.com/comment/44144558

http://stackoverflow.com/comment/44209459
comment on: http://stackoverflow.com/a/27904934
score: 0
type: AnswerComment
has text: I've already covered that part in my answer ("First we determine whether the URL contains a hash"), by checking for the presence of hash in the URL, i.e. `window.location.hash`
type: Comment

http://stackoverflow.com/a/45192579
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/137586411
downvote count: 0
has body: At the very bottom it says to quote the name with the special characters. So it should be MyClass#"namespace.myevent" https://jsdoc.app/about-namepaths
has comment: http://stackoverflow.com/comment/137586424
has comment: http://stackoverflow.com/comment/109068211
upvote count: 2
answers question: http://stackoverflow.com/q/27962224
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27962224
has comment: http://stackoverflow.com/comment/138118912

http://stackoverflow.com/q/27850021
has answer: http://stackoverflow.com/a/27850150
has comment: http://stackoverflow.com/comment/44104149
type: Question
possible better answer: http://stackoverflow.com/a/27850166
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27850166
has answer: http://stackoverflow.com/a/27850100
score: 0
has body: This is going to be hard to explain but I will do my best. I want to write a Javascript function that takes two parameters (title, content) and creates a tag in the tag. The tag should look like this. title content My javascript code looks like this: function addElement (title, content) { var newDiv = document.createElement("div"); var newH2 = document.createElement("h2"); var title = document.createTextNode(header); newH2.appendChild(title); var p = document.createElement("p"); var post = document.createTextNode(entry); p.appendChild(post); newDiv.appendChild(newH2); newDiv.appendChild(p); // Missing codes here... } I dont know how to finish my method. Because of I have almost hundreds of tags inside my page and I want this new tags (when a user makes a new input) will appear on same place somewhere in the middle of the html code page in order to keep things organized.
has answer: http://stackoverflow.com/a/27850077
accepted answer: http://stackoverflow.com/a/27850150
has comment: http://stackoverflow.com/comment/44105273
has title: Javascript: Create a new div in tag
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44104569
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/27966903
downvote count: 0
answers question: http://stackoverflow.com/q/27906867
upvote count: 8
type: Answer
has body: JSDT Plugins which is the default Eclipse plugins for JavaScript doesn't support RequireJS. I suggest you that you try tern.java (I'm the author of tern.java) which gives a support for RequireJS. You will benefit with RequireJS completion, hyperlink, hover, validation. I suggets you that you install AngularJS Eclipse 0.8.0 (not released) which is based on tern.java (as it seems you are using angular). You will have again Outline problem (tern.java doesn't fix that), but don't hesitate to create issues with your idea to improve tern.java.
score: 8

http://stackoverflow.com/q/27893143
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44187544
has comment: http://stackoverflow.com/comment/44187689
tagged with: javascript-engine
has comment: http://stackoverflow.com/comment/44188028
has comment: http://stackoverflow.com/comment/44187562
has comment: http://stackoverflow.com/comment/44188326
accepted answer: http://stackoverflow.com/a/27893672
has comment: http://stackoverflow.com/comment/44188329
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44187577
has comment: http://stackoverflow.com/comment/44187933
has answer: http://stackoverflow.com/a/27893672
type: Question
has title: Have javascript declare (by default) undeclared variables to the current local scope (based on first use) instead of global scope?
has body: Can this be done either via writing some code to intercept the global scope default declaration or via a setting within the javascript engine itself which each program or function has access to? What I mean is if I could, at the top of the program (or function), tell the javascript engine to use local scope for undeclared variables instead of global scope... then, when the javascript engine compiles each function, it would declare them in local scope. I understand if you want to declare a variable outside of the current scope, that should be done explicitly since no one knows where you want it declared, but I think defaulting to global scope leaves too much room for error and forces too much typing of var statements in each function, so I'd like to change the default in my programs if that's possible. My primary purpose is to avoid having to type the list of local variables in a var statement at the top of every function, and to avoid the maintenance of keeping this list in sync with the local variables as I'm using them within a function. Not allowing a global scope default also reduces the risk of errors. I would never want undeclared variables to end up in any higher scope than the scope in which they are first used. There is no value in having them default to global scope that I can see. I know I can explicity declare variables in the current scope (or the global scope), but would like to avoid doing so and use a more useful default than the global scope default built into javascript. I also know I can use "use strict" to force all variables to be declared explicitly. Not wanting to debate the right or wrong of it, but just asking if there is any way to change the default to local scope instead of global scope for a given function.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44187850
tagged with: scope

http://stackoverflow.com/comment/44300196
comment on: http://stackoverflow.com/a/27951713
type: Comment
has text: This works, but I'm onley getting this: 'New Tweet ID 554682452443430912'
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44295339
type: AnswerComment
comment on: http://stackoverflow.com/a/27949783
has text: Does the body of an HTML document load linearly? What I mean is that if i put a tag at the bottom of a document would every element above it have loaded?
type: Comment
score: 0

qml
tags question: http://stackoverflow.com/q/27902910
type: Tag
tag name: qml
tags question: http://stackoverflow.com/q/27945427

http://stackoverflow.com/q/27842633
has comment: http://stackoverflow.com/comment/44140353
type: Question
has title: Issue with multiple tab Javascript API
has comment: http://stackoverflow.com/comment/44139963
score: 0
has body: Our partner provided us with a Javascript API. We call this API based on some events. For example we receive an event from backend saying save Record XYZ Note1: this is an event rather than response of user request. Note2: we use signalR for event. Everything works fine but problem comes when user open two tabs of the same page. Then the same API is called twice and two records are saved instead of one. This must be one of very typical problem with Javascript and I was hoping there must be some design pattern or solution exist for this?
tagged with: design-patterns
tagged with: signalr
answer count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: dom-events

http://stackoverflow.com/a/27922763
score: 1
answers question: http://stackoverflow.com/q/27922710
has body: You access your array with the wrong way. Please just try this one: items[i][j] When we have a multidimensional array we access the an element of the array, using array[firstDimensionIndex][secondDimensionIndex]...[nthDimensionIndex]. That being said, you should change the condition in your if statement: if( items[i][j] === 0 ) Please notice that I have removed the , you had after 0. It isn't needed. Also I have removed the ''. We don't need them also.
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/27945484
tagged with: firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/44286313
has title: How to force a time limit for recording webrtc audio
answer count: 1
tagged with: webrtc
type: UnansweredQuestion
tagged with: audio
score: 0
has body: How can I force a time limit for recording an audio file using webrtc audio in firefox/chrome? Example: A user comes to a website and I want them to record their voice for 7 seconds only, then have them email it to me.
tagged with: google-chrome
has answer: http://stackoverflow.com/a/49128655
type: Question
has comment: http://stackoverflow.com/comment/44286695
has comment: http://stackoverflow.com/comment/44286105

http://stackoverflow.com/q/27804025
type: AnsweredQuestion
score: 3
downvote count: 0
possible better answer: http://stackoverflow.com/a/27804136
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27804126
tagged with: javascript
upvote count: 3
tagged with: eval
has title: javascript: check whether expression is evaluatable or not?
has answer: http://stackoverflow.com/a/27804126
has comment: http://stackoverflow.com/comment/44016951
favorite count: 0
has comment: http://stackoverflow.com/comment/44017019
linked to: http://stackoverflow.com/q/9521298
has body: I have Random Expression which is given By users (Eg: 2+3*5,21*+(4)7,*-54+3). These Expression can contain any number of operand or operator to form a expression.I need to evaluate These Expression to get the Answer.I tried to evaluate using eval() function but Problem is when a wrong Expression is passed to eval() functions it throws a error and program halt.I tried it by if(eval(exp)) { //Action Expression is evaluatable } else { //expression is not Evaluatable } but did not worked and produced error message "SyntaxError: unterminated regular expression literal." Due to variety in expressions' nature it would be difficult for me to construct check statements before evaluating. can you please suggest how can i simply check whether the expression passed to eval() function is correct or not ?
has answer: http://stackoverflow.com/a/27804136

http://stackoverflow.com/comment/44157148
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27877612
has text: Note that the command is `.indexOn`, not `.indexOf` like you've typed above. If you made the same typo in your rules, it will indeed not work.
type: Comment

http://stackoverflow.com/comment/44084522
score: 0
has text: You need to wait untill the CSS animation has ended before you remove the class.
comment on: http://stackoverflow.com/q/27840497
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44332250
comment on: http://stackoverflow.com/q/27953898
score: 0
type: QuestionComment
type: Comment
has text: @Reza - The code you have posted is still broken. You have `$(document).ready(){` where you should have `$(document.ready(function(){`. If this is a typo, please edit your question to correct it.

http://stackoverflow.com/q/27841464
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27842952
answer count: 1
favorite count: 0
has title: jQuery slider range: apply range as a filter on table rows
type: AnsweredQuestion
tagged with: filtering
has body: For my internship I have to make a filter for a table which has to show only the rows that are between the values you give it. I used jQuery UI for the range slider and I have a normal HTML table. I cant get it to work and I've tried many different things. Here's my code: $(function() { $( "#slider-range" ).slider({ range: true, min: 0, max: 500, values: [ 75, 300 ], slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) ); $("#ADC_DAC").find("td:nth-child(0)").filter(function () { return parseInt($(this).text()) < $( "#slider-range" ).slider( "values", 0 ); }).parent().hide(); $("#ADC_DAC").find("td:nth-child(0)").filter(function () { return parseInt($(this).text()) > $( "#slider-range" ).slider( "values", 1 ); }).parent().hide(); } }); }); The slider has the ID slider-range and the table ID ADC_DAC. My table is made up like this: h1 h2 h3 23 test test2 But then with way more rows and with values between 0 and 500 for the first row (which needs filtering)
has answer: http://stackoverflow.com/a/27842952
type: Question
upvote count: 4

http://stackoverflow.com/q/27934400
has title: How to get jquery selector seeing updated dom in change handler
has answer: http://stackoverflow.com/a/27934733
has comment: http://stackoverflow.com/comment/44266545
has comment: http://stackoverflow.com/comment/44266514
score: 0
has answer: http://stackoverflow.com/a/27934501
linked to: http://stackoverflow.com/q/1957290
accepted answer: http://stackoverflow.com/a/27934501
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44266510
has body: I'm fairly new to javascript and jQuery. I've searched for answers to this question, but have had no luck, though I bet there are some in here. So advance apologies if this is a dup. Markup has 3 checkboxes with different classes, and one class in common. I want to notice when the number of boxes checked in either of two classes changes, or rather when there is a transition between at least one box in two of the classes being checked or unchecked. The two interesting classes are named "professional" and "vendor", and the class in common is "account_type_checkbox". When the page is ready, I count the number of checked "professional" and "vendor" boxes with: jQuery("input.professional[checked='checked'], input.vendor[checked='checked']").length This appears to work correctly. I have a "change" event handler on checkboxes in the common class that does the same count when it triggers. But when the event triggers, it gets the same count as it did on page load - i.e. it doesn't see the updated DOM with the modified checked attribute. I've put a jsfiddle for this at http://jsfiddle.net/cm280s9z/1 Could someone please help me fix this, and/or explain why my code doesn't work the way I expected it to?
type: AnsweredQuestion
tagged with: events
has comment: http://stackoverflow.com/comment/44266531
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27934733

http://stackoverflow.com/a/27812954
type: Answer
answers question: http://stackoverflow.com/q/27812475
score: 0
type: AcceptedAnswer
has body: There is a problem with your declared observables. self.isRangeError = ko.observable(false); Should be: self.isFieldError = ko.observable(false); Also color is not defined on your model but is used in the table.
accepted answer of: http://stackoverflow.com/q/27812475

http://stackoverflow.com/comment/68562433
comment on: http://stackoverflow.com/q/27912726
score: 0
type: Comment
has text: Cool, I had this problem with plain Bootstrap and JQuery. Fixed it by manually popping up the modal and returning false. `$('.grid-email').click(function() { $('#emailModal').modal('show'); return false; });` I did not even have to remove the `data-toggle` and `data-target`. `z-index` was already set to 1.
type: QuestionComment

http://stackoverflow.com/comment/44117473
comment on: http://stackoverflow.com/q/27857131
has text: In which object events are stored
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27830421
has answer: http://stackoverflow.com/a/27830778
score: 0
answer count: 3
has body: function drawTable() { var table = document.getElementById("myTable"); var input = prompt("Insert height (in number of cells)"); var a = +input; var input2 = prompt("Insert width (in number of cells)"); var b = +input2; for (var i = 0; i &lt; a; i++) { var row = table.insertRow(i); for (var j = 0; j &lt; b; j++) { var cell = row.insertCell(j); }; }; }; I can't for the life of me figure out how to add a onClick event that would change the color of a cell. Do I create a new function in JavaScript and add an onClick event to the table element? That's what I did, but it doesn't seem to work. function changeColor() { var td = document.getElementsById("myTable").getElementsByTagName("td"); td.style.backgroundColor = "red"; }
accepted answer: http://stackoverflow.com/a/27830703
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/27831323
tagged with: javascript
has answer: http://stackoverflow.com/a/27831323
has answer: http://stackoverflow.com/a/27830703
has title: How do I change an html cell's color on click, if the table is generated dynamically?

http://stackoverflow.com/a/28377084
score: 1
has comment: http://stackoverflow.com/comment/45098315
has comment: http://stackoverflow.com/comment/45106092
upvote count: 1
type: AcceptedAnswer
has body: plnkr .directive('resetFocus', [function(){ return function(scope, element, attr, ctrl) { if(scope.$last){ element.find('input').focus(); } }; }]) &lt;div class="item-input item-type-input" ng-repeat="item in items track by $index" reset-focus&gt; &lt;input type="text" ng-model="items[$index]" class="form-control" /&gt; &lt;/div&gt; Since you're also doing removal, you may need to $watch('$last') .directive('resetFocus', [function(){ return function(scope, element, attr, ctrl) { if(scope.$last){ element.find('input').focus(); } scope.$watch('$last', function(){ if(scope.$last){ element.find('input').focus(); } }); }; }]) The directive sets the focus on the last input element in the ng-repeat when it is created. It takes advantage of the fact that ng-repeat will add $last to the scope.
accepted answer of: http://stackoverflow.com/q/27884063
has comment: http://stackoverflow.com/comment/45098158
answers question: http://stackoverflow.com/q/27884063
type: Answer
has comment: http://stackoverflow.com/comment/45098126
downvote count: 0

http://stackoverflow.com/q/27960484
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44314574
has comment: http://stackoverflow.com/comment/44315145
has body: i purchased this wordpress theme Clinico , This is using Static page for home page and . for me Problem is that its coded using Some massive JS libraries and every thing is done in really complex style . in home page i have to remove a section that i am unable to find how its being generated when i go to theme customize options it says its using "A Static page " and in drop down its named as "HOME" now there is no home.php or any thing else in folder how do i edit this static page ? is it index.php ? as removing most of the code from index.php is not working to remove that section Please help
tagged with: php
has answer: http://stackoverflow.com/a/27960642
type: AnsweredQuestion
tagged with: wordpress
has comment: http://stackoverflow.com/comment/44314644
type: Question
has comment: http://stackoverflow.com/comment/44314724
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27960642
has title: Customizing wordpress static home page

http://stackoverflow.com/q/27875906
has title: react.js - Deep Object in state with async data does not work
upvote count: 2
has comment: http://stackoverflow.com/comment/44153493
accepted answer: http://stackoverflow.com/a/27882982
has body: I've just figured out that object in React's state that have multiple children cannot be rendered easily. In my example I have component which speaks with third-party API through AJAX: var Component = React.createClass({ getInitialState: function () { return {data: {}}; }, loadTrackData: function () { api.getDataById(1566285, function (data) { this.setState({data: data}); }.bind(this)); }, componentDidMount: function () { this.loadTrackData(); }, render: function () { return ( &lt;div&gt; &lt;h2&gt;{this.state.data.metadata.title}&lt;/h2&gt; &lt;/div&gt; ); } }); The problem is that {this.state.data.metadata} renders fine.. But {this.state.data.metadata.title} throws error Uncaught TypeError: Cannot read property 'title' of undefined! What is the proper way to deal with such async data?
score: 2
type: AnsweredQuestion
type: Question
tagged with: reactjs
has comment: http://stackoverflow.com/comment/44153450
tagged with: javascript
has comment: http://stackoverflow.com/comment/44153521
has comment: http://stackoverflow.com/comment/44153289
has answer: http://stackoverflow.com/a/27882982
answer count: 2
possible better answer: http://stackoverflow.com/a/27876489
has answer: http://stackoverflow.com/a/27876489
downvote count: 0
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/44153429
favorite count: 0
tagged with: ajax

http://stackoverflow.com/a/27860462
has body: @Alien01, changing the lines ** to **/*.css and ** to **/*.js should fix it. Please let me know if it worked.
type: Answer
answers question: http://stackoverflow.com/q/27858171
score: 0

http://stackoverflow.com/q/27941462
has comment: http://stackoverflow.com/comment/44279179
has comment: http://stackoverflow.com/comment/44305803
downvote count: 0
type: Question
linked to: http://stackoverflow.com/q/572897
tagged with: javascript
has answer: http://stackoverflow.com/a/27941702
accepted answer: http://stackoverflow.com/a/27941702
has comment: http://stackoverflow.com/comment/44279052
score: 5
has comment: http://stackoverflow.com/comment/44279221
answer count: 1
favorite count: 0
upvote count: 5
has body: I'm relatively new in javaScript and I was doing some inheritance. I thought I know what prototype is but then i met with uber method. Now I don't know the difference between those two. I know that uber is like super in java and that's all. But then prototype is something that bothers me. If you can give me some simple example of using those two I would appreciate it very.
linked to: http://stackoverflow.com/q/16063394
has title: Javascript difference between uber and prototype
type: AnsweredQuestion

http://stackoverflow.com/comment/44181514
score: 0
has text: I have tried using css to add data-qtip attribute to that div element and also tried to add attr(title) ,attr(data-qtip) to x-grid-row-expander css class. After that it is not working.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27888056

http://stackoverflow.com/comment/44346253
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27948300
has text: https://github.com/alexlawrence/cjs2web can replace `require` in your `node.js` application with it's custom implementation. It actually bundles many `node.js` scripts into one. What do you mean by the _process level_? Is compiling custom `node.js` executable an option? Once you explain clearly the **why** and **what** then the **how**-options will be more visible
score: 0

http://stackoverflow.com/comment/44107948
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27851982
has text: On the initial portion of the answer, I say, "Precisely!" On the second part, I don't think that's correct.

http://stackoverflow.com/q/27826918
accepted answer: http://stackoverflow.com/a/27838561
has title: Google Maps Embed + Search box
favorite count: 0
type: AnsweredQuestion
upvote count: 3
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27838561
has comment: http://stackoverflow.com/comment/44074399
tagged with: google-maps
tagged with: javascript
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/44060453
score: 2
has body: I'm trying to make a map for my website, that will show a few markers of restaurants. I would also like people to be able to search the map, so they can look for an address and would be able to see the restaurants in that area. I got a code for the map with markers like i want it: and I found this code to add the search box (with autocomplete which is important to me): https://google-developers.appspot.com/maps/documentation/javascript/examples/places-searchbox But I can't seem to figure out how to mix the two together to make them work together. My coding knowledge is still very limited :( I would really appreciate your help! Thank you
answer count: 1

http://stackoverflow.com/comment/44253017
type: QuestionComment
type: Comment
has text: So you want the second div (sibling) to be hidden when the group is hovered over?
comment on: http://stackoverflow.com/q/27927965
score: 0

http://stackoverflow.com/comment/44267221
type: Comment
score: 1
has text: @IstiaqueAhmed it would be just an obfuscation of the example.
type: AnswerComment
comment on: http://stackoverflow.com/a/27934848

http://stackoverflow.com/q/27923925
has comment: http://stackoverflow.com/comment/49107065
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30519070
score: 15
type: Question
has answer: http://stackoverflow.com/a/30519070
has comment: http://stackoverflow.com/comment/133920851
has body: Long time ago, with outdated browsers (chrome38) people could make boxes... It was possible to use outline-color: invert to choose a color who was the exact opposite of the background. Today, such a great feature does not exist anymore :( Do yo have an idea for me who just want to display boxes with borders of the opposite color of the background ? (today chrome (39) compute outline-color: invert to outline-color:transparent. before that outline-color: invert rendered to outline-color: rgb(255,255,255) on a black brackground.) Thanks for your ideas.
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/49088238
tagged with: colors
has title: Substitute to css outline-color: invert
tagged with: http://stackoverflow.com/tag/html
upvote count: 15
tagged with: css
has comment: http://stackoverflow.com/comment/49106985
has comment: http://stackoverflow.com/comment/49099704

http://stackoverflow.com/comment/44083129
type: Comment
has text: ``
type: QuestionComment
comment on: http://stackoverflow.com/q/27839693
score: 0

http://stackoverflow.com/comment/44301411
type: AnswerComment
type: Comment
has text: That's where I was going, but I'm not sure this is right -- when I run your code with yourUnixTimestampValue = 1420621200 (Jan 7, 2015), a console.log on finalDate gives me the string "Sat Jan 17 1970 02:37:01 GMT-0800 (PST)Thu Jan 01 1970 09:00:00 GMT-0800 (PST)". Meanwhile, I'm making some progress on getting a correct value for timestring via Date.parse with " GMT" added to the end of partialDate before parsing.
comment on: http://stackoverflow.com/a/27951409
score: 0

http://stackoverflow.com/q/27847222
accepted answer: http://stackoverflow.com/a/27847612
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/76113316
possible better answer: http://stackoverflow.com/a/36652115
tagged with: windows
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has answer: http://stackoverflow.com/a/27847612
has body: I have been trying to see if it's possible to create a looping background that changes from one color to the next in a list, in the order of appearance. (The colors are: Red, Orange, Yellow, Green, Blue, and Purple.) I was hoping it would work and give a "rainbow"-type look to the page. I thought mixing HTML with JavaScript would work, but it apparently seems to show nothing but the text, and not even the first background change works. The code is: &lt;HTML&gt; &lt;HEAD&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;script&gt; function Red() { bgcolor Red; ColorOrange(); } function Orange() { bgcolor Orange; ColorYellow(); } function Yellow() { bgcolor Yellow; ColorGreen(); } function Green() { bgcolor Green; ColorBlue(); } function Blue() { bgcolor Blue; ColorPurple(); } function Purple() { bgcolor Purple; ColorRed(); } function ColorRed() { setTimeout("Red", 1000); } function ColorOrange() { setTimeout("Orange", 1000); } function ColorYellow() { setTimeout("Yellow", 1000); } function ColorGreen() { setTimeout("Green", 1000); } function ColorBlue() { setTimeout("Blue", 1000); } function ColorPurple() { setTimeout("Purple", 1000); } &lt;/script&gt; There is text here, but it's sorta not related to this so I replaced it with this! &lt;/BODY&gt; &lt;/HTML&gt;
has answer: http://stackoverflow.com/a/36652115
has comment: http://stackoverflow.com/comment/44098302
upvote count: 0
has title: HTML/Javascript Rainbow Background Code Won't Work
has comment: http://stackoverflow.com/comment/44098785
has answer: http://stackoverflow.com/a/66715824
answer count: 4
type: AnsweredQuestion
score: -1
type: Question
has comment: http://stackoverflow.com/comment/44098349
has comment: http://stackoverflow.com/comment/44099023

http://stackoverflow.com/q/27813359
has title: How to write a text document in new tab / window?
downvote count: 1
linked to: http://stackoverflow.com/q/169833
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44033816
has comment: http://stackoverflow.com/comment/44033923
score: 1
has body: Below code is used to display the image in new tab if the extension is jpg. Similarly, I want to write a text document (from base64 string to text) in new tab if the extension is txt. success: function (data) { var extension = fileName.split('.').pop(); if (extension == "jpg") { var image = new Image(); image.src = "data:image/jpg;base64," + data.d; var w = window.open(""); w.document.write(image.outerHTML); } else if(extension == "txt") { } }
tagged with: dom
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44033798
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44033828
has answer: http://stackoverflow.com/a/27813430
accepted answer: http://stackoverflow.com/a/27813430
has comment: http://stackoverflow.com/comment/44033853

http://stackoverflow.com/comment/44261731
type: QuestionComment
comment on: http://stackoverflow.com/q/27931641
score: 0
type: Comment
has text: Thanks got it :) U guys made me feel like a silly baboon!

http://stackoverflow.com/q/27882281
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44166549
has comment: http://stackoverflow.com/comment/44166312
tagged with: javascript
favorite count: 0
has title: How to send external javascript?
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/44166341
has comment: http://stackoverflow.com/comment/44166314
score: -2
has comment: http://stackoverflow.com/comment/44166393
has answer: http://stackoverflow.com/a/27882456
type: Question
has body: Ok, so this code here: var Link = "https://www.roblox.com/NewLogin" function Post(){ $.get(Link,function(Data){ $.post(Link,{ "Username" : "omh", "Password" : "lololololo", "login" : "Log In" }) }) } Post() That can only be ran on https://www.roblox.com/NewLogin How do I make it so I can run it from a .JS file on my site? Purpose: Just a piece of JavaScript to log into accounts. It is just for fun and to test my skills.

http://stackoverflow.com/a/27827387
type: Answer
has body: render: function(){ return( &lt;div&gt; &lt;input type="text" id="one" onKeyDown={this.add} /&gt; &lt;/div&gt; ); } onKeyDown detects keyCode events.
answers question: http://stackoverflow.com/q/27827234
score: 58
upvote count: 59
downvote count: 1
has comment: http://stackoverflow.com/comment/58799330

http://stackoverflow.com/q/27896869
type: AnsweredQuestion
score: 1
has title: How to call setinterval function in another function is not working
type: Question
has answer: http://stackoverflow.com/a/27897578
accepted answer: http://stackoverflow.com/a/27897578
answer count: 1
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: setinterval
favorite count: 0
has comment: http://stackoverflow.com/comment/44194206
downvote count: 0
has body: I want to display Updated records count when Ajax process is going on. When i click on start process button updateRecords()function will execute and it will update records status from open to waiting status one by one in database.So at the same time i want display the waiting records count .For this when user click on strat process button i want to call displayWaitingRecords() using setinterval. I am calling that function like this from updateRecords() clear_Process = setInterval(function(){displayWaitingRecords()},200); But displayWaitingRecords() will not call until updateRecords() process completes.But my requirement is displayWaitingRecords() also will execute simaltaniously with updateRecords(). Function to display updated record count function displayWaitingRecords() { jQuery.ajax({ type: 'GET', crossDomain:true, async: false, url: "/curlRRQCount.php", success: function(count){ if(count) { jQuery("#processed_poids_div").html("Processed Order ids:"+count) ; } } }); } Function when i click on start process button var clear_Process = ""; function updateRecords() { clear_Process = setInterval(function(){displayWaitingRecords()},200); var str = jQuery("#rrq_form :input[value!='']").serialize(); jQuery.ajax({ async: false, type: 'POST', data : str, url: "/updaterecord_status.php", success: function(valid_result) { if(jQuery.trim(valid_result) == 'Success') { jQuery("#rrq_load_img").hide(); jQuery("#rrq_orders_status").html("some success message"); } } }); } Where i am doing wrong? Any help would be greatly appreciated.

http://stackoverflow.com/q/27871373
has comment: http://stackoverflow.com/comment/44145650
has title: How to access keydown via function?
has comment: http://stackoverflow.com/comment/44145459
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44145267
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/203198
score: 0
has answer: http://stackoverflow.com/a/27871452
has comment: http://stackoverflow.com/comment/44145285
has comment: http://stackoverflow.com/comment/44145237
has comment: http://stackoverflow.com/comment/44145350
type: UnansweredQuestion
has body: I need to make sure input on dynamically generated input fields accept only numbers. This jsfiddle is doing exactly what I want but it isn't allowing for dynamically generated fields: http://jsfiddle.net/lesson8/HkEuf/1/. I've modified it to work with a function but it isn't doing anything. Any ideas what I'm doing wrong? HTML: Number : &lt;input onkeydown="test(this);" type="text" name="quantity" id="quantity" /&gt;&amp;nbsp;&lt;span id="errmsg"&gt;&lt;/span&gt; Javascript: function test(input) { //called when key is pressed in textbox input.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 &lt; 48 || e.which &gt; 57)) { //display error message $("#errmsg").html("Digits Only").show().fadeOut("slow"); return false; } }); } CSS: #errmsg { color: red; } Function version: http://jsfiddle.net/HkEuf/4776/
has answer: http://stackoverflow.com/a/27871410
tagged with: css

http://stackoverflow.com/a/27889831
answers question: http://stackoverflow.com/q/27889762
type: Answer
has comment: http://stackoverflow.com/comment/44229160
has body: Use _.has when you need a safe reference to hasOwnProperty: if (!_.has(array[i], 'age')) {
score: 5
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/44180897

http://stackoverflow.com/comment/44109914
type: QuestionComment
score: 0
has text: I thought I remembered it was something to do with the `question` being inside an ng-repeat, but I'll add more code sorry.
comment on: http://stackoverflow.com/q/27852955
type: Comment

http://stackoverflow.com/comment/44182150
score: 0
comment on: http://stackoverflow.com/a/27885329
type: Comment
has text: Please suggest any resolution guys..Thanks
type: AnswerComment

http://stackoverflow.com/q/27823627
has answer: http://stackoverflow.com/a/27824295
answer count: 5
tagged with: css
has answer: http://stackoverflow.com/a/50344439
accepted answer: http://stackoverflow.com/a/27824258
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/35429502
type: Question
has answer: http://stackoverflow.com/a/50018157
upvote count: 5
has body: I'm using twitter bootstrap 3 to display tooltip <td class = "skills" data-toggle="tooltip" data-placement="left" data-original-title="<?php echo $row['skills']; ?>"><?php echo $row['skills']; ?> and it shows well but when I hover on it, it shift each cell to right. how to fix that? I've attached two snapshots and you can see it's shifting towards right. Edit I'm adding a test table here, what it does, displays tooltip in next td and data of that td shifted right. Serial Name Rating 1 A php 2 B C# and here is js
has comment: http://stackoverflow.com/comment/44053597
has comment: http://stackoverflow.com/comment/44053213
score: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27824258
possible better answer: http://stackoverflow.com/a/27824295
has title: Tooltip issue with twitter bootstrap

http://stackoverflow.com/q/27897741
score: 2
has answer: http://stackoverflow.com/a/27899838
downvote count: 0
tagged with: javascript
has body: I've found some questions that seems has some relationship with this question(eg:Why is node.js only processing six requests at a time?), but I still can not understand the details. the following is my case. first, server's code: var express = require ('express'), methodOverride = require('method-override'); var app = express(); app.use(methodOverride()); app.use(function(err, req, res, next) { console.error(err.stack); res.status(500); res.send({ error: err }); }); app.use('/', function(req, res, next) { res.header('Cache-control', 'no-cache'); res.header('Access-Control-Allow-Origin', '*'); next(); }); app.get('/OK/', function (req, res) { console.log(getTimestamp() + ' OK '); res.status(200).send("200"); }); app.listen(22222); function getTimestamp(){ var timestamp = new Date(); return timestamp.toString() + " " + timestamp.getMilliseconds(); } console.log(getTimestamp() + ' Sever started!'); and then, the client's code: var http = require('http'); var opt = { method: "GET", host: "localhost", port: 22222, path: "/OK/", headers: { 'Cache-control': 'no-cache' } }; count = 10; function request(){ var req = http.request(opt, function (serverFeedback) { var body = ""; serverFeedback .on('data',function(){}) .on('end', function () { console.log(getTimestamp(), "response END", serverFeedback.statusCode, body); }); }); req.end(); console.log(getTimestamp(), "resuest START"); count--; if(count &gt; 0){ setTimeout(request, 500); } } request(); function getTimestamp(){ var timestamp = new Date(); return timestamp.toString() + " " + timestamp.getMilliseconds(); } run both of them in node, of course run server first, the client will send 10 request in about 5s, and everything is alright. like this: But, if I remove the code about listening the "data" event in client, like this: var req = http.request(opt, function (serverFeedback) { var body = ""; serverFeedback //.on('data',function(){}) /* remove the listener*/ .on('end', function () { console.log(getTimestamp(), "response…
favorite count: 0
type: Question
tagged with: node.js
linked to: http://stackoverflow.com/q/12060869
upvote count: 2
has title: why I can only send 5 request if I don't listen the data event?
tagged with: http
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/44306366
has text: You can check out the Network panel to see if the id is set. The url should have the resource after the version number of the api, followed by the resource id. But all of this depends on how you set up your backend.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27954958
score: 1

http://stackoverflow.com/a/27850578
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27830861
has body: For the record, I wasn't able to fully reproduce your scenario... perhaps a JSbin would help. In any case, I found that ALL scripts whether same domain or other domain blocked downloading in both Chrome and Firefox. (Firefox however, has a blocking indicator on it's waterfall, so you could tell that parsing had not been blocked) As to the answer of the question "Why does Chrome do this?". Although I can't answer that part of the question, my guess is that it's probably just a not-yet-optimized condition... apparently all the dependencies in how objects can load are difficult to untangle. For example, while looking into it, I found this 4-year old Firefox bug that's still open: https://bugzilla.mozilla.org/show_bug.cgi?id=693725 As to the more interesting question of "How do I work around it?", I find that this simple line of code gets all the CSS and script files downloading as early as possible and applied asyncronously: &lt;link rel="stylesheet" type="text/css" media="later" onload="this.onload=null;this.media='screen'" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" /&gt; I checked the above in Chrome, Firefox, and IE11, and all started all downloads in parallel, and successfully applied the CSS rules from the sheets

http://stackoverflow.com/a/43664119
upvote count: 3
has comment: http://stackoverflow.com/comment/82904554
type: Answer
has body: There's always a one-liner. arrayPeople.reduce((a, o, i, p) =&gt; a + o.age / p.length, 0)); console.log(`${[{ name: 'joe', job: 'programmer', age: 25, }, { name: 'bob', job: 'plumber', age: 30, } ].reduce((a, o, i, p) =&gt; a + o.age / p.length, 0)}%`);
downvote count: 0
has comment: http://stackoverflow.com/comment/82904271
has comment: http://stackoverflow.com/comment/82904434
has comment: http://stackoverflow.com/comment/82904145
answers question: http://stackoverflow.com/q/27879827
has comment: http://stackoverflow.com/comment/82904476
score: 3
has comment: http://stackoverflow.com/comment/82904250
has comment: http://stackoverflow.com/comment/82807683
has comment: http://stackoverflow.com/comment/82825386

http://stackoverflow.com/a/27883941
has comment: http://stackoverflow.com/comment/44171732
has comment: http://stackoverflow.com/comment/44170709
has comment: http://stackoverflow.com/comment/44170786
type: Answer
has comment: http://stackoverflow.com/comment/44170913
has comment: http://stackoverflow.com/comment/45629189
upvote count: 4
has comment: http://stackoverflow.com/comment/45630272
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/27883900
has comment: http://stackoverflow.com/comment/44169980
answers question: http://stackoverflow.com/q/27883900
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44169923
has body: You can use Alasql JavaScript SQL library, which has special functionality to read XLSX files and put in HTML page. It uses js-xlsx library to read XLSX files. Disclaimer: I am the author of Alasql. In this example: Alasql takes Excel file from cdn.rawgit.com (you can replace it with your address Alasql put result table to DIV with id="res" - you can change the name or add CSS to prettify result table {headers:true} flag means that Alasql reads and writes headers You can read CSV files as well - just replace XLSX() to CSV() in the example For production purpose download alasql.min.js and xlsx.core.min.js to your server or use CDN. See the working code snippet below: alasql('select * into html("#res",{headers:true}) \ from xlsx("https://cdn.rawgit.com/agershun/alasql/version-0.0.36/test/test168.xlsx",\ {headers:true})') &lt;script src="https://cdn.jsdelivr.net/alasql/0.3/alasql.min.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.7.12/xlsx.core.min.js"&gt;&lt;/script&gt; &lt;div id="res"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/44169792

http://stackoverflow.com/q/27948945
has body: I have an iframe that opens a new webpage. In that webpage, I want to access a function on the window of the iframe. I try to call window.opener.myFunction(), but the opener is the &lt;iframe&gt;'s parent window, and not the &lt;iframe&gt;'s window. Because of the dynamic nature of the page, I don't want to explicitly get the contentWindow of the &lt;iframe&gt; from the parent window. Does anyone know of a workaround?
upvote count: 2
tagged with: iframe
has comment: http://stackoverflow.com/comment/44294496
answer count: 1
has title: How do I get the iframe that opened a window in JavaScript from Internet Explorer?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44293406
has comment: http://stackoverflow.com/comment/44293788
score: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44293474
favorite count: 0
has answer: http://stackoverflow.com/a/27949176
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44293398

http://stackoverflow.com/a/27851826
type: Answer
accepted answer of: http://stackoverflow.com/q/27851747
answers question: http://stackoverflow.com/q/27851747
score: 2
downvote count: 0
has body: Iterate through the collection and its objects using _.each()* method and replace the values equal to "null" with the empty string. So the logic is the same as you were iterating through two-dimensional array using nested loop. * I don't suggest to use _.map() here since this method will produce new modified array and I don't know if you need this, though if you want you can also map the array using _.each(obj) inside the mapping function. var arr, searchVal, replaceVal; arr = [ {id: 1, name: "Piano", class: "Instrument"}, {id: 2, name: "Guitar", class: "null"}, {id: 3, name: "null", class: "null"} ]; searchVal = "null"; replaceVal = ""; _.each(arr, function(obj) { _.each(obj, function(value, key) { if(value === searchVal) { obj[key] = replaceVal; } }); }); console.log(arr); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"&gt;&lt;/script&gt;
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/27809048
type: Answer
answers question: http://stackoverflow.com/q/27809007
score: 2
has body: So my question is, is there a way to pass the scope of readDirectory to the callback function that's defined outside? No, JavaScript has lexical scope. However, you can make filterList accept a callback: function readDirectory(callback){ fs.readdir('./', filterList(callback)); } function filterList(callback) { return function(err,data){ if(err) callback(err); callback(); }; }
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27809007
upvote count: 2
has comment: http://stackoverflow.com/comment/44027304
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44027325

http://stackoverflow.com/q/27948373
score: 0
linked to: http://stackoverflow.com/q/4616694
tagged with: core-elements
type: Question
tagged with: polymer
has body: I'm trying to avoid event capturing in a polymer custom element, so I want to trigger an event only when is provoke by the ['items'] contained in the element. I have two different custom elements. Both custom elements are extending core-selector. One is wrapping the other. So I have something like: I'm a parent I'm a child I'm a child I'm a child I'm a parent I'm a parent Custom elements definition has it's own core-Selected event handler. has no script neither event handlers. My goal: Only when a item from is selected the event is triggered. I want to maintain the components independence, so I would like not to modify the child. Situation Based on this answer I'm stopping the method checking the item received, but I think is not a proper solution... onCoreSelect: function (event, detail, sender) { if (!detail.item.classList.contains('child')) { return; //Dislike! } ); ...because I would like even not trigger the method. You can reproduce it in this Plunker. onCoreSelect writes details, but only selecting parents should do it. As you can see, when clicking any children it triggers the event. Thx!
has answer: http://stackoverflow.com/a/27967860
tagged with: javascript
tagged with: inheritance
tagged with: web-component
answer count: 1
has title: Avoid event capturing
linked to: http://stackoverflow.com/q/20891046
type: UnansweredQuestion

http://stackoverflow.com/a/27865894
accepted answer of: http://stackoverflow.com/q/27862320
answers question: http://stackoverflow.com/q/27862320
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44144506
has body: The probably simplest solution would be to add a deferred to each toast and only start to animate the toast when the limit is not or no longer reached. You start by adding a deferred and resolve it immediately, if the limit is not reached yet or the limit can be ignored: toast.slotOpen = $q.defer(); toasts.push(toast); if (maxOpened &amp;&amp; toasts.length &lt;= maxOpened || !maxOpened) { // i guess 0 or a falsy value means to ignore the limit toast.slotOpen.resolve(); } You only start the animation, when a slot is open: toast.slotOpen.promise.then(function() { $animate.enter(toast.el, body).then(function() { The last thing to do is to resolve the deferred when a new slot gets opened after an old toast has been removed: $animate.leave(toast.el).then(function() { var index = toasts.indexOf(toast); toasts.splice(index, 1); if (maxOpened &amp;&amp; toasts.length &gt;= maxOpened) { toasts[maxOpened - 1].slotOpen.resolve(); } I have adjusted your code and created a new Plunker.
type: Answer

http://stackoverflow.com/q/27911408
downvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27911500
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44222595
accepted answer: http://stackoverflow.com/a/27911500
favorite count: 0
possible better answer: http://stackoverflow.com/a/27911477
has comment: http://stackoverflow.com/comment/44222982
has answer: http://stackoverflow.com/a/27911477
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Insert HTML only after a full word
has body: I'm using jquery to insert content after an anchor. For example, if I have the following: this is an example sentence with a link coming up (Here's the link content). More text may or may not follow here. Using the following: $("a.insertpoint").click(function() { var mapDiv = $(" "); mapDiv.insertAfter($(this)); }); The issue is that some links have brackets/braces after them and this creates an ugly split for the new div. Is there a good method to see if there's a space or end of paragraph following the link and, if not, move however many characters until a space is reached?
upvote count: 2
score: 0

http://stackoverflow.com/q/27952772
has comment: http://stackoverflow.com/comment/44307745
has body: I have a requirement where data is dynamic and very hierarchical (3- 4 level deep) where each inner level can be a list which can again contain list (please look at my template below). Everything looks good in terms of performance upto 2 ng-repeat but performance degrade sharply for level 3 onwards ng-repeat. ...... Please Note: that I have only static data I used "track by" but not sure if I used it correctly. I did tried to log if DOM is getting recreated with children ng-repeat and I do see that with every nested ng-repeat, parent DOM is getting regenerated and thats the reason performance is very bad. I also tried to refactor my data so that I can avoid nested ng-repeat but unfortunately I cannot refactor it further because it as a RDF-JSON representation. Thanks in advance!
has comment: http://stackoverflow.com/comment/44311590
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44369332
type: Question
score: 1
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
upvote count: 1
tagged with: angularjs-directive
has title: AngularJS : nested ng-repeat peformance

variables
tags question: http://stackoverflow.com/q/27842889
tag name: variables
tags question: http://stackoverflow.com/q/27846389
tags question: http://stackoverflow.com/q/27851371
tags question: http://stackoverflow.com/q/27867258
tags question: http://stackoverflow.com/q/27848983
tags question: http://stackoverflow.com/q/27960256
tags question: http://stackoverflow.com/q/27806093
tags question: http://stackoverflow.com/q/27862915
tags question: http://stackoverflow.com/q/27857498
tags question: http://stackoverflow.com/q/27963962
tags question: http://stackoverflow.com/q/27957154
tags question: http://stackoverflow.com/q/27881495
type: Tag
tags question: http://stackoverflow.com/q/27880545
tags question: http://stackoverflow.com/q/27944953
tags question: http://stackoverflow.com/q/27850153
tags question: http://stackoverflow.com/q/27915947
tags question: http://stackoverflow.com/q/27923582
tags question: http://stackoverflow.com/q/27963214
tags question: http://stackoverflow.com/q/27962752

http://stackoverflow.com/q/27865494
type: Question
accepted answer: http://stackoverflow.com/a/27887416
has body: Is there anything in the spec that defines a toString() method for classes? For example, let's say I define this class: class Foo { constructor() { console.log('hello'); } } If I called Foo.toString(), I'm not sure if I'll get: class Foo { constructor() { console.log('hello'); } } Or perhaps the constructor function, anonymous: function() { console.log('hello'); } Or maybe the constructor function, but it's named: function Foo() { console.log('hello'); } Or maybe just the class name: Foo
has comment: http://stackoverflow.com/comment/44134169
tagged with: javascript
score: 4
upvote count: 4
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/44133528
has answer: http://stackoverflow.com/a/27887416
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44133658
favorite count: 0
has comment: http://stackoverflow.com/comment/44133506
type: AnsweredQuestion
has title: JavaScript's classes: toString() method

http://stackoverflow.com/comment/44207624
type: Comment
comment on: http://stackoverflow.com/a/27904243
has text: holy bananas awesome! Thanks!
score: 0
type: AnswerComment

http://stackoverflow.com/a/27926835
score: 3
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44251235
type: Answer
has body: Put your code inside the for loop for (var a = 0; a &lt; table.length; a++) { table.rows[a].cells[0].addEventListener('click', function() { var ask = prompt("Input"); this.innerHTML = ask; }); table.rows[a].cells[1].addEventListener('click', function() { var ask = prompt("Input"); this.innerHTML = ask; }); //more table.rows..... } Using jQuery is very simple: $(function(){ $('table td').click(function(){ var ask = prompt("Input"); $(this).html(ask); }); });
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27926749
has comment: http://stackoverflow.com/comment/44252005
answers question: http://stackoverflow.com/q/27926749

http://stackoverflow.com/q/27938525
has title: CKEditor textarea content not displaying/not updatable (Randomly)
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
tagged with: php
has answer: http://stackoverflow.com/a/27963654
downvote count: 0
has comment: http://stackoverflow.com/comment/44284402
has comment: http://stackoverflow.com/comment/44275920
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44318402
has comment: http://stackoverflow.com/comment/44324339
tagged with: javascript
tagged with: ckeditor
score: 4
has comment: http://stackoverflow.com/comment/44318240
has body: Textarea content does not display and the textarea is not editable (Happens randomly) Only when I resize the Editor (Bottom right corner handle) the content starts to appear and the Editor is editable, this bug appears randomly and only tested in Chrome. Has anyone experienced this or any solutions would be helpful? Example of my textarea: <?php echo $output; ?> And this is how I set it up: // Set the ckeditor wysiwyg editor function CKupdate(){ for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); } $( 'textarea' ).ckeditor(); CKEditor Version 4.4.6 UPDATED with Screenshots Click here to view screenshots ISSUE RESOLVED I have found the display Bug, within the output of the iframe: Working Editor: Editor with display Bug: Notice the difference in width between the two Editors/iframes, the editor which causes the issues is the one with width: 0px, somehow when you resize the browser or Editor it changes the width back to 704px. Hope this will help someone in future...
has comment: http://stackoverflow.com/comment/44274730
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/14913784
accepted answer: http://stackoverflow.com/a/27963654
favorite count: 0

http://stackoverflow.com/comment/44170144
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27884227
has text: okay?! I know it's java, I have said that in the first line. But I want to do the same thing that this script is doing with CURL ( I don't need all the progress percentage and other crap that is in the code) I just know that this code works for uploading to the server and that's why I put it here

http://stackoverflow.com/comment/44275505
type: Comment
score: 0
has text: @t.niese Works perfectly! And with so few lines of code! Thank you!! Although, I'm not entirely sure how the computer can tell the difference between variables.
type: AnswerComment
comment on: http://stackoverflow.com/a/27936917

http://stackoverflow.com/a/27899846
type: Answer
has body: You can use height of the div to get if you are reached at the bottom of the div or not and animate it in "else if". You can get height of the div using div_height = $("#InformatieDiv").height() So there will be three branches as follows: if ($window.scrollTop() &gt; offset.top){ #CODE TO STOP SCROLLING UP }else if($window.scrollTop() &lt; (offset.top + div_height)){ #CODE TO STOP SCROLLING DOWN }else{ } I hope this will help you.
accepted answer of: http://stackoverflow.com/q/27899025
answers question: http://stackoverflow.com/q/27899025
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/27830113
answers question: http://stackoverflow.com/q/27827481
type: Answer
has comment: http://stackoverflow.com/comment/44067449
has comment: http://stackoverflow.com/comment/44066915
has comment: http://stackoverflow.com/comment/44067927
upvote count: 4
has comment: http://stackoverflow.com/comment/44067732
has comment: http://stackoverflow.com/comment/44067706
has comment: http://stackoverflow.com/comment/44068168
score: 4
has comment: http://stackoverflow.com/comment/44068180
downvote count: 0
has body: The main issue here is that the parser needs to be added using $.tablesorter.addParser(), not $('.tablesorter').addParser(). jQuery.tablesorter.addParser({ id: "monetaryValue", is: function (s) { return false; }, format: function (s) { var n = parseFloat( s.replace('$','').replace(/,/g,'') ); return isNaN(n) ? s : n; }, type: "numeric" }); var tablezor = jQuery(".tablesorter"); tablezor.tablesorter({ headers: { 0 : { sorter: "monetaryValue" } }, sortList: [[1,1]] }); If you are using my fork of tablesorter, the default (automatically detected) currency parser will work with the provided currency values (demo). For currency from other countries, just set the usNumberFormat option to false.

http://stackoverflow.com/a/27837088
score: 1
type: AcceptedAnswer
has body: I solved the problem. The error is in method initMap(). I correct it as bellow: private void initMap() { mapWidget.setSize("100%", "100%"); mapWidget.setZoom(zoomLevel); mapWidget.setCenter(CENTER); }
accepted answer of: http://stackoverflow.com/q/27836161
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27836161
downvote count: 0
has comment: http://stackoverflow.com/comment/74714133

http://stackoverflow.com/a/27950950
upvote count: 2
has comment: http://stackoverflow.com/comment/44297394
has comment: http://stackoverflow.com/comment/44297093
has body: It seems you're trying to force a click event. the .click() says what to do when it's clicked - it doesn't trigger a click. Use .trigger() for that: $('#checkinfile').trigger('click'); Then you need to separately add what to do when it's clicked like this: $('#checkinfile').click(function(){ //do things here }); As for the issue with the file browser. Try this solution from this article: Position the input as position:absolute and top:*number that will remove it from viewport* and it'll work Here's the docs for .trigger()
has comment: http://stackoverflow.com/comment/44297618
has comment: http://stackoverflow.com/comment/44297503
downvote count: 0
answers question: http://stackoverflow.com/q/27950892
type: Answer
has comment: http://stackoverflow.com/comment/44297110
score: 2
has comment: http://stackoverflow.com/comment/44297275

http://stackoverflow.com/comment/44038484
score: 0
type: Comment
type: QuestionComment
has text: @OlegsJasjko I meant that: http://jsfiddle.net/g4xkzpdp/ Because IDs anyway ***must*** be unique on document context. Now you'd have better to provide online sample which replicates your issue, to make it clearer. Now i'm not an ASP guy, maybe `#Book_HasAt` is referring to a container, in this case, using `$(this)` in change handler doesn't make sense...
comment on: http://stackoverflow.com/q/27815825

http://stackoverflow.com/q/27837289
possible better answer: http://stackoverflow.com/a/42029838
accepted answer: http://stackoverflow.com/a/27837680
has answer: http://stackoverflow.com/a/42029838
tagged with: jsp
has title: Why Servlet.service() for servlet jsp threw exception java.lang.NullPointerException?
has comment: http://stackoverflow.com/comment/44079257
has comment: http://stackoverflow.com/comment/44079087
has answer: http://stackoverflow.com/a/27837680
type: AnsweredQuestion
tagged with: java
has comment: http://stackoverflow.com/comment/44079047
linked to: http://stackoverflow.com/q/14394489
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44079171
tagged with: servlets
tagged with: google-maps-api-3
has body: I want to send data from javascript to managedbean via servlet but the problem is that first time code works fine but when i returned to the original jsp page containing javascript code and again click on submit button to move to servlet the values are shown in console but an error occur and redirection to jsp page fails. JSP page containing javascript: <%@page contentType="text/html" pageEncoding="UTF-8"%> TODO supply a title GeofencingServlet: @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(" "); out.println(" "); out.println(" Zone created successfully. "); out.println("Click here!to go back to Map"); out.println(" "); out.println(" "); // String str = request.getParameter("vertices"); String str = request.getParameter("data"); System.out.println("str in servlet" + str); MapBean mapBean = new MapBean(); String strret = mapBean.geo(str); System.out.println("servlettttt string returned by mapbean" + strret); ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); context.redirect(context.getRequestContextPath() + "/gefencingJason.jsp?str=" + strret); } MapBean: public String geo(String str) throws IOException { System.out.println("The data in map bean is str" + str); str1 = "my string"; return str; } I have following error: WARNING: StandardWrapperValve[GeofencingServlet]: Servlet.service() for servlet GeofencingServlet threw exception java.lang.NullPointerException at servlet.GeofencingServlet.doGet(GeofencingServlet.java:60) 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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.ap…
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44078901

http://stackoverflow.com/a/47033176
type: Answer
has body: In PHPStorm 2017 (and, I assume, by extension WebStorm) that behavior can be achieved by: going to Settings > Editor > Code Style > JavaScript Wrapping and Braces tab scroll down to Variable declarations and set Align to When Grouped Additionally, setting Variable declarations to Wrap always will result in this when reformatting: Update: unchanged in version 2018 and in WebStorm/PHPStorm version 2019, the steps I described above still work the same.
upvote count: 14
score: 14
downvote count: 0
answers question: http://stackoverflow.com/q/27853422

http://stackoverflow.com/q/27831381
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27836752
has title: Whitespace In AngularJS Jade templates
score: 0
has comment: http://stackoverflow.com/comment/44069502
tagged with: pug
has comment: http://stackoverflow.com/comment/44076682
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27836752
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44069522
has body: I have the following problem: p directive(attr="foo") | ( directive(attr="bar") |) Desired output is: ( ) But the way Jade is processed the whitespace is introduced after the first parentheses like: ( ) Is there a way to ignore the whitespace after the first parentheses? Or should I find a workaround with Angular maybe?
type: Question

http://stackoverflow.com/comment/44234160
score: 0
type: AnswerComment
has text: I have tried var x = document.getElementById("from").value; still the submit resets the content and changed code as per ur suggestion
type: Comment
comment on: http://stackoverflow.com/a/27917562

http://stackoverflow.com/comment/44092466
has text: What exactly do you need? spell it out. To me it looks like your comparison function is the problem, but you seem to be completely ignoring that possibility which I think is where all this confusion is coming from.
comment on: http://stackoverflow.com/q/27843673
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44099143
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27847616
has text: Why not just overwritting update() method?
score: 0

typeahead
type: Tag
tags question: http://stackoverflow.com/q/27951701
tags question: http://stackoverflow.com/q/27910012
tag name: typeahead

http://stackoverflow.com/comment/44114712
type: Comment
comment on: http://stackoverflow.com/a/27835595
score: 0
has text: Can you create a small demo of your code on jsfiddle.net . We don't have a sufficient enough insight into your code, as of now.
type: AnswerComment

http://stackoverflow.com/q/27895619
answer count: 1
has comment: http://stackoverflow.com/comment/44192697
accepted answer: http://stackoverflow.com/a/27896006
tagged with: javascript
has answer: http://stackoverflow.com/a/27896006
tagged with: pie-chart
type: AnsweredQuestion
tagged with: highcharts
downvote count: 0
score: 1
favorite count: 0
has body: I'm trying to draw multiple pie-charts in the same chart with HighCharts. JSFIDDLE DEMO I have enabled the legend for each pie-chart. Now two legends for the 2 charts are shown at the bottom (notice that 2 items for each entry are visible in the legend). When I click on an item of the legend it shows/hides a piece in one pie-chart... But I want to achieve either of followings, I want to have a single legend for both charts so that relevant piece of both pie-charts disappears/appears when I click on an item of the legend. I want to show only one legend and disable it so that clicking doesn't hide/show pieces of pie-charts. Anybody knows a way to achieve either? Thank you in advance...
type: Question
has comment: http://stackoverflow.com/comment/44192539
has title: Multiple pie-charts in the same chart with HighCharts
upvote count: 1

http://stackoverflow.com/comment/44076045
type: Comment
type: QuestionComment
score: 1
has text: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) is not yet a standard. jQuery and Angular have their own implementation of promises and not necessarily functionally equivalent to Promise. Also "trying to implement native promise" is an oxymoron. :)
comment on: http://stackoverflow.com/q/27835687

http://stackoverflow.com/q/27948287
has answer: http://stackoverflow.com/a/27948371
tagged with: javascript
has answer: http://stackoverflow.com/a/37134120
answer count: 3
has answer: http://stackoverflow.com/a/52450925
downvote count: 0
tagged with: jquery
favorite count: 0
has title: How to select elements of document inside object
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 3
upvote count: 3
has body: I'm trying to make page which works like browser inspector. Basically I would like to be able to click on element of page and get an Xpath for that element. I created simple page that uses jQuery to load another page into div, but i'm stuck on getting to that inner page elements. Here is my code: using $("#page").find("object") selector I can reach to object, but i haven't found way to reach deeper to elements of document inside that object. Is there any way to select elements of that inner page or maybe there is a better way to do what I want to?
tagged with: dom
type: Question

http://stackoverflow.com/comment/44173422
type: AnswerComment
has text: @Musa My humble excuses. It was too late at night when I wrote that comment in retrospect. :-) You are absolutely right. There're properties.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27881632

http://stackoverflow.com/a/27833477
type: Answer
answers question: http://stackoverflow.com/q/27833401
has body: To avoid frequent pops up and down use mouseenter $(function() { $('.toggler'). mouseenter(function() { $(this).find('div').slideToggle(); }); }); See the demo here
score: 0

http://stackoverflow.com/comment/44243909
has text: Thanks @EdCottrell, Really appreciate the prompt answer.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27923298
type: Comment

http://stackoverflow.com/comment/114207742
score: 0
type: Comment
comment on: http://stackoverflow.com/a/48218209
has text: The `isObject` check is naive. Use this instead: `(obj+"") === "[object Object]"`
type: AnswerComment

http://stackoverflow.com/comment/44065990
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27829153
has text: See updated answer using classes instead of ids. It puts less overhead on your server, especially when there are a ton of descriptions on the page.
type: AnswerComment

http://stackoverflow.com/q/27931261
has body: I’m new to to d3 and have combined mbostock’s stacked bar graph example ( http://bl.ocks.org/mbostock/3886208 ) with a map to show data (canada.json) I would like the graph to display an updated chart on the d3.mouseover event of the province: http://gao8a.github.io/ (something like this) Unfortunately, I was only able to get the axises to display. It's showing either multiple or the same axis overlapping: (These will take ~ 3 seconds to load) Multiple: http://bl.ocks.org/GAO8A/566e238a72e5ebd1e2c1 Same Axis overlap http://bl.ocks.org/GAO8A/64f94bb494c4a73f2bf6 I understand I probably need a ‘mouseout’ event to delete the previous but I’m not quite sure how to design that either. Can anyone point out what I’m doing wrong and how I should be loading the data? PS: I was going to make a jsfiddle but can’t seem to get it to get it to work with my hosted canada.json data. https://raw.githubusercontent.com/GAO8A/GAO8A.github.io/master/canada.json Thanks
has title: Updating D3.js graph on mouseover event
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
upvote count: 2
tagged with: d3.js
has answer: http://stackoverflow.com/a/28022525
accepted answer: http://stackoverflow.com/a/28022525
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/27958108
tags question: http://stackoverflow.com/q/27824609
tags question: http://stackoverflow.com/q/27934286
tags question: http://stackoverflow.com/q/27956284
tags question: http://stackoverflow.com/q/27959987

http://stackoverflow.com/q/27891366
has answer: http://stackoverflow.com/a/27892287
tagged with: encryption
downvote count: 1
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27892291
score: -1
has title: How to compare array values with another set of array values in javascript
answer count: 2
has body: I am trying to make a playfair cipher square generator. If you know what that is then you know that you have a key that then goes in to a square where the rest of the alphabet that isnt in the key gets entered in alphabetical order(also the J key is removed). So at the moment I have this function: function square(usrInputKey){ var alpha = ["A","B","C","D","E","F","G","H","I","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; var key = usrInputKey.toUpperCase() keyword = key.split('') var keysquare=keyword count=keyword.length for (var p=0;p&lt;alpha.length;p++) { //document.write(" Alpha: " + alpha[p] + "&lt;br&gt;") if ( keyword[0] != alpha[p] &amp;&amp; keyword[1] != alpha[p] &amp;&amp; keyword[2] != alpha[p] ) { keysquare[count]=alpha[p] count++ } } return keysquare } That function has the input of the keyword that is the word key for testing perposes. This function works, output is: K,E,Y,A,B,C,D,F,G,H,I,L,M,N,O,P,Q,R,S,T,U,V,W,X,Z However it only works if keyword is the length of 3 characters. I would like it if it works with a keyword of any amount rather than hard code the 3 or have and statements for different possible lengths. I have tried .every() but that just checks the array characters one at a time and ouputs the key and then the full alphabet including the letters that were in the key. Can anyone solve this issue? or does it have to be hardcoded to a certain key length?
tagged with: arrays
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27892291
accepted answer: http://stackoverflow.com/a/27892287
tagged with: compare
upvote count: 0

http://stackoverflow.com/comment/44180660
has text: @Boann thanks a lot, going to look into it
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27889800
score: 0

http://stackoverflow.com/comment/44169258
score: 0
type: Comment
has text: You can also make a custom filter to turn an object into an array on the fly in the expression/template.
comment on: http://stackoverflow.com/a/27883354
type: AnswerComment

http://stackoverflow.com/comment/44211200
type: AnswerComment
has text: Actually i'll be happy to get the code to handle when the file is chosen.
type: Comment
comment on: http://stackoverflow.com/a/27905640
score: 0

http://stackoverflow.com/a/27810814
score: 0
answers question: http://stackoverflow.com/q/27810717
type: Answer
has body: Try putting all of your code inside this document.addEventListener("DOMContentLoaded", function(event) { //Your code here }); My guess is that your code is executed before the html actually finished loading, causing it to return null.

http://stackoverflow.com/comment/44270275
comment on: http://stackoverflow.com/q/27936607
score: 0
has text: You're absolutely right about that possibility. But in my use-case, that's very, very unlikely. And, even if *does* occur, the result is not damaging based on what I'm doing. I'm not comparing random URLs on the internet; this is all part of an app (CodeKit) displaying local web projects. Thanks!
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27889528
has answer: http://stackoverflow.com/a/27902668
accepted answer: http://stackoverflow.com/a/27902668
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: oracle-apex
has body: I am trying to make an Apex website functional with Javascript disabled. The website makes use of sometimes multiple submit buttons on a single page. It uses Javascript function apex.submit(request name, e.g. 'SAVE' or 'CANCEL') to submit a request on a click of a button, which then can be differentiated based on its name. Is there any way to submit specific request, i.e. 'SAVE' without the use of Javascript?
tagged with: oracle-database
answer count: 1
downvote count: 0
favorite count: 0
has title: How to make multiple submit buttons work on Oracle Apex without Javascript?

http://stackoverflow.com/comment/44152087
has text: Ill help you re-write this using plain js if need be, before we do though, can you try changing `$("#coffeeButton").click(function(e)` to `$("body").on("click", "#coffeeButton", function(e)`
comment on: http://stackoverflow.com/q/27875085
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44211254
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27905941
type: Comment
has text: Tanks! this is very clear. I have to change the way i have to do it, making an oauth like facebook do with the connect method and not using the grand_type=password.I will use Authorization with refresh_token.

http://stackoverflow.com/a/45209456
answers question: http://stackoverflow.com/q/27936772
type: Answer
upvote count: 1
score: 1
has body: function isObject(obj) { return obj !== null &amp;&amp; typeof obj === 'object'; } const isArray = Array.isArray; function isPlainObject(obj) { return isObject(obj) &amp;&amp; ( obj.constructor === Object // obj = {} || obj.constructor === undefined // obj = Object.create(null) ); } function mergeDeep(target, ...sources){ if (!sources.length) return target; const source = sources.shift(); if (isPlainObject(source) || isArray(source)) { for (const key in source) { if (isPlainObject(source[key]) || isArray(source[key])) { if (isPlainObject(source[key]) &amp;&amp; !isPlainObject(target[key])) { target[key] = {}; }else if (isArray(source[key]) &amp;&amp; !isArray(target[key])) { target[key] = []; } mergeDeep(target[key], source[key]); } else if (source[key] !== undefined &amp;&amp; source[key] !== '') { target[key] = source[key]; } } } return mergeDeep(target, ...sources); } // test... var source = {b:333}; var source2 = {c:32, arr: [33,11]} var n = mergeDeep({a:33}, source, source2); source2.arr[1] = 22; console.log(n.arr); // out: [33, 11]
has comment: http://stackoverflow.com/comment/134081699
downvote count: 0

http://stackoverflow.com/q/27906665
type: Question
has body: I am really new to JS and have a project in Adobe Edge Animate that is being served to many running n IE8 browser with a special 508/WCAG2.0 requirement. This means alt tags and tabindex functions are a MUST for their visually impaired staff (using web page readers like JAWS). How can I add this functionality to the Down-Level stage? I have opened the edge_preload.js file and have added multiple combinations of: alt: '....', title: '....', tabindex: '....', tag: "&lt;a href="" alt=""&gt;&lt;img src="" /&gt;&lt;/a&gt;", I've also tried encapsulating in square brackets, i.e. [ syntax ] and nothing results in alt tags popping up when viewing the Down-level page. It almost seems like alt and title tags are completely ignored by IE8. Please help and thank you so much for your time. edit - 1/13/2015 In doing more research I downloaded a copy of JAWS V15.0 (40 minute trial) and found that it doesn't read the Down-Level stage AT ALL. Tabbing jumps right over all of the content from one of the top IE toolbars to the bottom of the IE window status bar. Somebody out there, please help with some hint or something new to try...
tagged with: internet-explorer-8
tagged with: javascript
tagged with: adobe-edge
answer count: 1
downvote count: 0
has title: accessibility in Edge Animate Down-level Stage
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28028092
score: 2
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/44098240
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27828901
has text: How is `taskkill /F /IM` getting added to the `cmd`?
score: 0

http://stackoverflow.com/a/27840661
has comment: http://stackoverflow.com/comment/54196766
type: Answer
score: 26
upvote count: 26
has body: React.createClass(spec) returns a component. React.createElement(component, props, ...children) creates an element. React.createFactory(component) returns a factory function, which can be used to create an element. React.createFactory(a)(b, c, d) is the same as React.createElement(a, b, c, d). You get the warning when you call a component directly, like component(). If you want to call it like a function, use createFactory var factory = React.createFactory(component); var element = factory(props, ...children); Or use createElement: var element = React.createElement(component, props, ...children); In 0.13 this will give an error instead of a warning: var element = component(props, ...children); Also because React.DOM is going away, you should create dom elements the same way you create component based elements Edit: looks like React.DOM is sticking around for now. var div = React.createFactory('div'); var element = div(props, ...children); // or var element = React.createElement('div', props, ...children); Bold used to show consistent terms. ...children means any number of child arguments
accepted answer of: http://stackoverflow.com/q/27826872
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27826872

http://stackoverflow.com/a/27813391
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27813308
has body: Waht is run_prettify.js? A Javascript module [...] that allows syntax highlighting of source code snippets in an html page. [source] Why it is used? Because people want to syntax highlight source code.

http://stackoverflow.com/comment/44281149
has text: Does your js file is containing the desired datas ? You really don't need jquery to do a console.log. Just leave your script as it was in your question.
comment on: http://stackoverflow.com/a/27939563
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44086245
score: 0
type: Comment
type: QuestionComment
has text: If you have already loaded it in one page then it will be cached for all subsequent pages and shouldn't be a drag on resources. You could always create a special header file for the one page.
comment on: http://stackoverflow.com/q/27841296

jquery-ui
tags question: http://stackoverflow.com/q/27902654
tags question: http://stackoverflow.com/q/27885313
tags question: http://stackoverflow.com/q/27957634
tags question: http://stackoverflow.com/q/27858926
tags question: http://stackoverflow.com/q/27914941
tags question: http://stackoverflow.com/q/27814421
tags question: http://stackoverflow.com/q/27885598
tags question: http://stackoverflow.com/q/27914976
tags question: http://stackoverflow.com/q/27906452
tags question: http://stackoverflow.com/q/27958883
tags question: http://stackoverflow.com/q/27902293
tags question: http://stackoverflow.com/q/27952345
tags question: http://stackoverflow.com/q/27903491
tags question: http://stackoverflow.com/q/27871428
tags question: http://stackoverflow.com/q/27850728
tags question: http://stackoverflow.com/q/27857487
tags question: http://stackoverflow.com/q/27959007
tags question: http://stackoverflow.com/q/27873908
tags question: http://stackoverflow.com/q/27920387
tags question: http://stackoverflow.com/q/27911106
tags question: http://stackoverflow.com/q/27883792
tags question: http://stackoverflow.com/q/27887657
tags question: http://stackoverflow.com/q/27952303
tags question: http://stackoverflow.com/q/27907624
tags question: http://stackoverflow.com/q/27939496
tags question: http://stackoverflow.com/q/27850921
tags question: http://stackoverflow.com/q/27932544
tags question: http://stackoverflow.com/q/27824200
tags question: http://stackoverflow.com/q/27940900
tags question: http://stackoverflow.com/q/27937644
tags question: http://stackoverflow.com/q/27834724
tags question: http://stackoverflow.com/q/27928793
tags question: http://stackoverflow.com/q/27928836
tags question: http://stackoverflow.com/q/27858229
tags question: http://stackoverflow.com/q/27935871
tags question: http://stackoverflow.com/q/27914076
type: Tag
tag name: jquery-ui
tags question: http://stackoverflow.com/q/27880181
tags question: http://stackoverflow.com/q/27817806

http://stackoverflow.com/a/27909899
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/44219193
has comment: http://stackoverflow.com/comment/44219175
has comment: http://stackoverflow.com/comment/44219449
has comment: http://stackoverflow.com/comment/44219387
has body: You should empty the list before you loop to populate it, then just continue doing what you are already doing. var obj = JSON.parse(data); $('#pCodeComment').empty(); $.each(obj, function(index, item) { $('&lt;li&gt;'). text(item.datestamp+' - '+item.comment). appendTo($('#pCodeComment')); }); And after optimizing a little bit: var obj = JSON.parse(data); // i'm assuming `obj` is an array var htmlToInsert = obj.map(function (item) { return '&lt;li&gt;' + item.datestamp + ' - ' + item.comment + '&lt;/li&gt;'; }).join(''); $('#pCodeComment').html(htmlToInsert); Note: the above is vulnerable to XSS. See this so question for ways to fix it, or just use the original.
has comment: http://stackoverflow.com/comment/44219420
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44219538
has comment: http://stackoverflow.com/comment/44219404
answers question: http://stackoverflow.com/q/27909834
type: Answer
accepted answer of: http://stackoverflow.com/q/27909834

http://stackoverflow.com/comment/72293484
score: 0
comment on: http://stackoverflow.com/a/27860934
has text: Hey @Pavlo, thank you for feedback. It did not work with <selects> / dropdowns because I only made the code example working for <inputs>. It is pretty straight forward to code the equivalence. Have updated the answer with a new code example and a new (working) fiddle.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44044376
type: QuestionComment
has text: The code *before* your edit looked like it would work. The code *after* your edit obviously isn't real code with that comment in it, so how are we to guess what is wrong with your *real* code? At least show that line without a place-holder comment. Do you get any errors in the browser's dev console?
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27819108

http://stackoverflow.com/comment/44343329
comment on: http://stackoverflow.com/a/27936083
score: 0
type: Comment
has text: that's not strange, it's the expected behavior.. you are binding the function to the scroll event so if you don't stop it from happening by specifying the conditions then it will fire every time you scroll. Add `console.log($(window).scrollTop());` inside the `.scroll(function());` and you will see what I mean
type: AnswerComment

http://stackoverflow.com/comment/44051782
type: Comment
comment on: http://stackoverflow.com/a/27822879
type: AnswerComment
has text: This works so long as there isn't a nested object called `object`. It's not entirely clear from the OP if the top level object is always proceeded by the text `object` and whether or not the nested object might be called `object`.
score: 0

http://stackoverflow.com/comment/44086375
type: Comment
has text: I want to avoid blocking the user posting HTML, I just don't want it rendered on the screen. The backend matches only URLs and can do what I want with them (turn into links for example) but the HTML of the user is also turned into HTML
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27841206

http://stackoverflow.com/q/27930460
has comment: http://stackoverflow.com/comment/44258661
type: UnansweredQuestion
has body: I want to create a game where by a group of users (any number) play in a room for a instance, and this group all get notified when something happens (by any of the users). when you say "Publications and Subscriptions", will it work if I create random publication.. I guess what am trying to say is .. what if I have 3 different groups, and I want them all to have different interaction with db and the notification will only happen with in that group Is meteor a good solution for this?
type: Question
has comment: http://stackoverflow.com/comment/44275862
tagged with: javascript
tagged with: meteor-publications
score: 0
has title: Meteor Publications and Subscriptions group of users
has answer: http://stackoverflow.com/a/27930688
answer count: 1
tagged with: meteor
tagged with: subscription

http://stackoverflow.com/comment/44054688
type: QuestionComment
score: 0
has text: Did you register jscript.dll using an elevated prompt?
comment on: http://stackoverflow.com/q/27824313
type: Comment

http://stackoverflow.com/q/27889238
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27889290
has title: Output random item from javascript array
type: Question
has answer: http://stackoverflow.com/a/27889272
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44179407
accepted answer: http://stackoverflow.com/a/27889272
score: 0
answer count: 2
has body: So I have this code: $('.submit_button').click(function() { var optionsArray = $(".inputID").map(function() { return this.value; }).get().join(","); var randomOutput = optionsArray[Math.floor(Math.random()*optionsArray.length)]; console.log(randomOutput); }); What I'm trying to do upon clicking the button (.submit_button) is for it to take the user entered data (they are inputs with the class .inputID), store them in an array (which i have done and it works) and then console.log (at least for now while I'm testing) one of the inputs at random. What it currently does is just console.logs a single character instead of a whole item from the array. What am I doing wrong?
possible better answer: http://stackoverflow.com/a/27889290

http://stackoverflow.com/comment/44112575
score: 0
type: Comment
has text: and what should i do when the user click on logout which is in that website? how my SPA come to know that user has clicked on logout?
type: AnswerComment
comment on: http://stackoverflow.com/a/27841897

http://stackoverflow.com/comment/44307667
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27956348
has text: why do you use compile? why not link? in any case, take a look [here](http://stackoverflow.com/questions/12240639/angularjs-how-can-i-run-a-directive-after-the-dom-has-finished-rendering)
score: 0

http://stackoverflow.com/a/27953433
has comment: http://stackoverflow.com/comment/44302802
answers question: http://stackoverflow.com/q/27953262
type: AcceptedAnswer
has body: It is because your button is of type=submitand is causing a postback, change: &lt;input type="submit" id="oppyBtn" class="btnOppy" onclick="displayTextArea()" value="Yes" /&gt; to &lt;input type="button" id="oppyBtn" class="btnOppy" onclick="displayTextArea()" value="Yes" /&gt;
has comment: http://stackoverflow.com/comment/44302356
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27953262
has comment: http://stackoverflow.com/comment/44322769

http://stackoverflow.com/q/27890182
has comment: http://stackoverflow.com/comment/44181918
tagged with: post
has body: So I'm learning Express.js and Node.js and I've got a simple site that on POST request on a page, it uses an API to gather images, then displays them on the page. I basically have a middleware function that gathers the image links from the post parameter and puts them into a global array, then the post routing function renders the page with the links. It does this successfully but if I go back and then try with a different image set it'll just instantly dump out the previous results as if nothings changed - if I then hit refresh it gives me the correct images. I don't understand what's happening.. I also tried clearly the global array after rendering the page but no improvements. I've done it on multiple devices. E.g. Use laptop to load up image set 1, it'll display image set one, then use mobile to load up image set 2, and it'll display image set 1, if I then refresh on mobile I'll get image set 2. Ideas?
type: Question
has comment: http://stackoverflow.com/comment/44181551
tagged with: javascript
tagged with: express
score: 0
answer count: 1
type: UnansweredQuestion
has title: Node.js retaining POST data after rendering page even on multiple devices?
tagged with: node.js
has answer: http://stackoverflow.com/a/27890544

http://stackoverflow.com/comment/44201429
has text: See: [***How can I get a list of the differences between two JavaScript object graphs?***](http://stackoverflow.com/questions/264430/how-can-i-get-a-list-of-the-differences-between-two-javascript-object-graphs) and [***Generic deep diff between two objects***](http://stackoverflow.com/questions/8572826/generic-deep-diff-between-two-objects). Please search the site before posting.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27900939

http://stackoverflow.com/q/27944028
answer count: 3
upvote count: 1
has body: I have a Dynamic Table which can have an undefined number of rows, every row with a defined number of Columns and inside every column, always the same Input/Control, like this: Also, rows can be erased (I figured a way to loop into it, by giving number values to every row, tr1, tr2, tr3, but as i said, any row can be erased by the user, also, was a really dirty solution). I need to obtain all the values/text inside every control and send the data through ajax to a PHP File for to make an insert of every row. I been thinking on some ways to do this, but the problem is that I don't have idea how to loop into the table and get the values of the Inputs and the TextArea.
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/27944106
has title: Looping into a Table and getting values from different Inputs inside the Columns
downvote count: 0
has answer: http://stackoverflow.com/a/27945189
accepted answer: http://stackoverflow.com/a/27945189
tagged with: loops
tagged with: php
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27944280
score: 1
has answer: http://stackoverflow.com/a/27944106
has comment: http://stackoverflow.com/comment/44283442
tagged with: html-table

http://stackoverflow.com/comment/44173557
comment on: http://stackoverflow.com/a/27886197
type: Comment
has text: If such edge cases exist, the regular expression should be updated indeed. It also does not group the strings as `XXX_1_XXX`and `YYY_1_YYY` as requested, but that's next to impossible with a regular expression if the sorting is not done before parsing.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27957934
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27958006
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
type: Question
possible better answer: http://stackoverflow.com/a/27958006
type: AnsweredQuestion
score: 1
has body: I have a HTML table as following, And wanted to get all parent_tr after display-order="-1" ... .... //no of `td`s in each row .... .... .... .... .... .... .... .... .... .... .... .... .... .... . . Here is my JavaScript(jQuery) what I'm trying: $(".parent_tr[display-order!='-1']").nextAll(".parent_tr"); //Console output - [ ​…​ , ​…​ , ​…​ ​, ​…​ ​, ​…​ ,..]
answer count: 2
has answer: http://stackoverflow.com/a/27957960
accepted answer: http://stackoverflow.com/a/27957960
upvote count: 1
tagged with: javascript
has title: jQuery nextAll after certain element

http://stackoverflow.com/comment/44219424
has text: Thanks, that seemed to resolve the issue. I guess I didn't write the script properly to begin with. I just assumed the property was automatically checked.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27896030

http://stackoverflow.com/q/27816803
has comment: http://stackoverflow.com/comment/44041399
type: Question
has title: Button is not working in Combobox menu
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27817666
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44042831
type: UnansweredQuestion
has body: I have a combobox menu. It is work without button. I add a button but it is not working. I want to run when the button is clicked. And I have no idea about JavaScript. Can someone help me? Thanks. asd.php $hello = $_POST['List3']; echo $hello; index.php &lt;script type="text/javascript"&gt; /* Triple Combo Script Credit By Philip M: http://www.codingforums.com/member.php?u=186 Visit http://javascriptkit.com for this and over 400+ other scripts */ var categories = []; categories["startList"] = ["Wearing Apparel","Books"] categories["Wearing Apparel"] = ["Men","Women","Children"]; categories["Books"] = ["Biography","Fiction","Nonfiction"]; categories["Men"] = ["Shirts","Ties","Belts","Hats"]; categories["Women"] = ["Blouses","Skirts","Scarves", "Hats"]; categories["Children"] = ["Shorts", "Socks", "Coats", "Nightwear"]; categories["Biography"] = ["Contemporay","Historical","Other"]; categories["Fiction"] = ["Science Fiction","Romance", "Thrillers", "Crime"]; categories["Nonfiction"] = ["How-To","Travel","Cookbooks", "Old Churches"]; var nLists = 3; // number of select lists in the set function fillSelect(currCat,currList){ var step = Number(currList.name.replace(/\D/g,"")); for (i=step; i&lt;nLists+1; i++) { document.forms['tripleplay']['List'+i].length = 1; document.forms['tripleplay']['List'+i].selectedIndex = 0; } var nCat = categories[currCat]; for (each in nCat) { var nOption = document.createElement('option'); var nData = document.createTextNode(nCat[each]); nOption.setAttribute('value',nCat[each]); nOption.appendChild(nData); currList.appendChild(nOption); } } function getValue() { document.forms["tripleplay"].submit(); } function init() { fillSelect('startList',document.forms['tripleplay']['List1']) } navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false); &lt;/script&gt; &lt;form name="tripleplay" action="asd.php" method="POST"&gt; &lt;select name='List1' onchange="fillSelect(this.value,…
has comment: http://stackoverflow.com/comment/44041970
tagged with: php

http://stackoverflow.com/q/27821363
has body: I am using Login control like below, &lt;asp:Login ID="Login1" runat="server" DestinationPageUrl="default.aspx" OnAuthenticate="Login1_Authenticate" RenderOuterTable="false"&gt; &lt;LayoutTemplate&gt; &lt;asp:Literal ID="FailureText" runat="server" EnableViewState="False"&gt;&lt;/asp:Literal&gt; &lt;asp:TextBox ID="UserName" name="UserName" runat="server" CssClass="form-control" placeholder="Username"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="Password" runat="server" TextMode="Password" CssClass="form-control" placeholder="Password"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In &amp;nbsp;&amp;nbsp;" /&gt; &lt;/LayoutTemplate&gt; &lt;/asp:Login&gt; On authentication we need change login button text and redirect to default.aspx page.I tried with RegisterStartupScript and threading both didnt work for me.Please let me know if you have any suggestions for updating UI button text from Login1_Authenticate event.
has title: How to update the UI button text from server side execution in asp.net?
has comment: http://stackoverflow.com/comment/44051292
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44049367
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44050896
has comment: http://stackoverflow.com/comment/44078730
score: 0
has answer: http://stackoverflow.com/a/27821617
has comment: http://stackoverflow.com/comment/44059715
type: UnansweredQuestion
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44051148

http://stackoverflow.com/q/27827616
has comment: http://stackoverflow.com/comment/44062518
type: UnansweredQuestion
upvote count: 1
tagged with: calendar
has answer: http://stackoverflow.com/a/27866053
tagged with: internet-explorer
tagged with: sharepoint-2013
type: Question
has body: I have a SharePoint 2013 publishing website with a calendar web part. I want the calendar to be a group calendar, but SharePoint doesn't retain default users for the calendar. So I've been using a method to populate the calendar when the page loads. It's described in detail here: http://blogs.technet.com/b/meamcs/archive/2013/04/10/sharepoint-group-calendar-adding-default-users.aspx. This works in Chrome, Opera, Safari, and FireFox, but not IE (I've tested 5 through 11 using IE's emulator) The method described in the link gets a context id from the calendar html tags and uses SharePoint's JavaScript library to load the extra users from predefined XML. I loaded the XML from a file on the server. The HTML for the web part looks like: &lt;div id="ctl00_ctl43_g_cc24db55_d224_4ea9_b770_4c2edd2c083e_ctl01_ctl00_ctl00" class="ms-acal-rootdiv" ctxid="WPQ3"&gt;...&lt;/div&gt; The ctxid is used to reference the calendar. However, in IE, the ctxid property isn't there! So, I use the previous element to get the ctxid instead: &lt;div class="ms-acal-error" id="WPQ3_err" style="display:none"&gt;&lt;/div&gt; Here's my code for loading the users into the calendar: ExecuteOrDelayUntilScriptLoaded(function(){ var ctxid; if ( $(".ms-acal-rootdiv").attr("ctxid") ){ ctxid = $(".ms-acal-rootdiv").attr("ctxid"); } else if ( $(".ms-acal-error").attr("id") ){ ctxid = $(".ms-acal-error").attr("id").replace("_err",""); } SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1,ctxid).selectEntities(xml,true); },"sp.ribbon.js"); IE throws an error: "Unable to get property 'selectEntities' of undefined or null reference", and IE does return undefined for getSelector(1,ctxid). I've also tried hard-coding the value for ctxid with no success. I've been looking on Google for a couple of hours now and haven't found any solutions. Most blogs that describe this process, have comments from other users asking about this issue but no one has answered those questions. What could be the problem?
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44127519
tagged with: javascript
score: 1
has title: SharePoint 2013 Calendar getSelector is undefined in IE
favorite count: 0

http://stackoverflow.com/q/27838621
tagged with: javascript
tagged with: jquery-plugins
score: 0
has comment: http://stackoverflow.com/comment/44113370
answer count: 1
has body: I am trying to add infinite scrolling to codeigniter's pagination with the Infinite scroll jquery plugin. But with no success Here is my controller: $config['base_url'] = site_url('news/home/'); $config['total_rows'] = $this->home_model->count_new(); $config['per_page'] = 3; $config['uri_segment'] = 3; $config['limit'] = $config['per_page']; $this->pagination->initialize($config); $data['news'] = $this->home_model->list_data_new($config['per_page'], $this->uri->segment($config['uri_segment'])); $this->load->view('news_view',$data); Here is my view : <?php foreach ($news as $data):?> <?php echo $data['title']?> Post by: <?php echo $data['username']?> <?php endforeach;?> load more And here is the javascript also in view: $('#content').infinitescroll({ navSelector : "#next:last", // selector for the paged navigation (it will be hidden) nextSelector : "#next:last", // selector for the NEXT link (to page 2) itemSelector : "#content" // selector for all items you'll retrieve }); The pagination link will look like this http://localhost/latihan/news/home/3 then click next will be like this http://localhost/latihan/news/home/6 The problem is the next post doesn't showing up and load more button is not loading data. Any answer? Many thanks...
type: UnansweredQuestion
tagged with: codeigniter
tagged with: jquery-infinite-scroll
has comment: http://stackoverflow.com/comment/44090755
type: Question
has title: Infinite scroll jquery plugin didn't work
has answer: http://stackoverflow.com/a/27862270
tagged with: pagination

http://stackoverflow.com/comment/44362024
has text: http://quickblox.com/developers/Messages#Messages_API - have you: A) Created a push token for the user and B) Subscribed them to push notifications? QB will not add them to the queue if there's no available (subscribed) users to send them to.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27920259
score: 0

http://stackoverflow.com/comment/44240513
comment on: http://stackoverflow.com/a/27920410
score: 0
type: Comment
has text: `Hoja.M.A` is correct. You have a couple of typos in your example. Best fix and provide a JSFiddle so I can upvote.
type: AnswerComment

http://stackoverflow.com/comment/44120863
has text: @ShikharBhardwaj it will work because your example doesn't have that form hidden like his. give him example with hidden form.
comment on: http://stackoverflow.com/q/27859032
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44093513
type: QuestionComment
has text: Selecting by `id` is the fastest way so use it.
comment on: http://stackoverflow.com/q/27844817
score: 0
type: Comment

http://stackoverflow.com/a/28095214
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/55893012
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27865419
downvote count: 0
answers question: http://stackoverflow.com/q/27865419
upvote count: 2
has body: Brendan. About if statements: module.exports = { "City select present or not": function (browser) { if(info.citySelect) browser .url(enviroment.app) .waitForElementVisible('body', 1000) .click('span.firmsConstructorStep1__citySelectorButtonText') .verify.visible('div.firmsConstructorStep1__popup') .end(); else browser .url(enviroment.app) .waitForElementVisible('body', 1000) .click('span.firmsConstructorStep1__citySelectorButtonText') .verify.hidden('div.firmsConstructorStep1__popup') .end(); } }; And about .execute try use result in callback)

http://stackoverflow.com/comment/44269445
has text: jquery blur is your best bet here. You will need to uniquely identify each div in one `tr` and multiply the value based on the data entered by user.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27936194
score: 0

http://stackoverflow.com/comment/110782657
type: AnswerComment
comment on: http://stackoverflow.com/a/27863146
type: Comment
has text: Thank you Gouda. I see that I never went back to my own question. At the end, it was too hard for me at the time and I gave up. Thank you for your answer!
score: 0

http://stackoverflow.com/a/27857127
has body: If you don't have any content in a div, you need to set a width and height on it for it to appear : .picture { background-image: url('https://c2.staticflickr.com/4/3016/3071708735_ddaf5d361b.jpg'); background-size: cover; height: 10em; width: 10em; } .picture:hover { background-image: url('http://wallpaperscraft.com/image/29330/256x256.jpg'); } &lt;div class="picture"&gt;&lt;/div&gt;
type: AcceptedAnswer
downvote count: 0
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/27857000
answers question: http://stackoverflow.com/q/27857000
score: 5

http://stackoverflow.com/q/27871143
downvote count: 0
tagged with: javascript
has body: I have a function where I passes the value dynamically 0011 In javascript am just passing this value and it returns me 9 JS function searchError(s){ alert(s); } Need help to understand why ? I fixed it by quoting the value like 0011 JS Fiddle
favorite count: 0
has title: javascript returns 9 for 0011
has answer: http://stackoverflow.com/a/27871169
linked to: http://stackoverflow.com/q/850341
linked to: http://stackoverflow.com/q/2803145
duplicate of: http://stackoverflow.com/q/850341
upvote count: 1
accepted answer: http://stackoverflow.com/a/27871169
has comment: http://stackoverflow.com/comment/44144761
type: AnsweredQuestion
tagged with: numbers
score: 1
type: Question
answer count: 1

http://stackoverflow.com/q/27846265
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44772558
has comment: http://stackoverflow.com/comment/46130761
has body: I am trying out Blanket.js and QUnit, and have written some tests for a particular function that populates a form and submits it. Here is the function I'm testing: myObj.populateAndSubmitForm = function (data) { var $authToken = $('#AuthToken'); var $userId = $('#userId'); var $appState = $('#appState'); var $form = $('#post'); $authToken.val(data.payload.authToken); $userId.val(data.payload.userId); $appState.val(data.payload.appState); $form.attr('action', data.payload.url); $form.submit(); } In my qunit tests: QUnit.test('populateAndSubmitForm', function (assert) { var data = { payload: { authToken: 'awef2314', userId: '1234', appState: 'neutral', url: 'tests.html' } }; $('#qunit-fixture').html(html); var $authToken = $('#AuthToken'); var $userId = $('#userId'); var $appState = $('#appState'); var $form = $('#post'); // Prevent the form from actually submitting $form.submit(function (e) { e.preventDefault(); }); // Populate the form now myObj.populateAndSubmitForm(data); assert.equal($authToken.val(), 'awef2314', 'AuthToken OK'); assert.equal($userId.val(), '1234', 'userId OK'); assert.equal($appState.val(), 'neutral', 'appState OK'); assert.equal($form.attr('action'), 'tests.html', 'action url OK'); }); My tests run and pass fine, however blanket.js reports the myObj.populateAndSubmitForm as not being covered (highlights it in red in the browser). My guess is this is because I'm testing 'side effects' of the function in the DOM, and not a return statement. Still, it would be nice to be able to show that this function has been covered. Thoughts?
has title: Blanket.js not showing correct statement coverage with QUnit
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44180595
tagged with: qunit
answer count: 0
score: 1
upvote count: 1
tagged with: blanket.js
tagged with: unit-testing

http://stackoverflow.com/comment/44299859
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27952345
has text: Look up 'blur' events first.
score: 0

http://stackoverflow.com/comment/44153363
type: QuestionComment
comment on: http://stackoverflow.com/q/27875911
score: 0
has text: You need to run it in an anonymous function passed as "expect" argument. `expect(function() { Multiply(10, 'aaaa') })` - otherwise jasmine doesn't have chance to capture it
type: Comment

http://stackoverflow.com/q/27915229
downvote count: 0
has comment: http://stackoverflow.com/comment/44237132
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44267849
type: Question
tagged with: c#
has body: first let me tell you my flow I want to build seat reservation application(real time). I use c#, ajax, jquery also sql-server for database. I have 3 pages index.html(User Interface), .js(for jQuery , print seat, seat position also bridge for html and aspx), and aspx(which manipulate database) when you run Index.html you'll see seats, you can click it and input your end time then your seat will change color to red. if current time is equal with your end time then your seat color from red back to green. seat will change into red when you book it. and your no seat and endTime will insert into DB. when your endtime = current time -on DB has field status 0 and 1. 0 mean available and 1 mean booked- status change to 0. it's all done but the color wouldn't back to green. whereas status has change to 0. this my code in aspx. that get no seat also endtime from .html and .js and also get data from database which seat is still booked. [WebMethod] [ScriptMethod(UseHttpGet = true)] public static string GetSeat() { string sql = ""; SqlConnection conn = DBConnection.getConnection(); conn.Open(); sql = "UPDATE booking SET statusBooked = 0 WHERE CONVERT(char(5),[end], 108) = '" + DateTime.Now.ToString("hh:mm") + "'"; SqlCommand _cdm = new SqlCommand(sql, conn); _cdm.ExecuteNonQuery(); conn.Close(); List&lt;booking&gt; bookList = new List&lt;booking&gt;(); conn.Open(); sql = "Select noSeat from booking WHERE statusBooked = 1"; SqlCommand cmd = new SqlCommand(sql, conn); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { booking book = new booking(); book.noSeat = dr[0].ToString(); book.end =(DateTime) dr[1]; bookList.Add(book); } conn.Close(); JavaScriptSerializer serializer = new JavaScriptSerializer(); return serializer.Serialize(bookList).ToString(); } this is my ajax on .js that receive which seat number is booked and change into red I put setInterval on document ready. so it will be refresh every 2 second. setInterval('_ajax()', 2000); function _ajax() { $.ajax({ url: "…
has title: Auto Refresh ASP.NET without blinking page
has comment: http://stackoverflow.com/comment/44229859
upvote count: 2
has answer: http://stackoverflow.com/a/28768822
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: sql-server
has comment: http://stackoverflow.com/comment/44230426
has comment: http://stackoverflow.com/comment/44229740
has comment: http://stackoverflow.com/comment/44231934
has comment: http://stackoverflow.com/comment/44229511
score: 2

http://stackoverflow.com/comment/44266079
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27934153
has text: using the JSON.parse I'm having "SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data"
score: 0

http://stackoverflow.com/q/27954532
has body: I'm learning AngularJS and have come across this error while implementing a controller. Can someone point out what's wrong? (followed this exactly as it's shown in a tutorial unless some of the functions are deprecated?) I get the following error: Argument 'Ctrl' is not a function, got undefined HTML AngularJS Controller {{ name }} {{ age }}
downvote count: 2
has title: AngularJS: Argument 'Ctrl' is not a function, got undefined
has answer: http://stackoverflow.com/a/27954620
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/19408011
tagged with: javascript
has comment: http://stackoverflow.com/comment/44304051
linked to: http://stackoverflow.com/q/25111831
accepted answer: http://stackoverflow.com/a/27954620
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/44304129
duplicate of: http://stackoverflow.com/q/25111831
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44304301
possible better answer: http://stackoverflow.com/a/27954642
upvote count: 1
has answer: http://stackoverflow.com/a/27954642
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44304231

http://stackoverflow.com/q/27918439
has comment: http://stackoverflow.com/comment/44234978
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44235137
has title: javascript regex search start of every word and following word
has comment: http://stackoverflow.com/comment/44234881
has comment: http://stackoverflow.com/comment/44234989
type: Question
upvote count: 2
has body: I'm trying to write a regex based on user input that searches the start of every word and the following word (excluding the space) in a string. This is the current code i am using. var ndl = 'needlehay', //user input re = new RegExp('(?:^|\\s)' + ndl, 'gi'), //searches start of every word haystack = 'needle haystack needle second instance'; re.test(haystack); //the regex i need should find 'needle haystack' Any help or suggestions i'd gladly appreciate. Thanks!
has comment: http://stackoverflow.com/comment/44234945
accepted answer: http://stackoverflow.com/a/27918801
answer count: 1
has comment: http://stackoverflow.com/comment/44234934
tagged with: javascript
has comment: http://stackoverflow.com/comment/44235102
favorite count: 0
has answer: http://stackoverflow.com/a/27918801
tagged with: regex
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44235027

http://stackoverflow.com/q/27910572
tagged with: javascript
score: 0
has title: AngularJS $Location.Path In Service
has body: I have an AngularJS application that needs to navigate to a different template when an event occurs. This event could be triggered by the user clicking a button on the current AngularJS template, or it could be trigger by an AngularJS service that is periodically calling a web service to check for the event. This AngularJS application actually has a number of events like this, so I created an AngularJS service to encapsulate the logic of what should happen when an event is fired. It has a function for each event, and the AngularJS controller or the AngularJS service call this function when the event is fired. The issue is when I call $location.path to navigate to the new template. If it is called from a controller then an apply will already be in progress. However is it is called from an AngularJS service then an apply will not already be in progress and I will need to call $rootScope.$apply. My question is, how to I figure out when I need to call $rootScope.$apply and when I should not? I looked at this website, https://coderwall.com/p/ngisma/safe-apply-in-angular-js, and it passes in the $scope from the controller and looks at the $$phase object on the controllers scope to determine whether an apply is in progress. However when I call this from another AngularJS service I will not have a controller $scope to pass in, so it does not work for me. How can I make this work? Or am I approaching this in the wrong way? Here is some code to help explain what I am meaning. The code shows an AngularJS service called 'eventsSrv' that has the logic for responding to events. The 'eventsSrv' uses a service named 'monSrv' that I do not show the code for. The 'monSrv' is responsible for picking up server events (by web sockets or polling a web service). The 'eventsSrv' uses the 'monSrv' to know when the server fires an 'exit' event. The code also shows a controller that calls the 'exit' function on the 'eventsSrv'. In this simplified example it may not make sense to pull the 'exi…
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44220631
has comment: http://stackoverflow.com/comment/44234948
type: Question

http://stackoverflow.com/comment/44106195
has text: this is what I was after. My lack of html understanding didn't help but your example set me in the right direction
comment on: http://stackoverflow.com/a/27844333
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27844898
has comment: http://stackoverflow.com/comment/44094995
type: Answer
accepted answer of: http://stackoverflow.com/q/27830964
has comment: http://stackoverflow.com/comment/44093702
score: 1
upvote count: 1
has body: From the question you linked, the answer is what you want... All you have to do is capture the reset event and call v.resetForm(). var v = $('form').validate(); //etc etc whatever you have here, the important part is saving "v" $('form').on('reset',function () { v.resetForm(); }); See it working here: http://jsfiddle.net/uuu8jerr/
answers question: http://stackoverflow.com/q/27830964
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27943233
has comment: http://stackoverflow.com/comment/44281894
upvote count: 6
answers question: http://stackoverflow.com/q/27943215
has comment: http://stackoverflow.com/comment/44282044
has comment: http://stackoverflow.com/comment/44281940
downvote count: 0
has comment: http://stackoverflow.com/comment/44281863
has body: When you compare objects, you are testing to see if they are the same object. You have two different (albeit effectively identical) objects.
has comment: http://stackoverflow.com/comment/44281832
has comment: http://stackoverflow.com/comment/44282666
has comment: http://stackoverflow.com/comment/44281964
score: 6
has comment: http://stackoverflow.com/comment/44282547
type: Answer

http://stackoverflow.com/a/27903021
has comment: http://stackoverflow.com/comment/44207647
type: Answer
has comment: http://stackoverflow.com/comment/44205204
upvote count: 2
has body: This is incorrect: id.'" type="button" class="btn btn-default"> You must specify that you want PHP code and you want to echo $book->id, like this: <button id="fav" value="<?php echo $book->id; ?>" type="button" class="btn btn-default"> Also, let's suppose you have a PHP function isFavorite, then <button id="fav" value="<?php echo $book->id; ?>" type="button" class="btn btn-default<?php echo ((isFavorite()) ? (" btn-success") : ("")); ?>">
answers question: http://stackoverflow.com/q/27902780
has comment: http://stackoverflow.com/comment/44205777
score: 2
downvote count: 0

http://stackoverflow.com/q/27859779
linked to: http://stackoverflow.com/q/2825856
has comment: http://stackoverflow.com/comment/51552093
has body: In my controller i have methods $scope.openJukeboxesModalToGroup -- open modal popup $scope.searchJukeboxes --- to search on the page $scope.keyPressed -- capture the key pressing In the partial with a form Add Stores to Group keyPressed method is $scope.keyPressed = function($event, eventType) { $event.stopImmediatePropagation(); if(eventType=='search') { if($event.which==13) { $scope.searchJukeboxes(); } } }; I am trying to start the search whenever ever somebody types something in the text bar and clicks enter. But i don't somehow the openJukeboxesModalToGroup() method is called too. I have tried to stop this by calling stop event proprpagation, changing name of openJukeboxesModalToGroup() method. But nothing is working. Any help on this. deadForm() method is impleament and i am not getting any error in chrome console.
has title: angular bootstrap modal opening on the enter click
answer count: 1
has comment: http://stackoverflow.com/comment/46144152
tagged with: jquery
has answer: http://stackoverflow.com/a/27859895
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/135196086
accepted answer: http://stackoverflow.com/a/27859895
score: 2
type: AnsweredQuestion
upvote count: 3
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/135202770
tagged with: javascript
tagged with: angular-ui-bootstrap

http://stackoverflow.com/a/27857748
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27857577
answers question: http://stackoverflow.com/q/27857577
has body: Unfortunately, JS is not great when it comes to internationalized case-insensitive string comparison. If you're just sticking to ASCII though, the solution is fairly straightforward (using filter though, not where): function getMatches(query, arr) { var lowerQuery = query.toLowerCase(); return _.filter(arr, function(term) { return term.toLowerCase() == lowerQuery; }); } Or if you want to precompute everything because you expect to make a lot of queries in the same JS session: var index = _.groupBy(arr, function(term) { return term.toLowerCase(); }); // Post-process index to reduce memory footprint by turning redundant values to nulls // (which take up less memory than arrays with a string in them). index = _.object(_.map(index, function(terms, key) { return [key, (terms.length == 1 &amp;&amp; terms[0].toLowerCase() == terms[0] ? null : terms)]; })); function getMatches(query) { var lowerQuery = query.toLowerCase(); return (lowerQuery in index ? index[lowerQuery] || lowerQuery : []); } This second method has the advantage of only computing toLowercase() the minimal number of times and minimal data storage because of the post-processing step. Here's a JSFiddle for both
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44141561
comment on: http://stackoverflow.com/q/27869063
score: 0
type: QuestionComment
type: Comment
has text: Can you post your code or a link to you site?

http://stackoverflow.com/comment/44216146
has text: @Plato, What a silly mistake I made ! Useful info these comments however !!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27908296

http://stackoverflow.com/comment/69404306
has text: The two functions are not the same! `unescape('%E9')` will return `é`, but `decodeURIComponent('%E9')` will throw `Malformed URI`
type: Comment
score: 24
comment on: http://stackoverflow.com/a/27926636
type: AnswerComment

http://stackoverflow.com/comment/44025303
type: Comment
has text: I was thinking that i should add `onSongEndWrapper();` after the line `// launch initial request` so I could keep everything within the script. Where would be an appropriate position to run ?
comment on: http://stackoverflow.com/a/27807599
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44108962
type: AnswerComment
score: 0
has text: One cannot change (modify) a function in JS, therefore you need to overwrite it. As we can't use a function declaration, the assignment to a variable is necessary. I'm not sure why you care about the function name that much, though it's certainly [possible with eval magic](http://stackoverflow.com/q/9479046/1048572). Changing the way the constructor needs to be called is absolutely undesirable. Rewriting the complete function body won't work with closures, except you return a string and `eval` that in the appropriate scope.
type: Comment
comment on: http://stackoverflow.com/a/27842939

http://stackoverflow.com/a/27877543
has comment: http://stackoverflow.com/comment/44156727
score: 0
type: Answer
has body: This will also do : $(this).parent().find("thead").hide(); Sample code : function hide() { $('tbody').each(function(){ if($(this).not("tr:hidden").length=1) { $(this).parent().find("thead").hide(); } }); } Table H1 H2 a b a b a b a b Hide
answers question: http://stackoverflow.com/q/27877353

http://stackoverflow.com/comment/44039879
has text: you need javascript for that , from iframe to access parent use window.top , from parent to access iframe use document.frames[0]
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27816760

http://stackoverflow.com/q/27857800
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Datepick value Javascript into php
score: 0
tagged with: datepicker
accepted answer: http://stackoverflow.com/a/27858349
tagged with: php
type: Question
type: AnsweredQuestion
has body: I am trying to make a tool that can load call history into Excel. For this I am using a API. This works perfect. however, to get call history, the user have to set a date. I do use Datepick for this. as it is in a foreach loop the code is like this: <?php echo " Name Last Name Email Extension Numbers Datum "; foreach ($response as $key => $value) { echo " " . " " . $value['fname'] . " " . $value['lname'] . " " . " " . $value['email'] . " " . " " . $value['ext'] . " " . " "; foreach ($value['numbers'] as $key2 => $numvalue) { echo $numvalue; } echo " "; echo " "; echo(" ' method='post'> "); echo " "; } $tijd = $_POST['tijd']; if($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_POST['tijd']) { echo "hi"; //debugging } } as you can see the input is a button and not submit. I have also try to use submit but then it gives me a error when I click on the button. echo(" ' method='post'> "); I want the code to pick a date and turn it into a variable in php. I am not sure what to do with $tijd = $_POST['tijd']; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($tijd) { echo "hi"; //debugging } } There must be the problem, however I can't see something I understand that you might be somewhat confused about the question so I decided to upload a image. https://i.sstatic.net/vrLWH.png
has answer: http://stackoverflow.com/a/27858349

http://stackoverflow.com/comment/44112754
type: AnswerComment
score: 0
type: Comment
has text: Yes, of course. The updated version of your answer is good. (I've forgotten now what your original wording was, but at the time I didn't think it adequately answered a question that complained about "concatenation" since the problem wasn't actually with the concatenation. I'll delete that comment.) And @UselessCode - *definitely* incorrect. Single quotes are valid even in XHTML.
comment on: http://stackoverflow.com/a/27854507

http://stackoverflow.com/a/27842309
answers question: http://stackoverflow.com/q/27841967
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44088286
has comment: http://stackoverflow.com/comment/44093605
has body: I found the work around _.uniq(a.concat(b), function(array){ return "c:" + array.c + "r:" + array.r; }) result : [{c:1, r:2}, {c:2, r:2}, {c:3, r:2}, {c:1, r:1}, {c:3, r:3}]
upvote count: 2

http://stackoverflow.com/comment/44177186
comment on: http://stackoverflow.com/a/27887927
type: Comment
has text: you can use `.form-horizontal` class instead of `.form-group` it will align the `label` `vertically` but you will need to `align` the `text-left` http://www.bootply.com/XpOUxMMhdT @AbhishekKS
score: 0
type: AnswerComment

http://stackoverflow.com/q/27925420
tagged with: servlets
score: 0
has body: I have multiple dynamically generated links on a JSP page (JSTL). I want to submit the id and name of the clicked link to a Servlet using Javascript. Here's a snippet from my JSP page: <c:otherwise> ${rootBean.beanprojname} More Details </c:otherwise> and in my javascript: function func(name,id) { //What to write here to pass the name and id to a servlet (without using JQuery)? } P.S: There are no form tags on my page.
answer count: 1
has comment: http://stackoverflow.com/comment/44247938
has comment: http://stackoverflow.com/comment/44248484
accepted answer: http://stackoverflow.com/a/27928566
has comment: http://stackoverflow.com/comment/44250526
has title: Passing a variable from a Javascript to a Servlet without using JQuery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44248446
has answer: http://stackoverflow.com/a/27928566
type: Question
has comment: http://stackoverflow.com/comment/44249195
tagged with: javascript

http://stackoverflow.com/q/27955306
type: UnansweredQuestion
tagged with: node.js
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27955378
score: 0
has body: Folks, I would like to have moment.js return a Javascript Date object in UTC. Everything I've tried, it returns it back as a javascript object, but in EST (my local timezone). The following does not seem to work: var test1 = moment.utc(_.now()).format(); console.log('test1',test1); //2015-01-15T01:04:51+00:00 var test2 = moment.utc(_.now()).toDate(); console.log('test2',test2); //Wed Jan 14 2015 20:05:39 GMT-0500 (EST) Did I misread their docs? Thanks!
has title: moment.js javascript dat object

http://stackoverflow.com/comment/44045141
comment on: http://stackoverflow.com/q/27819675
score: 0
has text: Are you talking about javascript in the browser or are you using node.js to run it on the server? You cannot real files on the server from javascript running in the client.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44203720
has text: I edited the question. It looks like POST does not work here. Can someone please provide an example how set the `MapRoute` if I want the POST method to work? I would be grateful!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27899984

http://stackoverflow.com/q/27911366
has body: I am unable to retrieve the values from Query String when using AJAX My JavaScript function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } } function showPosition(position) { $(document).ready(function () { var latitude = position.coords.latitude; var longitude = position.coords.longitude; var serurl = 'http://mydummyurl.com/?lat='+latitude+'&amp;lon='+longitude; $.ajax({ type: 'POST', url: serurl }); }); } getLocation(); And, I am trying to use echo $_GET['lat']; // This is working fine. echo $_GET['lon']; // This is **NOT WORKING.** Also, if I tweak the URL like http://mydummyurl.com/?lon='+longitude+'&amp;lat='+latitude+' Then $_GET['lon'] is working and $_GET['lat'] is not working.
answer count: 1
has title: Ajax query string not working
favorite count: 0
tagged with: ajax
type: AnsweredQuestion
upvote count: 0
accepted answer: http://stackoverflow.com/a/27911908
has comment: http://stackoverflow.com/comment/44222347
has comment: http://stackoverflow.com/comment/44222315
has comment: http://stackoverflow.com/comment/44222379
type: Question
has answer: http://stackoverflow.com/a/27911908
score: -2
has comment: http://stackoverflow.com/comment/44222627
has comment: http://stackoverflow.com/comment/44222272
tagged with: javascript
has comment: http://stackoverflow.com/comment/44222268
downvote count: 2

http://stackoverflow.com/a/27833271
has comment: http://stackoverflow.com/comment/44072290
has comment: http://stackoverflow.com/comment/44072587
score: 5
has body: As per my understanding, getvalue in the above code is method not function then how come typeof this.getvalue return function. JavaScript doesn't have a concept of "methods" (not yet at least*). This is just a term colloquially used to describe functions that are assigned to properties of objects. Btw, typeof if basically a lookup table. Why is the second alert in the above code shows undefined when point v as this.v ? Because myobj doesn't have a property v. Accessing a non-existing property returns undefined. *: ECMAScript 6 (the next version of "JavaScript") does have the concept of methods, but it's mostly syntactical and they are still just functions.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27833229
has comment: http://stackoverflow.com/comment/44072134
upvote count: 5
accepted answer of: http://stackoverflow.com/q/27833229
type: Answer
downvote count: 0

http://stackoverflow.com/q/27861740
possible better answer: http://stackoverflow.com/a/27862054
tagged with: javascript
has answer: http://stackoverflow.com/a/27862054
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27861940
has body: I own a website. There are some movies on the website, which are made by myself. I want to make money from the website by creating paid movies. That means the website visitor need to pay to watch the full movie or to download the movie. In the website, the movies are played in an Iframe now. My idea is to upload the paid movies into a directory. The directory's name is as complex as a password. Then I will hide the name of the directory so the website visitors cannot download or watch the paid movies without going into my Iframe. I have already used javascript to prevent right click "Open in new tab" and "Open in new window". I want to know how can I encrypt the Src of the Iframe so that the website visitors will not know anything just by watching the source code. Please use PHP or CSS or HTML of JAVASCRIPT to solve this problem. Thank you.
score: 0
tagged with: iframe
answer count: 2
tagged with: encryption
has answer: http://stackoverflow.com/a/27861940
tagged with: php
has title: Encrypting Src of Iframe
has comment: http://stackoverflow.com/comment/44125812
has comment: http://stackoverflow.com/comment/44125754
type: AnsweredQuestion

http://stackoverflow.com/q/27861510
score: -1
tagged with: google-maps-api-3
tagged with: google-maps
upvote count: 0
has body: I already have a working map where it generates a valid xml and can generate a marker on my map. Now what I want to do is to upon generating of maps for each loop in the xml I can create asynchronously a check box for each name. here is the code that generates the xml function searchNearLocations(radius){ clearLocations(); var searchUrl = './designIncludes/phpLogicIncludes/searchMarkers.php?lat=' + userLat +'&amp;lng=' + userLng + '&amp;radius=' + radius; downloadUrl(searchUrl, function(data) { var xml = parseXml(data); var markerNodes = xml.documentElement.getElementsByTagName("marker"); var bounds = new google.maps.LatLngBounds(); for (var i = 0; i &lt; markerNodes.length; i++) { var name = markerNodes[i].getAttribute("name"); var address = markerNodes[i].getAttribute("address"); var info = markerNodes[i].getAttribute("info"); var tts = markerNodes[i].getAttribute("tts"); var latlng = new google.maps.LatLng( parseFloat(markerNodes[i].getAttribute("lat")), parseFloat(markerNodes[i].getAttribute("lng"))); createMarker(latlng, name, address,info,tts); createCheckboxes(name); bounds.extend(latlng); } map.fitBounds(bounds); }); } My createMarker() function createMarker(latlng, name, address,info,tts) { var html = "&lt;b&gt;" + name + "&lt;/b&gt;&lt;/br&gt;&lt;u&gt;" + address + "&lt;/u&gt;&lt;/br&gt;" + info + "&lt;/br&gt;" + "Time allowance to spend: " + tts; var marker = new google.maps.Marker({ map: map, position: latlng }); google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); markers.push(marker); } I'm not that good in javascript but I have a marker=[] array global variable. Can I use that variable to generate a checkbox with it?by the way I also have a pre made marker before invoking the searchNearLocations function and I want to add it on the latlng bounds. Is it possible to insert it on the loop?
answer count: 1
has comment: http://stackoverflow.com/comment/44127597
favorite count: 0
has answer: http://stackoverflow.com/a/27863853
has title: Creating check boxes for each markers generated by xml GOOGLE MAPS
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44126324
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27863853
linked to: http://stackoverflow.com/q/26754939
tagged with: javascript

http://stackoverflow.com/q/27912061
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
has answer: http://stackoverflow.com/a/27912267
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I used the following script to fade-in an image when the page loads: The css is set to display none. This works in all the major browsers, but not in IE. In IE, the image is just not displayed at all. How can I get the fade-in to work in IE?
answer count: 1
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/44223700
has title: jquery fade-in on page load works in all browsers except IE

http://stackoverflow.com/q/27830861
has title: Local Script Downloading After CSS Files, but not External Files
type: UnansweredQuestion
upvote count: 1
tagged with: google-chrome
has answer: http://stackoverflow.com/a/27850578
tagged with: performance
score: 1
type: Question
downvote count: 0
tagged with: javascript
has body: I've come across some interesting browser behavior (Chrome) that I was hoping to get insight into. I have the following structure to my html document (I've been careful about the domain names) // Hosted on http://www.example.com But Chrome will wait until the CSS files have finished downloading before downloading the local javascript files. It (chrome) does NOT wait when those javascript files are external though. I thought it might be a number-of-resources issue, but I am not downloading ANY files from the root domain other than the index.html document and those two local javascript files. This is true if I don't include the external javascript files or not, or if the external files are included before the local files. Both local and external included together as described in the HTML above : Only Local files : Notice how the two images are requested, if I refresh the page, they will show up in a random order and the fact that they are included first here is happenstance... obviously they are all waiting for the same thing before requesting : I'd prefer the local files to download concurrently with the CSS files (serving them from the same CDN as the CSS files results in the same behavior above... presumably because Chrome only downloads a few resources from the same domain at a time) so that I don't have to pay for the DNS lookup of the additional CDN so my question is "Why doesn't chrome download my locally referenced files at the same time it would download external files?"
tagged with: optimization
answer count: 1
tagged with: css
favorite count: 0

http://stackoverflow.com/comment/44040172
has text: @M42 - I'm looking for a solution for that case and pls help if you could.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27816630

http://stackoverflow.com/q/27867523
possible better answer: http://stackoverflow.com/a/27867729
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44138061
has title: Filtering Nested Properties in ngRepeat
score: 0
has comment: http://stackoverflow.com/comment/44137659
answer count: 2
has body: In my controller I have: $scope.currentDiscount = new DiscountPrototype; Where: var DiscountPrototype = function(){ this.Id = 0; this.PromoCode = null; this.DiscountValue = null; this.DiscountProducts = [] } var DiscountProductPrototype = function(discountId,id,catId,catType,name) { this.DiscountId = discountId; this.ProductCategoryType = catType; this.Name = name } And then I push a bunch of new DiscountProductPrototypes into the DiscountProducts array of $scope.currentDiscount. If the DiscountProduct has a ProductCategoryType = "C" it is a category, and if it is "P" it is a product. My filter is intending on only displaying the objects in the DiscountProduct array that are categories. &lt;div ng-repeat="category in currentDiscount.DiscountProducts | filter:{category.ProductCategoryType: 'C' : true}" class="productTile"&gt; &lt;p&gt;{{category.Name}}&lt;/p&gt; &lt;/div&gt; With the above filter I get the following error: Syntax Error: Token '.' is at column {2} of the expression [{3}] starting at [{4}]. Which seems to say there's something wrong with: category.ProductCategoryType If I do the following, I get no error, but the filter does nothing. Both categories and products are displayed. &lt;div ng-repeat="category in currentDiscount.DiscountProducts | filter: category.ProductCategoryType='C'" class="productTile"&gt; Do I need to create a custom filter to achieve this kind of filtering?
has answer: http://stackoverflow.com/a/27867922
accepted answer: http://stackoverflow.com/a/27867922
has answer: http://stackoverflow.com/a/27867729
has comment: http://stackoverflow.com/comment/44137519
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/comment/44278094
comment on: http://stackoverflow.com/a/27900078
type: AnswerComment
score: 0
has text: can please check for me this http://stackoverflow.com/questions/27940700/create-search-modal-directive-from-angularjs-modal
type: Comment

http://stackoverflow.com/q/27924890
has body: so here is my page here is the full code http://jsfiddle.net/gup3o1ap/1/ as you can see there are lots of div.item on the page and the page has a big scroll bar , i want to know which .item has been seen by the user , so basically i need to know the last item visible on the page (.items before that has already been shown ) so i can calculate when scroll gets to the end of the page $(window).scroll(function() { if($(window).scrollTop() + $(window).height() > $(document).height() - 200) { console.log('at the end' ); } }); but i don't know how can i find which element is the last one shown on the page
score: 2
has comment: http://stackoverflow.com/comment/44246920
downvote count: 0
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44246789
answer count: 1
tagged with: javascript
tagged with: jquery
has title: finding which elements(div) has been shown in a page with scroll bar
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27924999
favorite count: 0
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/q/27847054
tagged with: highcharts
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44101429
accepted answer: http://stackoverflow.com/a/27849273
tagged with: ajax
score: 0
has body: I use highcharts for draw charts. I have 2d json object and I don't know how to set this object to highcharts. And this is my json object data: And I want my chart like this picture(column-parsed example of highchart): And this is my code: $.ajax({ url:"../../teachersem", type:"get", data:{ id:$.trim(tableData[0]) }, success:function(data){ $('div[class|="col-md-7 col-md-offset-3"]').css("display","none"); //console.log(data.accept); //console.log(data.fail); var accept=new Array(); var fail =new Array(); for (i = 0; i &lt; data.accept.length; i++){ accept.push([data.accept[i].year, parseInt(data.accept[i].count)]); alert("accept: "+data.accept[i].year+" "+parseInt(data.accept[i].count)); } //console.log(accept.toString()); for (i = 0; i &lt; data.fail.length; i++){ fail.push([data.fail[i].year, parseInt(data.fail[i].count)]); alert("fail: "+data.fail[i].year+" "+parseInt(data.fail[i].count)); } $('#container').highcharts({ chart: { type: "column" }, title: { text: "Student data" }, xAxis: { allowDecimals: false, title: { text: "Branch of studies" } }, yAxis: { title: { text: "Number of students" } }, series: [{ data: [accept,fail] }], }); }, error: alert('error!') }) }); But this has any result? please help,thank u!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44101290
has title: Set 2d json to highcharts
type: Question
has answer: http://stackoverflow.com/a/27849273
has comment: http://stackoverflow.com/comment/44100654
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44101198

http://stackoverflow.com/comment/44219729
type: AnswerComment
has text: So the OP should just be calling ` $("#the_dropdown").html(" Less than 768 ")`
type: Comment
comment on: http://stackoverflow.com/a/27910156
score: 1

http://stackoverflow.com/q/27829557
has comment: http://stackoverflow.com/comment/44065710
has answer: http://stackoverflow.com/a/27830051
linked to: http://stackoverflow.com/q/8682085
has comment: http://stackoverflow.com/comment/44065240
score: -3
downvote count: 3
has title: tick method in javascript for canvas
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44065766
accepted answer: http://stackoverflow.com/a/27830051
has body: I'm trying to make a tick method for this code. When I try to put a while loop or time interval it just goes blank. I want the tick method to call this function without the canvas going blank. How would i make that tick method function setup(){ var canvas = document.getElementById('my_canvas'); var ctx = canvas.getContext('2d'); canvas.width = 800; canvas.height = 600; var gun = new Image(); var badguy = new Image(); var wall1 = 200; var ground = new Image(); var back = new Image(); var back2 = new Image(); var back3 = new Image(); var wall = new Image(); var wall2 = new Image(); back.onload = function() { ctx.drawImage(back, 0, 0, 800, 300); }; back2.onload = function() { ctx.drawImage(back2, mountainplace, 0, mtnsize1, 300); }; back3.onload = function() { ctx.drawImage(back3, mountainplace2, 0, mtnsize2, 300); }; ground.onload = function() { ctx.drawImage(ground, groundplace, 300, 1980, 200); }; wall.onload = function() { ctx.drawImage(wall, place2, 250, size2, 100); }; wall2.onload = function() { ctx.drawImage(wall2, place, 250, size, 100); }; badguy.onload = function() { ctx.drawImage(badguy, badguyplace, 250, 100, 100); }; gun.onload = function() { ctx.drawImage(gun, 0, 100, 400, 400); }; back2.src = "moutain1.png"; back3.src = "moutain2.png"; back.src = "backing.png"; ground.src = "ground1.jpg"; wall.src = "wall.png"; wall2.src = "wall2.png"; badguy.src = "santa2.png"; gun.src = "gun1.png"; };
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/44207698
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27904102
has text: Save everything as a string?

http://stackoverflow.com/comment/44273469
type: Comment
comment on: http://stackoverflow.com/a/27938530
score: 0
type: AnswerComment
has text: JSLint and JSHint may have affected those habits. :)

http://stackoverflow.com/comment/44318066
type: Comment
comment on: http://stackoverflow.com/q/27962391
has text: show the code for `showModal()`
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44187931
score: 1
comment on: http://stackoverflow.com/q/27893147
type: Comment
type: QuestionComment
has text: What response is the server giving back? How is the querystring build. You can watch this in the sources/network tab of your dev tool (hotkey F12).

http://stackoverflow.com/comment/44150730
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27873773
has text: my guess is in your fiddle you set max: 1380, so I just calculate the value for each time and setTimeout those values to move the bar.
type: AnswerComment

http://stackoverflow.com/a/27818376
has body: Define fullname outside the callback. var getName = function () { this.name = function (firstname, lastname, success) { var fullName = firstname + " " + lastname; success(fullName); }; }; var test = new getName(); var fullname; test.name("John", "Smith", function (output) { fullname = output; alert(fullname); //this works fine return fullname; // I need this variable to be accessed from outside this function }); alert(fullname); Hope it helps. Fiddle
score: 1
has comment: http://stackoverflow.com/comment/44042649
answers question: http://stackoverflow.com/q/27818260
has comment: http://stackoverflow.com/comment/44042928
has comment: http://stackoverflow.com/comment/44043365
has comment: http://stackoverflow.com/comment/44042985
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44283483
has text: Explanation: jQuery reads all the `data-*` attributes and stores them into a internal variable at page load. When you use `.data()`, you are reading or changing the values from the internal variable and not from the DOM. If you want to **read** or **change** the `data-*` directly into the DOM after loading you need to use `.attr()`. Note that changing the attribute `data-*` with `.attr()` will not change the internal cached variable.
comment on: http://stackoverflow.com/q/27944037
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27923330
has answer: http://stackoverflow.com/a/27925744
answer count: 1
favorite count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/44248334
tagged with: requirejs
has comment: http://stackoverflow.com/comment/44244037
linked to: http://stackoverflow.com/q/11953585
accepted answer: http://stackoverflow.com/a/27925744
type: AnsweredQuestion
has body: This is my config requirejs.config({ baseUrl : 'vassets/lib/', shim : { 'knockout' : [ 'jquery' ] }, paths : { jquery : 'jquery/jquery.min', knockout : 'knockout/knockout', selectize : 'selectize.js/js/standalone/selectize.min', main : '/vassets/js/koapp/main', jsep : '/vassets/js/jsep/jsep.min' } }); jsep is the javascript expression parser that is available here http://jsep.from.so/ This is my module definition: define ()-&gt; require ['jsep'],(jsep)-&gt; console.log jsep # does not work, jsep is undefined ()-&gt; console.log jsep # does not work, jsep is available. but HOW???? # I dont see this type of usage in api documnentation. How does this work? In addition the following module definition also does not work define ['jsep'], (jsep)-&gt; console.log jsep # does not work # this is the normal usage I find in documentation, why this does not work??? Could
tagged with: coffeescript
has title: requireJs: dependencies not getting loaded for jsep
type: Question
upvote count: 0
score: -2
tagged with: javascript

http://stackoverflow.com/comment/44107933
score: 1
has text: @Soubriquet If `forever list` is empty, then your script may not have been started by `forever`. You may need to find and kill the persistent `node` process yourself ([with `ps` and `kill`](http://stackoverflow.com/questions/3510673/find-and-kill-a-process-in-one-line-using-bash-and-regex) or Task Manager in Windows). Also note that the caching of code is [managed by `node`](http://nodejs.org/api/modules.html#modules_caching) and can't be disabled. It'll keep in memory the result of each file it evaluates until the process is terminated.
type: QuestionComment
comment on: http://stackoverflow.com/q/27851473
type: Comment

http://stackoverflow.com/q/27876749
has body: I have an application with a WebView showing an HTML file. In the HTML file, there's a button that will request the user to record video, or select a video from his documents folder. Upon selecting (or recording) a video, it calls a javascript function with the link (encoded by Uri) to the video file, which it should then display in a element, by setting it as its source: function showPreview(previewFile){ console.log(previewFile); document.getElementById('previewVideo').src = previewFile; } I'm running into this error and I've been looking around but can't seem to find the solution: I/chromium﹕ [INFO:CONSOLE(94)] "content://com.android.providers.media.documents/document/video%3A19961", source: file:///android_asset/index.html (94) W/MediaResourceGetter﹕ permission denied to access network state W/MediaResourceGetter﹕ non-file URI can't be read due to unsuitable network conditions E/MediaResourceGetter﹕ Unable to configure metadata extractor As you can see I'm logging the link to the video file in my javascript function, which as you can tell links to content://com.android.providers.media.documents/document/video%3A19961. This is how I load the WebView in my code (and there's a corresponding WebView in the XML of course): @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webView = (WebView) this.findViewById(R.id.webView); webView.getSettings().setAllowFileAccess(true); webView.getSettings().setAllowFileAccessFromFileURLs(true); webView.getSettings().setJavaScriptEnabled(true); webView.setWebChromeClient(new WebChromeClient()); webView.addJavascriptInterface(new CSJSInterface(getApplicationContext()), "jsInterface"); webView.loadUrl("file:///android_asset/index.html"); } Javascript Interface function &amp; callback @JavascriptInterface public void showCapture() { File imageStorageDir = new File( Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) , CS_M…
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/31736039
upvote count: 5
has title: Android WebView not allowed to load local video file
tagged with: android
tagged with: video
downvote count: 0
type: UnansweredQuestion
tagged with: webview
type: Question
tagged with: android-contentprovider
score: 5
tagged with: javascript

http://stackoverflow.com/comment/44360439
comment on: http://stackoverflow.com/a/27982802
score: 0
type: AnswerComment
has text: Do you need `toArray()` in there?
type: Comment

http://stackoverflow.com/comment/44260314
type: QuestionComment
has text: I'll try to explain a bit more. I'm recreating the OfficeUI ribbon in AngularJS. I have a directive which renders the ribbon and I have a directive which renders the contents behind the first tab. Both directives return a template. In the ribbon template, I have an ng-click on the first tab item so a function in the controller is executed. This function does change a variable to true. In the other directive (uses the same controller) has a ng-show on the top DIV element to show only when the property is set to true. But the problem is that both directives uses Isolated scope. Make more sense?
comment on: http://stackoverflow.com/q/27930580
score: 0
type: Comment

http://stackoverflow.com/a/27950568
has comment: http://stackoverflow.com/comment/44296864
score: 2
has comment: http://stackoverflow.com/comment/44296795
has comment: http://stackoverflow.com/comment/44296187
has body: You can use String charAt. But it's zero based so, the first position is zero. "I am walking on the street".charAt(4); // Get 5th letter About the array transformation. You can use split function "I am walking on the street".split(''); // will return ['I',' ','a','m', ...]
has comment: http://stackoverflow.com/comment/44296477
has comment: http://stackoverflow.com/comment/44296436
answers question: http://stackoverflow.com/q/27950539
upvote count: 3
has comment: http://stackoverflow.com/comment/44296407
has comment: http://stackoverflow.com/comment/44296177
has comment: http://stackoverflow.com/comment/44296222
has comment: http://stackoverflow.com/comment/44296237
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/44297063

http://stackoverflow.com/comment/44166684
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27870062
type: QuestionComment
has text: Thanks for your interest and effort in this. I'll edit my question to add some detail about the timestamp variables. Also, the site I'm attempting to build out is [mobseen.it](http://mobseen.it). If you click on one of the events you'll see what I mean by photos repeating. Each location seems to get the first set of correct photos, but then they are added over and over.

http://stackoverflow.com/a/27844441
answers question: http://stackoverflow.com/q/27844311
type: Answer
has body: I guess you can follow this scenario : A first action of your controller calls a page where js is and colls the api This page then calls a second action of your controller (via window.location.href for example) and sends it the information, so the action can render what you want
has comment: http://stackoverflow.com/comment/44093142
score: 0

http://stackoverflow.com/q/27864532
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44131993
has answer: http://stackoverflow.com/a/27865444
has comment: http://stackoverflow.com/comment/44132237
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27865444
tagged with: php
has body: I am developing an instant messaging page for my website and I consequently want the div to be scrolled to the bottom so the newest message can be seen. The page is saved as a php file and uses jQuery to do the scrolling. The code: $(function() { var wtf = $('#chat'); var height = wtf[0].scrollHeight; wtf.scrollTop(height); }); Currently I use the following code however it is very temperamental and only works about 1 in 4 times, I have not added the webpage code as it it several hundred lines however I can if necessary. Is there a better solution which works more consistently?
has title: jQuery scroll to bottom of div is very tempremental
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27865424
has comment: http://stackoverflow.com/comment/44131918
has comment: http://stackoverflow.com/comment/44131437
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27865424
has comment: http://stackoverflow.com/comment/44133634

http://stackoverflow.com/q/27875410
has title: Highchart with Table
has body: Is there highchart framework already exists when chart and table co-exists. For example as shown below. I found few links but it didn't solved the problem. Link 1 Link 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44156974
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27033536
type: Question
linked to: http://stackoverflow.com/q/17246973
score: 0
tagged with: highcharts
has comment: http://stackoverflow.com/comment/44200644

http://stackoverflow.com/q/27951061
has body: I have an app that's using the ember-rails gem on top of Ruby on Rails. I have an ember route that is '/projects' that I would like to set at the root URL. I know that it's possible to set this with a redirect like so: App.IndexRoute = Ember.Route.extend({ redirect: function() { this.transitionTo('/projects'); } }); However this means that my root URL is now always 'localhost:3000/projects'. Is it possible to change the root URL so that it routes to '/projects' but shows the URL as just localhost:3000. My current router.js is as follows: App.Router.reopen({ location: 'auto', }); App.Router.map(function() { this.resource('projects'), { path: '/' }; }); App.IndexRoute = Ember.Route.extend({ redirect: function() { this.transitionTo('/projects'); } }); And my Rails routes.rb is: Rails.application.routes.draw do namespace :api do namespace :v1 do resources :projects end end root to: 'home#index' get '*path', to: 'home#index' end Thanks!
answer count: 1
score: 1
tagged with: client-side
favorite count: 0
type: UnansweredQuestion
tagged with: ember.js
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/75049618
has comment: http://stackoverflow.com/comment/44376473
upvote count: 1
type: Question
has title: Setting Root URL in Ember
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27831561
score: 2
answers question: http://stackoverflow.com/q/27831484
downvote count: 0
has body: You actually want a find function that returns when the first occurrence is found. You can use Array.prototype.find if you are on ECMAScript 6 spec or you can implement a simple find like: function find8(arr) { // type checks skipped for brevity var i = 0, j = arr.length; for (; i &lt; j; i++) { if (arr[i].key === 8) { return arr[i]; } } throw new Error('Not found'); } If you want a more generic solution that accepts predicates (i.e. functions that return a boolean value), you can write a more generic function like: function find(arr, predicate) { // Again, type checks skipped for brevity var i = 0, j = arr.length; for (; i &lt; j; i++) { // Note the condition is now a call to the predicate function if (predicate(arr[i])) { return arr[i]; } } throw new Error('Not found'); }
upvote count: 2
type: Answer

http://stackoverflow.com/comment/44147828
has text: Your array doesn't make sense. it looks like coordinates that came out of KML (longitude, latitude, altitude tuples, separated by spaces; which is not a valid javascript array). To create a google.maps.Polyline, it needs to be an array of google.maps.LatLng objects.
type: QuestionComment
comment on: http://stackoverflow.com/q/27872443
score: 1
type: Comment

http://stackoverflow.com/q/27953911
has answer: http://stackoverflow.com/a/27954412
type: AnsweredQuestion
has title: How do I loop over images in table, get the src of ALL images and apply to new images in new table?
linked to: http://stackoverflow.com/q/27922814
score: 1
upvote count: 1
tagged with: loops
tagged with: image
accepted answer: http://stackoverflow.com/a/27954412
type: Question
linked to: http://stackoverflow.com/q/7977198
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
has body: I am looping through the images in a table, trying to get the source and then applying that src to a new image in a different table. I have managed to create new image objects in the new table cells (tested) but for some reason all I can get is the last image to display. Well, actually I know this is because the loop writes over the variable each time and it has the last value when it is applied, but I don't know how to get them all. Here is the relevant code. If you need more just holler or see Why can&#39;t I get my images to appear in table cells/nodes.. maybe I can get some closure? Thanks for your help. newImages = newTable.getElementsByTagName('img'); for(var i = 0; i &lt; newImages.length; i += 1) { var picSource = newImages[i]['src']; console.log(picSource);//This logs the path to the four different images var newImg = new Image();//creates a new image for each newImg.src = picSource;//gives each image src?? Just gives the last image }

http://stackoverflow.com/comment/44294835
comment on: http://stackoverflow.com/a/27933338
score: 0
type: AnswerComment
type: Comment
has text: To animate the scroll, it's easiest to use the JQuery library, so I added two lines of code to the answer above: First: ` ` in the ` ` to import the JQuery library. Second: changed the scroll to `$('html,body').animate({scrollTop: 0},1000);` this is a JQuery command that tells the page to animate to the top in 1000 milliseconds.

http://stackoverflow.com/comment/44037110
type: QuestionComment
has text: Yes. Like @funkwurm said, you need to wait for the first countdown to finish before moving onto the next. Right now you start the first and then immediately go to the second without waiting for the first timer to complete. So you need to rethink your method.
comment on: http://stackoverflow.com/q/27814803
score: 0
type: Comment

angular-strap
tag name: angular-strap
tags question: http://stackoverflow.com/q/27806339
type: Tag

http://stackoverflow.com/q/27830862
has title: jquery.countdown.js showing wrong date
has comment: http://stackoverflow.com/comment/44202123
accepted answer: http://stackoverflow.com/a/27831011
has comment: http://stackoverflow.com/comment/44067662
type: AnsweredQuestion
score: 0
has body: Following is the code i am using on jquery countdown but it is calculating wrong date.i need to set it to 1st feb 2015 , tried setting the month to 01 (month starts from zero) but in this case counter disappers
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44067766
has answer: http://stackoverflow.com/a/27831011
answer count: 1
tagged with: jquery
tagged with: countdown

http://stackoverflow.com/comment/44079139
has text: is there no way to do this before the page loads?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27837433

http://stackoverflow.com/comment/44403357
has text: What more info do you need? I've already been given, implemented and accepted the correct answer. The ' was a typo. The person giving the correct answer clearly understood that.
score: 0
comment on: http://stackoverflow.com/q/27925838
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27937638
has title: How to trigger onclick by pressing enter using inline javascript?
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27937788
answer count: 3
has answer: http://stackoverflow.com/a/27937955
accepted answer: http://stackoverflow.com/a/27937788
has comment: http://stackoverflow.com/comment/44271994
upvote count: 1
possible better answer: http://stackoverflow.com/a/27937844
downvote count: 1
has comment: http://stackoverflow.com/comment/44271936
has body: [FYI: i am not allowed to change how it was marked up. div will be clicked.. not a button or anchor] i have a menu(that should pass on accessibility standards) that will open its submenu when clicked. this is the onclick function, and i need to do the same function when pressing enter key, // parent menu (this will repeat) Calendar //submenu (this will repeat) Calendar Assignment Shift Assignment thanks! i tried my best to be clear whew!
favorite count: 0
has comment: http://stackoverflow.com/comment/44272162
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27937844
has comment: http://stackoverflow.com/comment/44273077
type: Question
has comment: http://stackoverflow.com/comment/44272190

http://stackoverflow.com/comment/44226015
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27913313
has text: Btw, you're cutting too much. The `now` is not a unix timestamp.
score: 0

http://stackoverflow.com/q/27895299
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: iframe
linked to: http://stackoverflow.com/q/802854
score: 2
tagged with: sandbox
type: Question
downvote count: 0
has title: Adding SCRIPTs to IFRAME via DOM, insertAdjacentHTML or document.write
tagged with: javascript
favorite count: 0
has body: I need to add SCRIPTs into a sandboxed IFRAME and I'm trying to avoid using document.write (see here and here) but the DOM version is not executing the scripts in order. In the example below, jQuery hasn't loaded by the time the in-line script has executed, while the document.write version first loads jQuery then executes the in-line script. For my purposes (ensuring that all leading libraries are loaded before running the in-line scripts, see here) document.write might be the correct approach (but DOM is better, just not working as it should), but I'd prefer to allow for async downloads if possible while ensuring that the script tags are executed in order. I have a feeling that the DOM approach ensures order for srced SCRIPT tags, but not in-line ones... But if anyone can help me get a version that works with DOM executing the scripts in the expected order that'd be great! Also... can anyone explain to me why the insertAdjacentHTML version doesn't function at all!? Testing DOM -vs- document.write Script additions... Testing DOM -vs- document.write Script additions...
linked to: http://stackoverflow.com/q/4537963

http://stackoverflow.com/q/27876398
upvote count: 2
answer count: 1
downvote count: 1
tagged with: javascript
has body: How can i automatically adjust the size of the div to its VISIBLE content? I have a page which shows radio buttons but the user can select to view only a specific amount of radiobuttons. When i click my checkbox to hide the elements They disappear. However the div stays the same size. How can i fix this? CODE &lt;script&gt; function getElementsByClass( searchClass, domNode, tagName) { if (domNode == null) domNode = document; if (tagName == null) tagName = '*'; var el = new Array(); var tags = domNode.getElementsByTagName(tagName); var tcl = " "+searchClass+" "; for(i=0,j=0; i&lt;tags.length; i++) { var test = " " + tags[i].className + " "; if (test.indexOf(tcl) != -1) el[j++] = tags[i]; } return el; } function checkChange(checkbox) { if (checkbox.checked) { if(checkbox.value == "Intel"){ var tabs = getElementsByClass('Intel'); for( i=0; i &lt; tabs.length; i++) tabs[i].style.display='none'; } }else if(!checkbox.checked) { if(checkbox.value == "Intel"){ var tabz = getElementsByClass('Intel'); for (i =0; i &lt; tabz.length; i ++) tabz[i].style.display="inline";} } } &lt;/script&gt; &lt;form action=""&gt; &lt;input type="checkbox" name="category" value="Intel" onclick="checkChange(this)" /&gt; Intel processoren&lt;br&gt; &lt;input type="checkbox" name="category" value="Amd" onclick="checkChange(this)" /&gt; AMD processoren&lt;br&gt; &lt;/form&gt; &lt;/div&gt; &lt;div id="items"&gt; &lt;form action="get.jsp?value=Processoren" method="post"&gt; // JSP CODE FOR ALL CHECKBOXES !!!// &lt;hr&gt; &lt;input type="submit" value="Send"&gt; &lt;/div&gt; &lt;/div&gt;
has answer: http://stackoverflow.com/a/27877157
type: AnsweredQuestion
has title: HTML DIV display none to element adjust size
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27877157

http://stackoverflow.com/q/27884427
answer count: 2
has title: MockJAX not responding to CasperJS
tagged with: mockjax
favorite count: 0
tagged with: casperjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27885866
has body: Below is my code which uses casperjs and mockjax . However , mockjax is not able to intercept the ajax call . It returns the ajax response instead of the mock response . Also, $.mockjax.mockedAjaxCalls().length this does not print anything . Any idea what I am doing here? Is there any way I could actually print the value of $.mockjax.mockedAjaxCalls() other than outside evaluate context ??. Please note that mock4.png does show a screenshot indicating that the mockjax callback has not happened . var casper = require("casper").create({ verbose: true, logLevel: 'error', clientScripts: ["jquery.mockjax.js", "jquery.js", "json2.js"] }); casper.on('remote.message', function(msg) { this.echo('remote message caught: ' + msg); }) casper.start('http://xyz:9000/abc', function() { this.evaluate(function() { this.capture('1.png') $.mockjax({ url: '/foo1', responseTime: 100, dataType: 'json', responseText: { sessionTimeoutRedirectUrl: "https://foo/hello", errorCode: "error.session.timeout" } }); }); this.capture('xyz123.png'); }); casper.waitForSelector('#order-wrapper', function() { this.click('#method-field-cc'); this.capture('mock2.png'); }); casper.waitForSelector('#cc-card-number', function() { this.capture('mock.png'); this.fillSelectors('form[id="cc-form"]', { 'input[id="cc-card-number"]': '4112344112344113', 'input[id="cc-first-name"]': 'first', 'input[id="cc-last-name"]': 'last', 'select[id="cc-expiry-month"]': '10', 'select[id="cc-expiry-year"]': '2016', 'input[id="tax-field-postal-code"]': '95051', 'input[id="cc-security-code"]': '123' }, true); this.click('#review-newcc'); this.capture('mock3.png'); }); casper.wait(1000, function() { this.echo("I've waited for a second."); casper.evaluate(function() { this.echo("I've waited for a second." + $.mockjax.mockedAjaxCalls().length) console.log($.mockjax.mockedAjaxCalls()); }); }); casper.evaluate(function() { this.echo("I've waited for a second." + $.mockjax.mockedAjaxCalls().length) }); casper.wait(1000, function() { this.…
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44180316
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/31038018
score: 0

http://stackoverflow.com/q/27936988
has title: jQuery Replicate an existing Div Multiple Times
has comment: http://stackoverflow.com/comment/44270843
has comment: http://stackoverflow.com/comment/44270950
has comment: http://stackoverflow.com/comment/44270816
tagged with: performance
has answer: http://stackoverflow.com/a/27937865
has body: I am building a search query which gives me results. I have a template ready for the item inside a hidden div. What I want to do is replicate the template n number of times using jQuery. So For example: I search for flights and I get 5 search results, I need to replicate the below div template 5 Times Rs 9500.00 AI-202 PNQ > DEL Depart: 10.00 AM Arrive: 12.00 PM AI-202 PNQ > DEL Depart: 10.00 AM Arrive: 12.00 PM Book Now Inside this div for 5 times Is there a better way to do that rather than string appending in jQuery? Thanks, Ankit Tanna
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27941789
has comment: http://stackoverflow.com/comment/44286391
has comment: http://stackoverflow.com/comment/44270960
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion

http://stackoverflow.com/comment/44295725
score: 2
comment on: http://stackoverflow.com/a/27950206
has text: thats actually the opposite of what I wanted. I wanted to have the element's current state be irrelevant. The state should be based on a boolean variable.
type: AnswerComment
type: Comment

gmail
type: Tag
tags question: http://stackoverflow.com/q/27893300
tags question: http://stackoverflow.com/q/27914545
tags question: http://stackoverflow.com/q/27843258
tags question: http://stackoverflow.com/q/27942712
tag name: gmail

http://stackoverflow.com/q/27833493
has title: How to redirect to dashboard if user is logged in with AngularJS?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44074636
type: Question
has comment: http://stackoverflow.com/comment/44075658
tagged with: javascript
has answer: http://stackoverflow.com/a/27841708
score: 0
has body: I am new in AngularJS. I want to redirect my page to dashboard if user is logged in. After login, i am getting access token which I am saving in cookies. I checked the solutions of Stack Overflow, then also my problem is not solved. Here is my code: app.js (function(window){ var app= angular.module('customersApp',['ngRoute','ngCookies','ui.bootstrap']); app.config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/login', { title: 'Login', controller: 'loginController', templateUrl: 'app/views/loginuser.html' }) .when('/logout', { title: 'Logout', templateUrl: 'partials/login.html', controller: 'loginController' }) .when('/dashboard', { title: 'Dashboard', templateUrl: 'app/views/dynamic_table.html', controller: 'dashboard' }) .when('/verified_artists', { title: 'Verified Artists', templateUrl: 'app/views/verified_artists.html', controller: 'artistController' }) .when('/new_artists', { title: 'New Request Artists', templateUrl: 'app/views/new_artists.html', controller: 'artistController' }) .otherwise({ redirectTo: '/login' }); }]); window.app = app; }(window)); loginController.js app.controller('loginController', function ($scope,$http,$cookies,$cookieStore) { //initially set those objects to null to avoid undefined error $scope.login = {}; $scope.signup = {}; $scope.doLogin = function (customer) { $.post("websiteurl.com/admin_login", { user_email : $scope.login.email, password : $scope.login.password }, function(data,status){ data = JSON.parse(data); console.log(data); var someSessionObj = { 'accesstoken' : data.access_token}; $cookies.dotobject = someSessionObj; $scope.usingCookies = { 'cookies.dotobject' : $cookies.dotobject, "cookieStore.get" : $cookieStore.get('dotobject') }; $cookieStore.put('obj', someSessionObj); $scope.usingCookieStore = { "cookieStore.get" : $cookieStore.get('obj'), 'cookies.dotobject' : $cookies.obj, }; console.log($cookieStore.get('obj').accesstoken); if(data.flag==10) { alert(data.error); } else { window.location.hre…
answer count: 1
has comment: http://stackoverflow.com/comment/44074369
tagged with: angularjs

http://stackoverflow.com/comment/44121002
has text: @JackDuong \w is the same as [a-zA-Z0-9_] so you dont need the _ after \w
comment on: http://stackoverflow.com/a/27852449
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/27955879
score: 0
tagged with: php
has title: What is the best way to share a layout for multiple HTML files?
has body: I like how in MVC you can have a _layout file in a shared folder and multiple cshtml files can use it. Is there anything similar I can do using HTML5, PHP, or Javascript? If so what's the most efficient way. Thanks :) Thanks. Using php files for headers/footers is exactly what I was looking for! Very simple stuff :)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44306729
has comment: http://stackoverflow.com/comment/44306742
accepted answer: http://stackoverflow.com/a/27956114
type: Question
tagged with: layout
tagged with: shared
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44306620
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27956114
has comment: http://stackoverflow.com/comment/44306637

http://stackoverflow.com/q/27959844
has title: Use a variable for Highcharts yAxis.Max
score: 1
accepted answer: http://stackoverflow.com/a/27960166
type: Question
answer count: 2
tagged with: highcharts
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27960069
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27960069
has body: Im trying to pass a variable('maxValue') into my Highcharts guage . I cant get the variable to pass in successfully, the graph renders but without the value. Ive tried Number and parseInt Functions but neither make a difference. I setup a JS fiddle here: http://jsfiddle.net/d5d4cgbe/16/ The code section in question: var maxValue = 120; //set the maxValue var $('#visitPerformanceWeek').highcharts(Highcharts.merge(gaugeOptions, { yAxis: { min: 0, max: maxValue, title: { text: 'Hours Worked' } }, I will eventually be passing a value collected from an AJAX request, this part I have working but have excluded from the fiddle to keep it simple. Help appreciated
has answer: http://stackoverflow.com/a/27960166
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/q/27844128
has body: I can't get a proper explain using the native mongodb driver for Node.js. When I use the mongo shell, everything is fine. Is my syntax wrong? Anything else I could be doing wrong? db.user.find({},{explain:true}).toArray db.user.find({}).explain I've tried both of these, there are two documents in the user table, and it gives me this output: { cursor: 'BasicCursor', isMultiKey: false, n: 1, nscannedObjects: 1, nscanned: 1, nscannedObjectsAllPlans: 1, nscannedAllPlans: 1, scanAndOrder: false, indexOnly: false, nYields: 0, nChunkSkips: 0, millis: 0, allPlans: [ { cursor: 'BasicCursor', isMultiKey: false, n: 1, nscannedObjects: 1, nscanned: 1, scanAndOrder: false, indexOnly: false, nChunkSkips: 0 } ], server: 'Rocket.local:27017', filterSet: false, stats: { type: 'LIMIT', works: 2, yields: 0, unyields: 0, invalidates: 0, advanced: 1, needTime: 1, needFetch: 0, isEOF: 1, children: [ [Object] ] } } This is wrong. When I run this same query in the mongo shell, it gives the the correct output: "cursor" : "BasicCursor", "isMultiKey" : false, "n" : 2, "nscannedObjects" : 2, "nscanned" : 2, "nscannedObjectsAllPlans" : 2, "nscannedAllPlans" : 2, "scanAndOrder" : false, "indexOnly" : false, "nYields" : 0, "nChunkSkips" : 0, "millis" : 0, "server" : "Rocket.local:27017", "filterSet" : false, "stats" : { "type" : "COLLSCAN", "works" : 4, "yields" : 0, "unyields" : 0, "invalidates" : 0, "advanced" : 2, "needTime" : 1, "needFetch" : 0, "isEOF" : 1, "docsTested" : 2, "children" : [] } I've been having a few other (related problems) as well... Limit = 1 = 1ms, Limit &gt; 1 = 150ms (mongo-melt-down) Odd MongoDB/Node Explain Results
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27863394
tagged with: javascript
has title: MongoDB Native Node Driver: Explain is Broken?
tagged with: mongodb
answer count: 2
linked to: http://stackoverflow.com/q/27831936
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/27830277
has answer: http://stackoverflow.com/a/27846458
has answer: http://stackoverflow.com/a/27863394
possible better answer: http://stackoverflow.com/a/27846458
tagged with: node.js
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/27840382
has answer: http://stackoverflow.com/a/27840687
score: 0
accepted answer: http://stackoverflow.com/a/27840687
downvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Loop through all classes and Ids of selected element and its childs
has comment: http://stackoverflow.com/comment/44084280
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44084333
has body: I would like to know, how it is possible to loop through all classes and Id's of an element and all its children. For example: and I just want to output: #wrapper, .first, #second, #sub as a console.log or similar. Note: I always want to select the highest parent $('#wrapper'); and loop through all siblings and nested siblings.
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 2

http://stackoverflow.com/comment/44022669
score: 1
comment on: http://stackoverflow.com/q/27806846
type: Comment
type: QuestionComment
has text: 'Plugin' is vague. Do you think you could clarify a bit?

http://stackoverflow.com/a/27836814
score: 2
answers question: http://stackoverflow.com/q/27836785
has body: You need to concatenate the string and the variable using +: var foo = myObject.foo; var bar = $('&lt;div&gt;&lt;/div&gt;').addClass("myClass " + foo); Or var myClass = "myClass"; var foo = myObject.foo; var bar = $('&lt;div&gt;&lt;/div&gt;').addClass(myClass + " " + foo);
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/27836785

http://stackoverflow.com/q/27864452
type: Question
has title: Swipe.js prev/next not working
answer count: 1
has answer: http://stackoverflow.com/a/32007746
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I'm working on this site http://www.lubittar.com/ which uses swipe.js - visit Timeline in the menu. I've followed the example almost exactly but the next and prev buttons are not working. If I add auto: 3000 to the script it works but the button functions are not being seen for some reason. content content content prev next at the bottom of the page
type: UnansweredQuestion
tagged with: swipe.js

http://stackoverflow.com/comment/44976639
comment on: http://stackoverflow.com/q/27829023
type: Comment
type: QuestionComment
has text: The SoundJS library has no issue playing a sound multiple times in FireFox without reloading. Support for HTML audio and WebAudio. http://createjs.com/#!/Demos/SoundJS/Audio-Test-Suite (click HTML audio only at the top, it defaults to web audio)
score: 0

http://stackoverflow.com/q/27958883
tagged with: jquery-ui-sortable
tagged with: jquery-ui
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I'm testing Sortable.js lists with this small example. I have a list of elements to be dragged from, and another list to store them by dropping the elements. NOTE: Sortable.js is different from JQuery-ui sortable, but the lack of Sortable.js documentation is making me consider switching to JQuery-ui Sortable, so I would accept an answer using it. The thing is, the drop area is the list, and it is a bit frustrating dropping over the edged of that list panel and not getting the item correctly dropped. Also, it is hard to find the list when empty if it has no borders. Sortable.js has an attribute named ghostClass, and according to the documentation it should store the class name for the drop placeholder. So I'm using the class name of the second list panel as the ghostClass for the first list. Nevertheless, it is not working, and item only get correctly dropped when over the list and not over the panel. HTML: Fruit store Apple Pear Banana Watermellon Shopping cart Banana 5 Pear 2 JS: // Create fruit store list var list_element = document.getElementById("fruit-list"); var fruit_list = new Sortable(list_element, { group: { name: "fruit_group", pull: 'clone', put: false }, sort: false, ghostClass: "droppable-area", }); // Create shopping cart list var cart_list_element = document.getElementById("cart-list"); var cart_list = new Sortable(cart_list_element, { group: { name: "fruit_group", pull: true, put: true }, }); Any idea? Here is a working JSFiddle.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/44391069
score: 1
upvote count: 1
type: Question
has title: Drag&Drop at Sortable.js lists: How to set a different drop area than a Sortable list?

http://stackoverflow.com/a/27808259
type: Answer
has comment: http://stackoverflow.com/comment/44026613
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44025585
answers question: http://stackoverflow.com/q/27803691
has comment: http://stackoverflow.com/comment/44025718
has comment: http://stackoverflow.com/comment/44025640
has body: Am I right to assume that both ItemsListController and ItemDetailModalController need an instance of the same scope in order to exchange the data? Yes. I actually think of modals as an extension of ItemsListController containing members shownDetails:ItemDetailModalController. Which means you don't need to come up with a messy way of sharing $scope as its just a single $scope. And how can I define the controller and the template for the modal directive using the interfaces above? This is what I have (note that you are sharing the scope): this.$modal.open({ templateUrl: 'path/To/ItemModalDetails.html', scope: this.$scope, }) Where $modal:IModalService corresponds to what angular strap gives you : http://angular-ui.github.io/bootstrap/#/modal
downvote count: 0

http://stackoverflow.com/a/27962464
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27962193
has comment: http://stackoverflow.com/comment/44319069
has comment: http://stackoverflow.com/comment/44319243
has comment: http://stackoverflow.com/comment/44319654
accepted answer of: http://stackoverflow.com/q/27962193
type: Answer
has comment: http://stackoverflow.com/comment/44319363
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44319605
has comment: http://stackoverflow.com/comment/44319126
has comment: http://stackoverflow.com/comment/44319191
has comment: http://stackoverflow.com/comment/44319626
has comment: http://stackoverflow.com/comment/44319658
has body: IndexCtrl is undefined. To fix the error define IndexCtrl. You can't use console.debug as the call to the service will be asynchronous. For now just assign the result to scope var IndexCtrl = function ($scope, Restangular){ $scope.data = Restangular.all("data").getList().$object; }; angular .module('app') .controller('IndexCtrl', IndexCtrl); IndexCtrl.$inject = ['$scope', "Restangular"]; There was also a problem with your service not being restful so I got another service url that was: angular.module('app',["restangular", "ngRoute"]) .config(function (RestangularProvider) { RestangularProvider.setBaseUrl('http://jsonplaceholder.typicode.com'); }); Plunkr

http://stackoverflow.com/a/27954671
answers question: http://stackoverflow.com/q/27933900
has body: Support for passing in watch tasks to the gulp.watch API as an array requires gulp version 3.5 at minimum. The gulp.watch API accepts an array of tasks only in gulp version 3.5 and up. My local gulp was version 3.4. I updated gulp to latest 3.8 version and my watch task worked correctly.
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27933900
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/27840251
answers question: http://stackoverflow.com/q/27840109
accepted answer of: http://stackoverflow.com/q/27840109
has body: You can reduce the array given by JSON.parse to a single object: var result = parsed.reduce(function (output, value) { return $.extend(output, value); }, {}); JSFiddle
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/44273382
comment on: http://stackoverflow.com/q/27938381
type: Comment
type: QuestionComment
has text: @empiric i am not getting the output in the desired format, the o/p was supposed to show 2 tabs, what i get is 4 lines showing the normal text.
score: 0

http://stackoverflow.com/a/37431637
has body: {{wl.name}} Above code should work for you. watchlist = [{name:watchlist1,index:0},{name:watchlist2,index:1},{name:watchlist3,index:3}] Tabs - Angular UI
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27910693
type: Answer
downvote count: 0

http://stackoverflow.com/comment/44095527
comment on: http://stackoverflow.com/q/27844953
has text: How difficult is it too program web sockets as I was led to believe that an AJAX based system is the simplest to code.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44158340
type: Comment
type: QuestionComment
has text: sorry for my english :/
comment on: http://stackoverflow.com/q/27878354
score: 0

http://stackoverflow.com/comment/44261970
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27915100
has text: you have two degrees of freedom for each of the control points. What direction would you move them in? Just along the tangent from/to the end points (so P1 along P0--P1 and P2 along P2--P3)?

http://stackoverflow.com/comment/44227461
score: 0
comment on: http://stackoverflow.com/q/27913929
type: Comment
type: QuestionComment
has text: Yes, the field is "username" as each mongoDB object has the username property.

timer
tags question: http://stackoverflow.com/q/27828154
tag name: timer
tags question: http://stackoverflow.com/q/27929790
type: Tag
tags question: http://stackoverflow.com/q/27955059
tags question: http://stackoverflow.com/q/27867431
tags question: http://stackoverflow.com/q/27855584
tags question: http://stackoverflow.com/q/27921071

http://stackoverflow.com/a/27823931
upvote count: 2
has body: Q.all(returns_a_promise()) .then(returns_array_of_promises).all() .then(returns_another_array_of_promises).all() .then(yet_another_array_o_promises).all() .then(function () { logger.info("yea we done"); });
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27822942
answers question: http://stackoverflow.com/q/27822942
type: Answer

http://stackoverflow.com/a/27957573
has body: For jQuery 1.9 or higher you need to user .prop("checked", true) instead of .atrr() Fot the Highlighting create a CSS Class and Change it with .toogleClass
answers question: http://stackoverflow.com/q/27957427
has comment: http://stackoverflow.com/comment/44309536
score: 0
type: Answer

http://stackoverflow.com/q/27936772
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/42358879
has answer: http://stackoverflow.com/a/68913744
has answer: http://stackoverflow.com/a/46973278
has answer: http://stackoverflow.com/a/55737943
has answer: http://stackoverflow.com/a/49205167
has answer: http://stackoverflow.com/a/48579540
has comment: http://stackoverflow.com/comment/101704795
has body: Both Object.assign and Object spread only do a shallow merge. An example of the problem: // No object nesting const x = { a: 1 } const y = { b: 1 } const z = { ...x, ...y } // { a: 1, b: 1 } The output is what you'd expect. However if I try this: // Object nesting const x = { a: { a: 1 } } const y = { a: { b: 1 } } const z = { ...x, ...y } // { a: { b: 1 } } Instead of { a: { a: 1, b: 1 } } you get { a: { b: 1 } } x is completely overwritten because the spread syntax only goes one level deep. This is the same with Object.assign(). Is there a way to do this?
has answer: http://stackoverflow.com/a/57331755
has answer: http://stackoverflow.com/a/55736757
has answer: http://stackoverflow.com/a/42646536
has answer: http://stackoverflow.com/a/63007586
has answer: http://stackoverflow.com/a/64057242
upvote count: 655
has answer: http://stackoverflow.com/a/34749873
has answer: http://stackoverflow.com/a/76258707
has answer: http://stackoverflow.com/a/38822026
has answer: http://stackoverflow.com/a/78510372
has answer: http://stackoverflow.com/a/59282110
has answer: http://stackoverflow.com/a/65001459
has answer: http://stackoverflow.com/a/61395050
tagged with: spread-syntax
favorite count: 0
has answer: http://stackoverflow.com/a/48218209
has answer: http://stackoverflow.com/a/45209456
has answer: http://stackoverflow.com/a/50228121
has comment: http://stackoverflow.com/comment/123454982
has answer: http://stackoverflow.com/a/51788079
has answer: http://stackoverflow.com/a/55633716
linked to: http://stackoverflow.com/q/9229645
has answer: http://stackoverflow.com/a/41805262
has comment: http://stackoverflow.com/comment/44270544
type: Question
has answer: http://stackoverflow.com/a/69040130
has answer: http://stackoverflow.com/a/77409298
score: 653
has answer: http://stackoverflow.com/a/44270153
answer count: 51
has answer: http://stackoverflow.com/a/59239119
has comment: http://stackoverflow.com/comment/44280744
has title: How to deep merge instead of shallow merge?
has answer: http://stackoverflow.com/a/65050259
linked to: http://stackoverflow.com/q/122102
has answer: http://stackoverflow.com/a/54904499
has answer: http://stackoverflow.com/a/38907692
has answer: http://stackoverflow.com/a/58818368
has answer: http://stackoverflow.com/a/48185869
has answer: http://stackoverflow.com/a/28248548
has answer: http://stackoverflow.com/a/50242896
has comment: http://stackoverflow.com/comment/105744043
has answer: http://stackoverflow.com/a/41474728
has answer: http://stackoverflow.com/a/40931149
has answer: http://stackoverflow.com/a/68789434
downvote count: 2
has answer: http://stackoverflow.com/a/78723467
has comment: http://stackoverflow.com/comment/44270417
has answer: http://stackoverflow.com/a/76802488
linked to: http://stackoverflow.com/q/8572826
has answer: http://stackoverflow.com/a/53092443
has answer: http://stackoverflow.com/a/71187383
has answer: http://stackoverflow.com/a/44223050
has answer: http://stackoverflow.com/a/48275932
linked to: http://stackoverflow.com/q/7390426
has answer: http://stackoverflow.com/a/37164538
has answer: http://stackoverflow.com/a/67251663
has comment: http://stackoverflow.com/comment/57506296
has answer: http://stackoverflow.com/a/42626203
has comment: http://stackoverflow.com/comment/57506751
has answer: http://stackoverflow.com/a/51148924
has answer: http://stackoverflow.com/a/59008477
has answer: http://stackoverflow.com/a/72402910
has answer: http://stackoverflow.com/a/70452304
linked to: http://stackoverflow.com/q/7582001

http://stackoverflow.com/a/27920302
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27919826
answers question: http://stackoverflow.com/q/27919826
has body: I think I find the answer at node_modules/browserify/node_modules/browser-pack/prelude.js, but the codes look cryptic for me.. Hope someone could give a better explanation.. // modules are defined as an array // [ module function, map of requireuires ] // // map of requireuires is short require name -&gt; numeric require // // anything defined in a previous bundle is accessed via the // orig method which is the requireuire for previous bundles (function outer (modules, cache, entry) { // Save the require from previous bundle to this closure if any var previousRequire = typeof require == "function" &amp;&amp; require; function newRequire(name, jumped){ if(!cache[name]) { if(!modules[name]) { // if we cannot find the the module within our internal map or // cache jump to the current global require ie. the last bundle // that was added to the page. var currentRequire = typeof require == "function" &amp;&amp; require; if (!jumped &amp;&amp; currentRequire) return currentRequire(name, true); // If there are other bundles on this page the require from the // previous one is saved to 'previousRequire'. Repeat this as // many times as there are bundles until the module is found or // we exhaust the require chain. if (previousRequire) return previousRequire(name, true); var err = new Error('Cannot find module \'' + name + '\''); err.code = 'MODULE_NOT_FOUND'; throw err; } var m = cache[name] = {exports:{}}; modules[name][0].call(m.exports, function(x){ var id = modules[name][1][x]; return newRequire(id ? id : x); },m,m.exports,outer,modules,cache,entry); } return cache[name].exports; } for(var i=0;i&lt;entry.length;i++) newRequire(entry[i]); // Override the current require with this new one return newRequire; })
type: AcceptedAnswer
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/44108348
comment on: http://stackoverflow.com/q/27852078
has text: UM, that is not the normal name for the jquery ui stylesheet...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27838474
type: Answer
accepted answer of: http://stackoverflow.com/q/27838001
answers question: http://stackoverflow.com/q/27838001
has comment: http://stackoverflow.com/comment/44083014
type: AcceptedAnswer
has body: Thanks to T.J Crowder _.reduce did the trick : _.reduce(collection, function (aggr, obj) { aggr[obj.a] = aggr[obj.a] || {}; aggr[obj.a][obj.b] = obj; return aggr; }, {});
score: 0

http://stackoverflow.com/a/27860262
answers question: http://stackoverflow.com/q/27860213
has body: Try this : $('textarea').on('keyup',function(){ $('p.youtyped').text($(this).val()); });
score: 0
type: Answer

http://stackoverflow.com/comment/44049690
type: AnswerComment
has text: before works because the ButtonField sets automatically the commandArgument with the index and the Button not... I updated to `<asp:Button ID="btn" runat="server" Text="Status" CommandName="atender" OnClientClick="return confirm('Are you sure?');" CommandArgument='<%# Container.DataItemIndex %>' />` and works great. Thanks a lot!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27819874

http://stackoverflow.com/a/27893084
type: Answer
has body: try: var extractText = data.query.pages[63123].extract
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27893029

http://stackoverflow.com/a/27919285
answers question: http://stackoverflow.com/q/27919193
has comment: http://stackoverflow.com/comment/44238273
has comment: http://stackoverflow.com/comment/44236414
downvote count: 0
has comment: http://stackoverflow.com/comment/44236285
has body: how could I actualy get the new html_as_string variable with new urls Is that what you're looking for ? function myFunction(html_as_string) { var t= $(html_as_string).find('a').each(function() { // yes this actualy works. $(this).attr('href', 'http://some-other-link.whatever'); }).end(); return t; // if you want it as a string use t.html() , else use t. }
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44236511
has comment: http://stackoverflow.com/comment/44236209
score: 1
has comment: http://stackoverflow.com/comment/44236508
has comment: http://stackoverflow.com/comment/44236230
has comment: http://stackoverflow.com/comment/44236253
has comment: http://stackoverflow.com/comment/44236222

http://stackoverflow.com/comment/44276477
type: Comment
has text: @ImHappy so what do you need the sum of all the numbers in `result2`? If not why cant you just iterate over the resultant array. This answer does exactly what you asked for in your 2 bullet points in the question - but just in a much neater way than you're trying to do it!
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27939970

http://stackoverflow.com/comment/44180844
has text: If you're creating the properties in the constructor, then the only way to tell is to examine the code of the constructor. That obviously would get complicated if the constructor *conditionally* sets the properties.
type: Comment
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/27889925

http://stackoverflow.com/comment/44421750
type: Comment
type: QuestionComment
has text: You can look for the PK error and call [acceptChanges](http://www.breezejs.com/sites/all/apidocs/classes/EntityManager.html#method_acceptChanges) if you want to assume the save succeeded. Subsequent saves will fail in systems where the server sets concurrency properties during inserts/updates because the client's concurrency prop values don't match the server's. If none of your props have concurrency mode = fixed OR concurrency mode fixed props are assigned on the client you should be fine.
score: 0
comment on: http://stackoverflow.com/q/27952777

http://stackoverflow.com/q/27909938
favorite count: 0
has comment: http://stackoverflow.com/comment/44220802
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/44221434
has comment: http://stackoverflow.com/comment/44232597
has body: Hello I was reading up on this problem and people had mentioned that to get click to run on safari and chome you needed to have the code set up like so $('input[type=submit]#btnIsAddress').bind('click', function (event) { alert("this is code"); selectAddress(event); event.preventDefault(); return false; }); This code works on all browsers on a desktop and will work on Chrome, Dolphin and Mercury on an iPad but it will not work on safari on an iPad (go figure the most used one...) Instead it will treat the button as if its just text, it doesn't even try to run someone or give me the little click animation when pressed. However I have noticed that if I let the iPad go to sleep mode while on the page then turn the iPad back on the button will work with no problem. Has anyone else run into this sort of problem before? I'm guessing its something to do with my javascript but it seems like pretty simple script...
score: 1
has answer: http://stackoverflow.com/a/27928858
type: Question
has comment: http://stackoverflow.com/comment/44220298
tagged with: iphone
answer count: 1
downvote count: 0
tagged with: ios
has comment: http://stackoverflow.com/comment/44219791
tagged with: javascript
tagged with: jquery
tagged with: ipad
has comment: http://stackoverflow.com/comment/44219381
has title: button click javascript not running on iPad/iPhone safari

http://stackoverflow.com/comment/44130727
has text: Remove the leading `/` from your download path.
score: 0
comment on: http://stackoverflow.com/q/27864137
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27869552
answers question: http://stackoverflow.com/q/27869381
downvote count: 0
has body: You can specify source as An array of strings: [ "Choice1", "Choice2" ] An array of objects with label and value properties: [ { label: "Choice1", value: "value1" }, ... ] look jquery docs
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/27845932
has comment: http://stackoverflow.com/comment/44096002
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27845670
accepted answer of: http://stackoverflow.com/q/27845670
has body: Bind the first ng-repeat to the tbody: {{transaction.transLocale}} {{user.name}} {{transaction.transDate}} {{transaction.transTime}} {{transaction.transAmount}} {{transaction.transType}} {{transaction.directObject}} It is okay to have multiple tbody elements in your table.
upvote count: 1
type: AcceptedAnswer
type: Answer

google-chrome-extension
tags question: http://stackoverflow.com/q/27952019
tags question: http://stackoverflow.com/q/27823740
tags question: http://stackoverflow.com/q/27907941
tags question: http://stackoverflow.com/q/27888704
tags question: http://stackoverflow.com/q/27899740
tags question: http://stackoverflow.com/q/27933923
tags question: http://stackoverflow.com/q/27947395
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/27882765
tags question: http://stackoverflow.com/q/27930016
tags question: http://stackoverflow.com/q/27897836
tags question: http://stackoverflow.com/q/27906485
tags question: http://stackoverflow.com/q/27848907
tags question: http://stackoverflow.com/q/27894030
tags question: http://stackoverflow.com/q/27826998
tags question: http://stackoverflow.com/q/27814345
tags question: http://stackoverflow.com/q/27870101
tags question: http://stackoverflow.com/q/27912213
tags question: http://stackoverflow.com/q/27962419
tags question: http://stackoverflow.com/q/27948106
type: Tag
tags question: http://stackoverflow.com/q/27873021
tags question: http://stackoverflow.com/q/27834946
tags question: http://stackoverflow.com/q/27913065
tags question: http://stackoverflow.com/q/27881608
tags question: http://stackoverflow.com/q/27879835
tags question: http://stackoverflow.com/q/27821980
tags question: http://stackoverflow.com/q/27957726
tags question: http://stackoverflow.com/q/27841870
tags question: http://stackoverflow.com/q/27852932
tags question: http://stackoverflow.com/q/27927924
tags question: http://stackoverflow.com/q/27930424
tags question: http://stackoverflow.com/q/27855110
tags question: http://stackoverflow.com/q/27950889
tags question: http://stackoverflow.com/q/27867088
tags question: http://stackoverflow.com/q/27872908
tags question: http://stackoverflow.com/q/27893300
tags question: http://stackoverflow.com/q/27888988
tags question: http://stackoverflow.com/q/27823480
tags question: http://stackoverflow.com/q/27935854
tags question: http://stackoverflow.com/q/27869360
tags question: http://stackoverflow.com/q/27869063
tags question: http://stackoverflow.com/q/27850092
tags question: http://stackoverflow.com/q/27949270
tags question: http://stackoverflow.com/q/27954806
tags question: http://stackoverflow.com/q/27892282
tags question: http://stackoverflow.com/q/27908309
tags question: http://stackoverflow.com/q/27923586
tags question: http://stackoverflow.com/q/27885060

http://stackoverflow.com/q/27893399
has answer: http://stackoverflow.com/a/27895085
has answer: http://stackoverflow.com/a/27894221
downvote count: 1
type: Question
has body: I'm working on a restartless firefox addon. Using firefox developer edition v36. The MDN page on the Dom File API claims that you can import File as: const {File, Services} = Cu.import('resource://gre/modules/Services.jsm', {}); But Services.jsm clearly does not export a File Object. I also tried: new contentWindow.File( filename ) But this gives a very descriptive NS_ERROR_FAILURE. Any clues are welcome, thanks
tagged with: gecko
linked to: http://stackoverflow.com/q/19780396
tagged with: firefox
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/27895085
tagged with: firefox-addon
favorite count: 0
has title: How do I use the Dom File API from privileged code?
has comment: http://stackoverflow.com/comment/44188642
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27894221
score: 0

http://stackoverflow.com/comment/44137836
type: Comment
score: 0
type: QuestionComment
has text: as @adeneo said, please debug via `console.log()`, not `alert()`.
comment on: http://stackoverflow.com/q/27867658

http://stackoverflow.com/comment/44233919
score: 0
has text: To be honest this is very very basic stuff and there are tons of tutorials out there that covers this specifically. I suggest going back to some of the 101 tutorials (not trying to be mean)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27917076

http://stackoverflow.com/comment/44292318
has text: It's a little less automated than I'd like but you gave me an idea of just inserting the content after a parent of the link, with a span like you mentioned. The second idea is good but it's not getting perfect placement each time. I think because some of my insertion placement is a little but subjective for aesthetic reasons, I may cave and go with the manually placed span idea for now. Thanks Joe.
comment on: http://stackoverflow.com/a/27911500
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27805838
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27805693
has body: You need to convert your array into a string. You may simply use the .join() method of Array, which joins all elements of an array into an string, using whichever separator you want. In your case, a simple newline \n would work. MailApp.sendEmail("YOURID@nyu.edu", "The form has been updated", array.join('\n'));
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27805693
type: Answer
score: 3

http://stackoverflow.com/comment/44287956
type: QuestionComment
score: 2
has text: @slime scripts are loaded and run just as soon as the ` ` tag is seen. By definition, if the script exists (such that it could be removed) it must already have been loaded.
comment on: http://stackoverflow.com/q/27945969
type: Comment

http://stackoverflow.com/q/27856799
tagged with: javascript
has answer: http://stackoverflow.com/a/27857005
tagged with: show-hide
has answer: http://stackoverflow.com/a/27857306
has answer: http://stackoverflow.com/a/27856938
accepted answer: http://stackoverflow.com/a/27856938
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44116853
has answer: http://stackoverflow.com/a/27857021
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27856875
favorite count: 0
has answer: http://stackoverflow.com/a/27856906
has answer: http://stackoverflow.com/a/27856899
has comment: http://stackoverflow.com/comment/44116776
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Why the show/hide div is working in firefox but not in google chrome?
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27856875
type: Question
has body: Following is the concerned HTML code : Traditional class Online class All Mon Tue Wed Thu Fri Sat Sun hr min am pm hr min am pm The respective jQuery code to hide/show div (i.e. )is as follows : The above functionality of hide/show is working perfect in Mozilla firefox but not in Google Chrome. It always shows the . Why so? Please help me. Thanks.
has answer: http://stackoverflow.com/a/27856961
answer count: 8

http://stackoverflow.com/a/31474663
downvote count: 0
answers question: http://stackoverflow.com/q/27934411
score: 9
upvote count: 9
has body: I had this problem in a site hosted in IIS due the X-Content-Type-Options header being set in a parent applications web.config like this: &lt;system.webServer&gt; &lt;httpProtocol&gt; &lt;customHeaders&gt; &lt;add name="X-Content-Type-Options" value="nosniff" /&gt; &lt;/customHeaders&gt; &lt;/httpProtocol&gt; &lt;/system.webServer&gt; Removing it in the applications web.config fixed it: &lt;remove name="X-Content-Type-Options" /&gt;
type: Answer

http://stackoverflow.com/q/27847747
type: Question
has body: I'm a struggling learner of php and javascript and Have been searching frantically for a solutionbut to no avail. I am trying to send a json object/string from one page to another using php and then echo the results in that new page (eventually to generate a pdf using tcppdf) . So basically some javascript generates an object, pageStructure, in one page, which I then stringify: var jsonString = JSON.stringify(pageStructure); alert(jsonString);` The alert pops up fine. I now want to send (post) this to another php file getdata.php and then play around with it to construct a pdf. I have tried posting with forms but updating the value of an input in the form with jsonString won't work. **ADDITION - EXPLANATION OF MY PROBLEM HERE I created a form as follows: &lt;form action="getdata.php" method="post"&gt; &lt;textarea type="hidden" id="printMatter" name="printMatter" value=""&gt;&lt;/textarea&gt; &lt;button type="submit"&gt;&lt;span class="glyphicon glyphicon-eye-open" &gt;&lt;/span&gt;&lt;/button&gt; &lt;/form&gt; I have some code after constructing jsonString to set the value of the textarea to that value: document.getElementById('printMatter').value = jsonString; alert(document.getElementById('printMatter').value); A submit button activates the form which opens the getdata.php page but I noticed two things: (1) before sending the jsonString string is full of escapes () before every quote mark ("). (2) when getdata.php opens, the echoed jsonString has changed to include no \s but instead one of the values ('value') of an object in the json string (a piece of svg code including numerous \s) - for example (truncated because the value is a very long svg string, but this gives the idea): {"type":"chartSVG","value":"&lt;g transform=\"translate(168.33333333333334,75)\" class=\"arc\"&gt;... has changed to integers - for example: {"type":"chartSVG","value":"12"} I don't understand how or why this happens and what to do to get the full svg code to be maintained after the form …
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: -1
tagged with: post
answer count: 2
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44106629
has comment: http://stackoverflow.com/comment/44101976
type: UnansweredQuestion
tagged with: php
has title: post json data to php and echo result
upvote count: 0
has answer: http://stackoverflow.com/a/27847799
downvote count: 1
has comment: http://stackoverflow.com/comment/44099547
has answer: http://stackoverflow.com/a/27847841
has comment: http://stackoverflow.com/comment/44099324

http://stackoverflow.com/comment/44212606
has text: @Quentin the first statement is without checked= true attribute ` ` and this statement has checked=true attribute in element ` ` this is the difference! one has checked=true attribute and other one has not!! so, I NEED, WHEN THIS CHECK BOX CHECKED , THEN checked=true must be in this element like `checked=true` complete it should seems following ` ` hope u got!!
score: 0
comment on: http://stackoverflow.com/q/27905978
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27954792
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27954553
answers question: http://stackoverflow.com/q/27954553
has body: I placed a circular sensor on the page which changes the background when hovered. Since the sensor now is a parent of the links, all events will bubble up. You can click on the elements while still using certain areas of the sensor as you like $('body').mousemove(function(e) { // We want it circular on page so we take 50% left and 50% top as the middle // Cirle has radius = 100px var middle = { x: $(window).width() / 2, y: $(window).height() / 2 }; // Our middle-point var normalize = { x: middle.x - e.pageX, y: middle.y - e.pageY }; // mouse-position relative to the middle var radius = 100; // radius // some Math if (normalize.x * normalize.x + normalize.y * normalize.y < radius * radius) { // inside circle $('body').css('background', 'red'); } else { // outside $('body').css('background', 'white'); } }) body, html { height: 100%; width: 100%; margin: 0; padding: 0; } One Two Three Four
has comment: http://stackoverflow.com/comment/44327426

http://stackoverflow.com/comment/44100298
type: QuestionComment
comment on: http://stackoverflow.com/q/27848235
score: 0
has text: If it's not doing what you want, what *is* it doing?
type: Comment

http://stackoverflow.com/q/27872499
has comment: http://stackoverflow.com/comment/44147459
type: Question
has comment: http://stackoverflow.com/comment/44147322
has comment: http://stackoverflow.com/comment/44147454
tagged with: javascript
has comment: http://stackoverflow.com/comment/44147385
has answer: http://stackoverflow.com/a/27873533
has comment: http://stackoverflow.com/comment/44147387
score: 0
has comment: http://stackoverflow.com/comment/44147480
upvote count: 1
answer count: 1
downvote count: 1
has title: How to play a sound when first entering a webpage?
has comment: http://stackoverflow.com/comment/44147487
has comment: http://stackoverflow.com/comment/44147317
has comment: http://stackoverflow.com/comment/44147435
has comment: http://stackoverflow.com/comment/44147483
favorite count: 0
has comment: http://stackoverflow.com/comment/44147499
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44147506
has comment: http://stackoverflow.com/comment/44147468
has body: How would I make an mp3 play on my html page but only the first time someone enters? So that if they came back to that same page a second time they wouldn't hear the sound a second time? EDIT: I know how to play sounds and everything I just need to find out the 'first time only' part of it.
has comment: http://stackoverflow.com/comment/44147502
has comment: http://stackoverflow.com/comment/44147438

http://stackoverflow.com/comment/44330353
type: Comment
has text: Turns out I had it correct, but if you bind something to 'results' and instead u type 'resluts', it is not the framework's fault. Thank you ALL for your help, much appreciated and also thanks for the link.
comment on: http://stackoverflow.com/a/27951384
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44026291
type: QuestionComment
has text: @FelixKling Thanks, but I'm trying to ask about practical limits in production. If I carry an array around with 4 billion elements, I might have some laggy pages :)
comment on: http://stackoverflow.com/q/27808610
score: 0
type: Comment

http://stackoverflow.com/comment/44047535
type: QuestionComment
comment on: http://stackoverflow.com/q/27820682
has text: @David He want to `move`the link element, not copy.
score: 0
type: Comment

http://stackoverflow.com/a/27871371
downvote count: 0
has comment: http://stackoverflow.com/comment/44175229
type: Answer
has body: An explanation to why you need to click the button twice: @Royalty is correct. The php runs first. The php is in your script block. It returns an error since $_POST['my_var'] is undefined. This is echoed inside the script block causing your page halt scripting because of an error. When you click submit. The form is submitted (actually the page is reloaded) and the post var gets filled this time. So no error in PHP means nothing gets echoed into the script block meaning no error is raised by the browser. Now clicking upon submit executes the function test. But to follow up on the comments. Your script actually works by incident. If you want to write to a file use the action attribute on the form or perform an ajax call. Form action WRITE AJAX function sendAjax(e) { e.preventDefault(); //prevent the default action of the form. var xmlhttp; xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 ) { if(xmlhttp.status == 200){ //request is complete and loaded //do something with the response. } else if(xmlhttp.status == 400) { alert('There was an error 400') } else { alert('something else other than 200 was returned') } } } xmlhttp.open("POST", "file.php", true); //true means asynchronously. xmlhttp.send("content="+document.getElementById('contain').innerHTML); } HTML WRITE file.php should be replaced with a php file on your server that runs: <?php $content = $_POST["my_var"]; $myfile = fopen("newfile.php", "w") or die("Unable to open file!"); fwrite($myfile, $content); fclose($myfile); ?>
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44175448
answers question: http://stackoverflow.com/q/27870828

http://stackoverflow.com/a/27907450
score: 0
answers question: http://stackoverflow.com/q/27882764
has comment: http://stackoverflow.com/comment/44308550
has comment: http://stackoverflow.com/comment/44263768
type: Answer
has body: If you using observer.isStopped or related, you doing something wrong. These are not API functions, they are implementation details. I'd like to find a way to detect whether a observer has finished using a customized observable, which I created with Rx.Observable.create, such that the customized observable can end it and do some clean up properly. Observers do clean up when 'onCompleted' happens. In the Observable.create above, you should call observer.onCompleted() when you consider the custom observable to have ended, or never call observer.onCompleted() if the custom observable is meant to be infinite. Also, you should wrap the whole code inside Observable.create with try/catch and call observer.onError(err) in the catch. If you are trying to make the Observable "clean up" when an observer "has finished using the observable", then you are doing it wrong. Essentially, if the custom observable needs to react to the observer, then it means the observer should also be an observable. Likely, Observable.create is not the tool for this. Better tell what you are trying to accomplish instead of how to do something specific. UPDATE: Based on the animations you want to do: in the context of RxJS, requestAnimationFrame is a Scheduler, not an Observable. Use it from the RxJS-DOM library.
has comment: http://stackoverflow.com/comment/66196413
has comment: http://stackoverflow.com/comment/44293905
has comment: http://stackoverflow.com/comment/44311390

http://stackoverflow.com/a/27978161
accepted answer of: http://stackoverflow.com/q/27892082
has comment: http://stackoverflow.com/comment/44416189
upvote count: 3
has comment: http://stackoverflow.com/comment/44412617
score: 3
has comment: http://stackoverflow.com/comment/44392288
has body: Before answering, I've modified your example slightly to highlight execution flow: function a() { console.log('a1'); var c = function(b2) { var d = function() { console.log('a2'); b2(); }); requestAnimationFrame(d); } b(c); } function b(a2) { console.log('b1'); var e = function() { var f = function() { console.log('b2'); }); requestAnimationFrame(f); } a2(e); } This is the same code, except I've named the four anonymous functions c, d, e and f, because I want to refer to them. Here's the order of execution: a is called a calls b synchronously b calls c synchronously c calls requestAnimationFrame (an async API) requestAnimationFrame returns c returns b returns and is done executing a returns and is done executing. Later, when an animation frame becomes available, this happens: d is called d calls e synchronously e calls requestAnimationFrame etc. Of course e has access to variables defined in b which outlive the execution of the original b thanks to JavaScript closures. Likewise, in JavaScript, we view a as an asynchronous operation that ends once everything a initiates is done, but there are only two asynchronous steps (4 and 11) in it, so those two would benefit from promises. Now onto your question: Can promises provide the same result and separation, without b knowing about a? Yes, but it wont be a fair comparison to your example, because it'll bulk up your synchronous calls to be asynchronous when it's unneeded: function a() { console.log('a1'); var b2; b().then(function(result) { b2 = result; return new Promise(function(r) { requestAnimationFrame(r); }) }).then(function() { console.log('a2'); return b2(); }).catch(function(e) { console.log(e.message); // error-handling }); } function b() { console.log('b1'); return Promise.resolve(function() { return new Promise(function(r) { requestAnimationFrame(r); }).then(function() { console.log('b2'); }); }); } The trick here is that b returns steps to execute later in a, which is a pattern that can be repeated. Is this a…
has comment: http://stackoverflow.com/comment/44456186
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27892082
has comment: http://stackoverflow.com/comment/44391984
type: Answer

http://stackoverflow.com/q/27909173
tagged with: javascript
linked to: http://stackoverflow.com/q/12654631
has comment: http://stackoverflow.com/comment/44217726
favorite count: 0
tagged with: angularjs
has body: I have a cascading select with 2nd dropdown appears based on the first dropdown selection. An extra blank option appears which is not part of intended behaviour of the dropdown. How do I avoid empty extra select from appearing in dropdown? code for my cascading dropdowns is $scope.getSubStatuses = function(attempt_status) { var statuses = $scope.statuses; for(var index in statuses) { if(statuses[index].name === attempt_status) { if(statuses[index].children) { $scope.subStatuses = statuses[index].children; } else { $scope.subStatuses = []; } break; } } };
has comment: http://stackoverflow.com/comment/44217966
score: 2
has comment: http://stackoverflow.com/comment/44217952
type: AnsweredQuestion
downvote count: 0
tagged with: angularjs-ng-options
type: Question
has title: Default select not working in ngoptions when model initialized with ng-init
has comment: http://stackoverflow.com/comment/44218160
accepted answer: http://stackoverflow.com/a/27909326
has comment: http://stackoverflow.com/comment/44217847
tagged with: angularjs-scope
upvote count: 2
tagged with: angularjs-ng-model
has answer: http://stackoverflow.com/a/27909326
answer count: 1

http://stackoverflow.com/comment/44244086
score: 0
type: Comment
type: QuestionComment
has text: You might find [this question](http://stackoverflow.com/questions/14795145/how-the-single-threaded-non-blocking-io-model-works-in-node-js) enlightening.
comment on: http://stackoverflow.com/q/27923487

http://stackoverflow.com/a/27861824
answers question: http://stackoverflow.com/q/27861432
has comment: http://stackoverflow.com/comment/44463912
type: Answer
accepted answer of: http://stackoverflow.com/q/27861432
has body: Use HTML LABEL Tag.check the demo here
has comment: http://stackoverflow.com/comment/44438780
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/27863963
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27863787
type: Answer
accepted answer of: http://stackoverflow.com/q/27863787
score: 3
has body: This is not very good idea to do it like this, however it's interesting to understand why it happens. In your code below you are defining global variable textAreaID: var textAreaID; $(function() { var myTextArea = $('#' + textAreaID); //something is being loaded here, and it is loaded fine. }); function setTextAreaParameters(param) { textAreaID = param; } This script is injected three times into document. After the last script tag the value of textAreaID variable will be myTextAreaID3, because it's global and the last setTextAreaParameters invocation will override previous. Remember that scripts are loaded synchronously in your case (no async or deferred attribute), it means that onload callbacks don't wait and immediately set textAreaID to new values. However DOMContentLoaded event has not yet fired. This is the event you are subscribing with this code: $(function() { // DOMContentLoaded }); When it eventually does - only the third textarea will be processed - the one with id myTextAreaID3. Better approach would be to have only one script tag and set textareas the same className attribute: &lt;textarea id="myTextAreaID2" name="myTextArea2" class="editor"&gt;&lt;/textarea&gt; Then in the script probably have some sort of map with configuration parameters for each individual textarea.
upvote count: 3
has comment: http://stackoverflow.com/comment/44195326
downvote count: 0

http://stackoverflow.com/comment/44278295
comment on: http://stackoverflow.com/a/27938064
score: 0
type: Comment
has text: Please tell me if the problem exists in all popular browsers or just one and which jQuery version you are using.
type: AnswerComment

http://stackoverflow.com/a/27945346
type: Answer
upvote count: 6
score: 6
has body: Both answers by @thefourtheye and @Remigius Kijok are correct. Whenever variables are declared and initialized within functions (or within the global scope), the declaration gets hoisted to the top of that scope. You can see this for yourself by wrapping either of the for loops you have within a function and then executing the function in your browser. Specifically, by setting a break point at that top of the function, you'll be able to see that all the variables are declared and initialized with the value undefined prior to the function executing. var loopy = function () { for (var i = 0; i &lt; 5; i += 1) { for (var j = 0; j &lt; 3; j += 1) { console.log('i is ' + i + ' and j is ' + j); } } }; loopy(); // place break point here As you can see in the photo, I'm using Chrome's dev tool and placing a break point on the execution of loopy(). After entering the function, but prior to executing any of the for loops, the variables i and j are both declared but undefined.
answers question: http://stackoverflow.com/q/27944953
downvote count: 0
has comment: http://stackoverflow.com/comment/44302584
has comment: http://stackoverflow.com/comment/44306922

http://stackoverflow.com/comment/44070510
comment on: http://stackoverflow.com/q/27832133
score: 0
type: Comment
type: QuestionComment
has text: Do you need to be able to handle parentheses inside? Like `"What is (500-(123+43))?"`

http://stackoverflow.com/a/27955880
answers question: http://stackoverflow.com/q/27955613
type: Answer
has comment: http://stackoverflow.com/comment/67554831
upvote count: 2
downvote count: 1
has body: In an angular form you are only meant to have one button - this calls ng-submit. If you want to have multiple button-like elements, you will need to style a div or input to look like a button. For example: Photo
score: 1

http://stackoverflow.com/comment/44122938
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27860284
has text: What's not working? `$('.child:checked').length` looks fine to me.

http://stackoverflow.com/q/27918563
type: AnsweredQuestion
score: 3
upvote count: 3
has body: I have a canvas on the page, I draw an image into it, now I would like to apply filters like brightness, contrast, sepia etc... The problem comes when a user chooses filters, cause the user needs to be able to select and un-select filters. So if for example, the user chooses sepia and contrast filter, I will apply both filters to the canvas, but if he un-select sepia I need to remove the sepia filter from the canvas (kind reset filters and apply only contrast)... and so on for all the available filters. How can I achieve this? Is there some easy way? What I tried is quite awful at the moment: function applyFilter(filter) { var canvas = document.getElementById('canvas') , context = canvas.getContext('2d'); if (filter === 'sepia') { context.sepia(1); } if (filter === 'contrast') { context.contrast(1.3); } } function removeFilter(filter) { var canvas = document.getElementById('canvas') , context = canvas.getContext('2d'); if (filter === 'sepia') { context.sepia(0); } if (filter === 'contrast') { context.contrast(1); } }
type: Question
answer count: 2
tagged with: canvas
downvote count: 0
tagged with: javascript
has title: Javascript - apply filters to canvas and reset to original
has answer: http://stackoverflow.com/a/27918669
tagged with: filter
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/60688809
has answer: http://stackoverflow.com/a/60688809
accepted answer: http://stackoverflow.com/a/27918669

http://stackoverflow.com/comment/44105824
has text: document.hasFocus is worth looking into, but i don't think there is a way to tell if an idle window with your tab shown is behind another window or not...
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27850860

http://stackoverflow.com/a/27893276
has comment: http://stackoverflow.com/comment/44195303
has comment: http://stackoverflow.com/comment/44187783
has comment: http://stackoverflow.com/comment/44187880
has comment: http://stackoverflow.com/comment/44187834
answers question: http://stackoverflow.com/q/27893255
has body: If you are going to set a variable and then use it in order to bind an event, the event binding must also happen within the .mousemove. jQuery( ".svgcontainer" ).mousemove(function( event ) { if(!jQuery(this).data("bind")){ jQuery(this).data("bind", true); var currentID = jQuery(this).attr('id'); var target1='#zoomInButtonSVGfile1'; var target2='#panRightButton'+currentID; jQuery(target1).click(function(){ zoomIn(); }); jQuery("#zoomOutButtonSVGfile1").click(function(){ zoomOut(); }); jQuery(target2).click(function(){ panRight(); }); jQuery('#panLeftButton'+currentID).click(function(){ panLeft(); }); } });
score: 0
has comment: http://stackoverflow.com/comment/44187856
type: Answer

http://stackoverflow.com/a/27843556
answers question: http://stackoverflow.com/q/27830567
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: The config is correct, it has some redundant settings (i.e. are default anyway), but better be safe than sorry. The comment on line 2 is not valid CoffeeScript syntax, but that's for purposes of posing on Stack Overflow. Since you've mentioned the table is generated using javascript (or CoffeeScript, it get's down to the same thing), the order of generating data and using tablesorter is important: load any libraries load script of generator load tablesorter script If workflow tool is used, such as grunt, gulp etc. and scripts are compiled into a single script it's also important that this order is respected. Both tools listed have a way of specifying order of including scripts.
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27830567

http://stackoverflow.com/q/27828111
has title: Need help adding a sound effect to my image button in tumblr blog using HTML
has answer: http://stackoverflow.com/a/27828194
has comment: http://stackoverflow.com/comment/44062325
type: Question
tagged with: javascript
has body: I have six image buttons on my Tumblr blog that I want to add this sound effect to play when I hover over the image. Each button is set up like: However, no matter what I do, I can't get it to work. I would like to keep it simple if possible. Can someone help me?
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27884559
tagged with: javascript
has body: It works fine on Android and PC/Mac. But for some reason, when I dynamically load in buttons on iOS, I can't click them. It seems that none of the javascript runs on dynamically loaded content. Here is the code, it should work: favbutton = $(' '); ... well.append(favbutton); well.children(".favbutton").on("click", function(event){ //code here, never even reaches it });
has comment: http://stackoverflow.com/comment/44170663
score: 0
tagged with: jquery
type: UnansweredQuestion
answer count: 0
has title: Bootstrap dynamically loaded buttons not clickable iOS/Safari
tagged with: twitter-bootstrap
type: Question
has comment: http://stackoverflow.com/comment/44170923

http://stackoverflow.com/comment/44265389
comment on: http://stackoverflow.com/a/27933190
type: AnswerComment
score: 0
type: Comment
has text: Hey, mate! It's a free site where we help each other because we like to do that. I'm not doing this for money. I have a job for that. I'm happy that you solved your problem. ;)

http://stackoverflow.com/q/27845170
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27845214
has title: || operator not setting default when null
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27845276
answer count: 2
has answer: http://stackoverflow.com/a/27845276
downvote count: 0
favorite count: 0
has body: I am running this line: var good = data["good"] || false; where data comes from the success method in a jquery ajax request. But, what I thought that this would do is default good to false if data["good"] is null, but it is not. Chrome is throwing this: Uncaught TypeError: Cannot read property 'good' of null and since it is null, shouldn't good then be set to false?
has answer: http://stackoverflow.com/a/27845214
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44032117
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27810789
score: 0
has text: I'd prefer if it didn't include repeated words

http://stackoverflow.com/a/27913478
score: 0
has body: Okay, figured out a pretty nice way. You just make an ignore list with roughly the same object structure as the object to be ignored. function ignore(obj, list){ for(var i in list){ var type = Object.prototype.toString.call(list[i]); if(type == "[object String]"){ delete obj[i]; } else if (type == "[object Object]"){ ignore(obj[i], list[i]) } else if (type == "[object Array]"){ var objList = obj[i]; var subList = list[i][0]; for(var n in objList){ ignore(objList[n], subList) } } } } x = {a:1, b:[{c:1, d:1}, {c:1, d:1}, {c:1, d:1}], e:1} ignoreList = {'e':'e', 'b':[{'c':'c'}]} ignore(x, ignoreList) =&gt; {a:1, b:[{d:1}, {d:1}, {d:1}]}
answers question: http://stackoverflow.com/q/27896813
type: Answer

http://stackoverflow.com/q/27861456
has body: I have the following array. var arr = ["1-5", "3-6", "2-4"]; Is there a way where I can sort like this: var arr = ["1-5", "2-4", "3-6"] I've tried with jquery map but cant because the values of array are not Numbers.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44125175
score: 0
has answer: http://stackoverflow.com/a/27861637
tagged with: arrays
tagged with: jquery
has answer: http://stackoverflow.com/a/27861499
favorite count: 0
possible better answer: http://stackoverflow.com/a/27861637
accepted answer: http://stackoverflow.com/a/27861499
answer count: 4
has answer: http://stackoverflow.com/a/27861904
type: AnsweredQuestion
has title: Sort an array by its values
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27861547

http://stackoverflow.com/comment/44127145
type: AnswerComment
has text: thanks. when you have a minute, could you see what is wrong with this boilerplate then - https://gist.github.com/simonsmith/4353587 ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27862277

http://stackoverflow.com/comment/44152801
score: 0
type: Comment
type: QuestionComment
has text: check the answer below , that's the easy way
comment on: http://stackoverflow.com/q/27875624

http://stackoverflow.com/q/27863806
accepted answer: http://stackoverflow.com/a/27863896
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/44131487
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27863896
score: 0
tagged with: jasmine
has comment: http://stackoverflow.com/comment/44129990
tagged with: promise
tagged with: angularjs
has body: SupportedLanguagesServices get method returns a promise which is resolved in the controller as follows: angular.module('App').controller('MyController', ['SupportedLanguagesService', function(SupportedLanguagesService) { var self = this; self.supportedLanguages = []; SupportedLanguagesService.get().success( function(response) { self.supportedLanguages = response; }); }]); And here is the test I wrote, but it is not working: describe('Controller: MyController', function() { beforeEach(module('App')); var rootScope, controller; beforeEach(inject(function($controller, $rootScope, SupportedLanguagesService, $q) { var deferred = $q.defer(); deferred.resolve([{name:"English", code:"en"},{name:"Portugues", code:"pt_BR"]); spyOn(SupportedLanguagesService, 'get').andReturn(deferred.promise); rootScope = $rootScope; controller = $controller; })); it('should get SupportedLanguages', function() { rootScope.$digest(); var ctrl = controller('MyController'); expect(ctrl.supportedLanguages.length).toEqual(2); }); }); It throws an exception on the statement: var ctrl = controller('MyController'); Thank you for your assistance.
has comment: http://stackoverflow.com/comment/44130759
type: AnsweredQuestion
has title: Having problems unit testing a promise call in angularjs controller

http://stackoverflow.com/q/27913085
has comment: http://stackoverflow.com/comment/44225885
has comment: http://stackoverflow.com/comment/44226067
has comment: http://stackoverflow.com/comment/44226187
has comment: http://stackoverflow.com/comment/46480010
tagged with: single-page-application
downvote count: 0
tagged with: knockout-templating
favorite count: 0
has title: Memory leak when switching between views in knockout single page application
has comment: http://stackoverflow.com/comment/44225942
type: UnansweredQuestion
tagged with: memory-leaks
has comment: http://stackoverflow.com/comment/44226046
score: 2
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44226025
has comment: http://stackoverflow.com/comment/46493287
has comment: http://stackoverflow.com/comment/44225713
tagged with: knockout.js
type: Question
tagged with: javascript
has body: My app consists of a shell view which loads sub views within it using knockout's templating engine. All the views are built on knockout. When navigating between views, the value of an observable changes indicating that a new view needs to be bound to a template. I've packaged the app into an exe using node webkit and it is apparent that RAM usage keeps increasing when I switch views. Memory is only released when the app is closed. Any idea what red flags I should be looking out for in the code which may be causing this leak and what tools could help me pinpoint the issue?

http://stackoverflow.com/a/27841129
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/27841001
score: 0
type: Answer
has body: Once you've corrected the issue of (apparently) having duplicated IDs, you can select the input with a given name only inside the form that's been submitted like so: $('form').submit(function() { var name = $('[name="name"]', this).val(); }); Inside the submit event handler this refers to the form that triggered the event (i.e. the form being submitted), and $(selector, element) is equivalent to $(element).find(selector) which searches only inside of element for elements matching the selector.

http://stackoverflow.com/q/27857534
has answer: http://stackoverflow.com/a/27857621
has body: Im trying to uncheck previously selected radio button of a group of radio buttons that i must give different names to. I am trying to avoid jquery and this is the closest attempt ive gotten so far. function radioUncheck(){ if (document.forms.form.radioa[1].checked= true){ document.forms.form.radiob[1].checked= false; document.forms.form.radioc[1].checked= false; document.forms.form.radiod[1].checked= false; document.forms.form.radioe[1].checked= false; document.forms.form.radiof[1].checked= false; } else if(document.forms.form.radiob[1].checked= true){ document.forms.form.radioa[1].checked= false; document.forms.form.radioc[1].checked= false; document.forms.form.radiod[1].checked= false; document.forms.form.radioe[1].checked= false; document.forms.form.radiof[1].checked= false; } else if(document.forms.form.radioc[1].checked= true){ document.forms.form.radioa[1].checked= false; document.forms.form.radiob[1].checked= false; document.forms.form.radiod[1].checked= false; document.forms.form.radioe[1].checked= false; document.forms.form.radiof[1].checked= false; } else if(document.forms.form.radiod[1].checked= true){ document.forms.form.radioa[1].checked= false; document.forms.form.radiob[1].checked= false; document.forms.form.radioc[1].checked= false; document.forms.form.radioe[1].checked= false; document.forms.form.radiof[1].checked= false; } else if(document.forms.form.radioe[1].checked= true){ document.forms.form.radioa[1].checked= false; document.forms.form.radiob[1].checked= false; document.forms.form.radioc[1].checked= false; document.forms.form.radiod[1].checked= false; document.forms.form.radiof[1].checked= false; } else if(document.forms.form.radiof[1].checked= true){ document.forms.form.radioa[1].checked= false; document.forms.form.radiob[1].checked= false; document.forms.form.radioc[1].checked= false; document.forms.form.radiod[1].checked= false; document.forms.form.radioe[1].checked= false; } else{ } } ive also tried replacing = with == as well as tried to …
score: 0
answer count: 2
tagged with: radio-button
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44118184
has comment: http://stackoverflow.com/comment/44119153
has comment: http://stackoverflow.com/comment/44119189
has title: Radio reset will not work
has comment: http://stackoverflow.com/comment/44119246
has answer: http://stackoverflow.com/a/27857600
type: Question
has comment: http://stackoverflow.com/comment/44119136

http://stackoverflow.com/a/27832524
has comment: http://stackoverflow.com/comment/44105638
type: Answer
accepted answer of: http://stackoverflow.com/q/27832350
has comment: http://stackoverflow.com/comment/44070828
answers question: http://stackoverflow.com/q/27832350
has comment: http://stackoverflow.com/comment/44097706
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44143228
score: 0
has comment: http://stackoverflow.com/comment/44070956
has body: You've included jQuery so use the click event as per this JSFiddle. http://jsfiddle.net/Delorian/3f2tvabo/ $('.emptyTile').click(function () { if (currentPlayer == 0) { $(this).removeClass('emptyTile'); $(this).addClass('cross'); currentPlayer = 1; } else { $(this).removeClass('emptyTile'); $(this).addClass('nought'); currentPlayer = 0; }}); You won't need anything on the HTML elements apart from the class to indicate a tile.

http://stackoverflow.com/q/27819039
score: 0
answer count: 1
tagged with: highcharts
tagged with: jquery
has comment: http://stackoverflow.com/comment/44072689
has title: Time-Date and Event chart or Graph in Highchart
has comment: http://stackoverflow.com/comment/44052953
type: AnsweredQuestion
tagged with: google-visualization
has body: I'm using highchart graphs to display time and event of specific person. But I don't understand which graph to use. Following image is the example. I want to do the same.
tagged with: javascript
has answer: http://stackoverflow.com/a/27840231
accepted answer: http://stackoverflow.com/a/27840231
type: Question

http://stackoverflow.com/q/27899987
upvote count: 1
possible better answer: http://stackoverflow.com/a/27900355
has comment: http://stackoverflow.com/comment/44199675
has body: I have this problem that my web app loads a large image as background. It is applied in the &lt;style&gt; tag on top of the body tag. It works but when the page is opened a white background is shown while the image loads. I want that be able to set the background-color to a specific blue color while the image loads, so I did this: before the body end tag: &lt;script type="text/javascript"&gt; $(document).foundation(); $(document).ready(function() { document.body.style.backgroundImage="url('img/form_bg.jpg')"; //$('body').css('background-image', 'url(img/form_bg.jpg) no-repeat center center fixed'); }); &lt;/script&gt; However this code wont works and the background wont load. This one sticks: body { /*background:transparent;*/ background-color:#2f3255; } How can I achieve this: Make the background-color: #2f3255 while the image loads When image is loaded, change the background to image
type: Question
has answer: http://stackoverflow.com/a/27900355
tagged with: javascript
has title: Update background after all items have loaded
answer count: 2
accepted answer: http://stackoverflow.com/a/27900069
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44199650
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44199931
has answer: http://stackoverflow.com/a/27900069

http://stackoverflow.com/comment/44180613
score: 0
type: QuestionComment
type: Comment
has text: @esner_togo well I tried a lot that's why I'm asking here
comment on: http://stackoverflow.com/q/27889800

http://stackoverflow.com/comment/44316276
has text: Your setting `minDate` as the function and not the returned value, you need to invoke your function... `minDate: checkBeforeNoon(),`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27961388
score: 0

canvas
tags question: http://stackoverflow.com/q/27924576
tags question: http://stackoverflow.com/q/27887951
tags question: http://stackoverflow.com/q/27804407
tags question: http://stackoverflow.com/q/27858637
tags question: http://stackoverflow.com/q/27930420
tags question: http://stackoverflow.com/q/27947331
tags question: http://stackoverflow.com/q/27843821
tags question: http://stackoverflow.com/q/27855844
tags question: http://stackoverflow.com/q/27866604
tags question: http://stackoverflow.com/q/27916542
tags question: http://stackoverflow.com/q/27837928
tags question: http://stackoverflow.com/q/27810215
tags question: http://stackoverflow.com/q/27952808
tags question: http://stackoverflow.com/q/27806005
tags question: http://stackoverflow.com/q/27955995
tags question: http://stackoverflow.com/q/27912320
tags question: http://stackoverflow.com/q/27876076
tags question: http://stackoverflow.com/q/27862450
tags question: http://stackoverflow.com/q/27850703
tags question: http://stackoverflow.com/q/27861372
tags question: http://stackoverflow.com/q/27845205
tags question: http://stackoverflow.com/q/27858984
tags question: http://stackoverflow.com/q/27881930
tags question: http://stackoverflow.com/q/27810521
tags question: http://stackoverflow.com/q/27880927
tags question: http://stackoverflow.com/q/27917974
tags question: http://stackoverflow.com/q/27860782
tags question: http://stackoverflow.com/q/27891482
tags question: http://stackoverflow.com/q/27863617
tags question: http://stackoverflow.com/q/27944246
tags question: http://stackoverflow.com/q/27961537
tag name: canvas
tags question: http://stackoverflow.com/q/27863783
tags question: http://stackoverflow.com/q/27829865
tags question: http://stackoverflow.com/q/27903004
tags question: http://stackoverflow.com/q/27962154
tags question: http://stackoverflow.com/q/27949573
tags question: http://stackoverflow.com/q/27880821
tags question: http://stackoverflow.com/q/27943403
type: Tag
tags question: http://stackoverflow.com/q/27878531
tags question: http://stackoverflow.com/q/27926788
tags question: http://stackoverflow.com/q/27813427
tags question: http://stackoverflow.com/q/27869544
tags question: http://stackoverflow.com/q/27851346
tags question: http://stackoverflow.com/q/27846536
tags question: http://stackoverflow.com/q/27911613
tags question: http://stackoverflow.com/q/27847493
tags question: http://stackoverflow.com/q/27961662
tags question: http://stackoverflow.com/q/27920042
tags question: http://stackoverflow.com/q/27841482
tags question: http://stackoverflow.com/q/27875703
tags question: http://stackoverflow.com/q/27917430
tags question: http://stackoverflow.com/q/27900177
tags question: http://stackoverflow.com/q/27882419
tags question: http://stackoverflow.com/q/27918563
tags question: http://stackoverflow.com/q/27949790
tags question: http://stackoverflow.com/q/27892300
tags question: http://stackoverflow.com/q/27926891
tags question: http://stackoverflow.com/q/27865367
tags question: http://stackoverflow.com/q/27837440
tags question: http://stackoverflow.com/q/27879343
tags question: http://stackoverflow.com/q/27845682

http://stackoverflow.com/q/27944953
type: Question
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/27945346
has comment: http://stackoverflow.com/comment/44448444
has body: var i,j; for (i=0; i&lt;30; i++) { for (j=0; j&lt;10; j++) { // do something } } versus for (var i=0; i&lt;30; i++) { for (var j=0; j&lt;10; j++) { // do something } } The second way creates and destroys j 30 times, due to the scope logic of javascript? I prefer to use the first way, but I don't really know if there's a difference. Is there?
has answer: http://stackoverflow.com/a/27945346
accepted answer: http://stackoverflow.com/a/27944992
has title: how does javascript create variable inside loop
downvote count: 0
tagged with: javascript
tagged with: variables
linked to: http://stackoverflow.com/q/21917271
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44285516
has comment: http://stackoverflow.com/comment/44285073
has answer: http://stackoverflow.com/a/27944993
has answer: http://stackoverflow.com/a/27944992
upvote count: 3

http://stackoverflow.com/a/27957333
has comment: http://stackoverflow.com/comment/44349413
has comment: http://stackoverflow.com/comment/44349028
score: 0
answers question: http://stackoverflow.com/q/27957163
has body: You need to make the page the full height/width of the screen. html, body { width:100%; height:100%; }
type: Answer

http://stackoverflow.com/comment/44126660
type: QuestionComment
comment on: http://stackoverflow.com/q/27862094
has text: @RubénGalvan well, here is a documentation page for services: https://docs.angularjs.org/guide/services, and here is one for promises: https://docs.angularjs.org/api/ng/service/$q
score: 0
type: Comment

http://stackoverflow.com/q/27886213
tagged with: javascript
has answer: http://stackoverflow.com/a/27886242
favorite count: 0
answer count: 3
tagged with: strict
upvote count: 7
possible better answer: http://stackoverflow.com/a/27886242
type: AnsweredQuestion
has body: I'm sure he wasn't. I just don't understand one example from his presentation http://youtu.be/UTEqr0IlFKY?t=44m function in_strict_mode() { return (function () { return !this; }()); } Isn't it the same like this one? function in_strict_mode() { return !this; } If is_strict_mode() would me method then I agree because this then would point to object containing method, for example my_object.in_strict_mode = function() { return (function () { return !this; }()); } But why he did it in his example (which is simple function, not a method of an object)?
accepted answer: http://stackoverflow.com/a/27886270
score: 7
has title: Was Douglas Crockford wrong with Strict Mode Example?
type: Question
has answer: http://stackoverflow.com/a/27886270
has answer: http://stackoverflow.com/a/27886256
downvote count: 0

http://stackoverflow.com/comment/44051166
type: AnswerComment
has text: First of all, thank you for the awesome explanation. one thing is wrong when doing this, is that the last bracket is omitted, do you know how to overcome this issue? - well I just added a '+' after the curly bracket and it seems to work
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27822541

http://stackoverflow.com/comment/44244262
type: Comment
comment on: http://stackoverflow.com/q/27922152
has text: Well, I did add a timeout which didn't work. Even tried with 10secs before rendering. But I feel like onLoadFinished should do the job. Which it doesn't.
score: 0
type: QuestionComment

http://stackoverflow.com/a/27865380
score: 0
answers question: http://stackoverflow.com/q/27852433
has body: I don't know underscore.js, here's how to do it with plain JS: var counts = {}; var duplicates = []; for (var i = 0; i &lt; objects.length; i++) { var str = JSON.stringify(objects[i].nums); if (str in counts) { counts[str]++; } else { counts[str] = 1; } } objects = objects.filter(function(val) { if (counts[JSON.stringify(val.nums)] == 1) { return true; } else { duplicates.push(val.name); return false; } }); DEMO
type: Answer
has comment: http://stackoverflow.com/comment/44134339
has comment: http://stackoverflow.com/comment/44136919

http://stackoverflow.com/comment/44104861
comment on: http://stackoverflow.com/a/27850365
type: AnswerComment
has text: Oh my, that's it... this is what happens if you see the wood for the trees... Thank you very much! If I had enough reputations I rated you up...
type: Comment
score: 1

http://stackoverflow.com/a/27809572
has body: function getResponse(inputStr){ return output[input.indexOf(inputStr)]; } Or if you follow Jacob's advice (which I recommend): function getResponse(inputStr){ return outputForInput[inputStr]; } Note that either of these will return undefined if there is no match for the input string.
type: Answer
answers question: http://stackoverflow.com/q/27809347
score: 0

http://stackoverflow.com/comment/44261947
type: QuestionComment
comment on: http://stackoverflow.com/q/27931920
has text: You're not querying main.php, you're looking at addExam.php. Do you see any data returned from that?
score: 0
type: Comment

http://stackoverflow.com/a/48752174
has body: if you want to get value of serach box at server-side: string search = Request.Form.GetValues("search[value]").FirstOrDefault(); This will give you the value of search box.
upvote count: 3
answers question: http://stackoverflow.com/q/27920289
type: Answer
downvote count: 0
score: 3

http://stackoverflow.com/q/27843339
score: 1
has answer: http://stackoverflow.com/a/27957516
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/10596417
has comment: http://stackoverflow.com/comment/44157506
has answer: http://stackoverflow.com/a/27990135
tagged with: javascript
linked to: http://stackoverflow.com/q/27975245
tagged with: jquery
has body: I'm really new to Javascript/jQuery. I've coded in Objective-C and Swift before and there it was possible to parse a (x)html-website with XPath and a framework like Hpple. Now I have to do something like that in JavaScript(Cloud Code from parse.com). My problem is now, that I'd like to parse like that: var url = "http://www.google.com"; var xpath = "//body"; someJavaScriptMagic.parse(url, xpath); I've often seen people using the document.evaluatemethod, but there they parsed the website on which they were at the moment and not another website. Is there a way to do that? I dont know if it's important, but I'm using CloudCode from parse.com EDIT: I've already tried using the ajax-query: $.ajax({ url: 'http://www.digitec.ch', success: function(data) { alert(data); } }); But I get the following error each time: XMLHttpRequest cannot load http://www.digitec.ch/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access.
has title: Parse html page from url link with xPath(javascript, jquery)
tagged with: parse-cloud-code
has comment: http://stackoverflow.com/comment/44157024
answer count: 3
linked to: http://stackoverflow.com/q/20035101
downvote count: 0
favorite count: 0
tagged with: parsing
tagged with: xpath
linked to: http://stackoverflow.com/q/6375461
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44157230
has comment: http://stackoverflow.com/comment/44226873
has answer: http://stackoverflow.com/a/27877952

http://stackoverflow.com/q/27851346
has comment: http://stackoverflow.com/comment/44108411
accepted answer: http://stackoverflow.com/a/27852163
tagged with: button
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27851827
has body: I'm building a simple drum machine that uses canvas for the GUI. I have a row of buttons drawn with a for loop that toggle on/off when clicked. Here's a sample on JSFiddle While it works, I'm a bit embarrassed by my buttonToggleDetection function. It's the only solution I could think of to check which button the mouse is over. I'm wondering if anyone can suggest a better way to do this? var buttonToggleDetection = function(posx, posy, x) { if (posx &lt; canvas.width/2 &amp;&amp; posy &gt; x &amp;&amp; posy &lt; x*2) { if (posx &gt; x*1 &amp;&amp; posx &lt; x*2) { if (pattern[0] === 0) { pattern[0] = 1; } else { pattern[0] = 0; } } else if (posx &gt; x*2 &amp;&amp; posx &lt; x*3) { if (pattern[1] === 0) { pattern[1] = 1; } else { pattern[1] = 0; } } else if (posx &gt; x*3 &amp;&amp; posx &lt; x*4) { if (pattern[2] === 0) { pattern[2] = 1; } else { pattern[2] = 0; } } else if (posx &gt; x*4 &amp;&amp; posx &lt; x*5) { if (pattern[3] === 0) { pattern[3] = 1; } else { pattern[3] = 0; } } else if (posx &gt; x*5 &amp;&amp; posx &lt; x*6) { if (pattern[4] === 0) { pattern[4] = 1; } else { pattern[4] = 0; } } else if (posx &gt; x*6 &amp;&amp; posx &lt; x*7) { if (pattern[5] === 0) { pattern[5] = 1; } else { pattern[5] = 0; } } else if (posx &gt; x*7 &amp;&amp; posx &lt; x*8) { if (pattern[6] === 0) { pattern[6] = 1; } else { pattern[6] = 0; } } else if (posx &gt; x*8 &amp;&amp; posx &lt; x*9) { if (pattern[7] === 0) { pattern[7] = 1; } else { pattern[7] = 0; } } } if (posx &gt; canvas.width/2 &amp;&amp; posy &gt; x &amp;&amp; posy &lt; x*2) { if (posx &gt; x*9 &amp;&amp; posx &lt; x*10) { if (pattern[8] === 0) { pattern[8] = 1; } else { pattern[8] = 0; } } else if (posx &gt; x*10 &amp;&amp; posx &lt; x*11) { if (pattern[9] === 0) { pattern[9] = 1; } else { pattern[9] = 0; } } else if (posx &gt; x*11 &amp;&amp; posx &lt; x*12) { if (pattern[10] === 0) { pattern[10] = 1; } else { pattern[10] = 0; } } else if (posx &gt; x*12 &amp;&amp; posx &lt; x*13) { if (pattern[11] === 0) …
possible better answer: http://stackoverflow.com/a/27851827
upvote count: 1
has title: JavaScript/HTML Canvas: mouse detection for looped row of buttons
has answer: http://stackoverflow.com/a/27852163
tagged with: mouse
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44107357
type: Question
answer count: 2
tagged with: canvas

http://stackoverflow.com/a/27875914
answers question: http://stackoverflow.com/q/27875703
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
has body: What about this? Is what you're looking for? $(".gradient").mousemove(function( event ) { var w = $(this).width(), pct = 360*(+event.pageX)/w, bg = "linear-gradient(" + pct + "deg,#4ac1ff,#795bb0)"; $(".gradient").css("background-image", bg); }); I'm only using the x movement. You can use what you prefer. User moves mouse round the div with class .gradient. I just adjust the value to a percentage using the width of the div and change the background.
type: Answer
accepted answer of: http://stackoverflow.com/q/27875703

http://stackoverflow.com/q/27864806
type: Question
type: AnsweredQuestion
tagged with: javascript
has body: I currently have a div which when clicked posts data to another page and reloads the div. I would like to add a back button (#backref) to the new div to take me back to the previous div. I have found several posts on this whereby you add display:none; to the div you want to browse to, but obviously this is my initial div so I cannot use that css. Any suggestions on how to get round this would be appreciated! Code I am using to achieve this: $(document).ready(function () { $('.clickthrough2').click(function () { // get car id carId = $(this).attr('id'); // get the car id to access each class element under the car div container $.post('referrer-ajax2.php', { clickthrough: $('#car-'+carId+' .clickthrough').val(), ref_date_from2: $('#car-'+carId+' .ref_date_from2').val(), ref_date_to2: $('#car-'+carId+' .ref_date_to2').val() }, function (data) { $('#car1').html(data); }); }); }); index.php: Select Car <?php $result=$ mysqli->query($sql); if($result->num_rows === 0) { echo 'No Cars in selected time period.'; } else { while ($row = $result->fetch_array()) { ?> <div id="car-<?php echo $row['car_id'];?>"> <input type="hidden" class="ref_date_from2" value="<?php echo $date_from; ?>" /> <input type="hidden" class="ref_date_to2" value="<?php echo $date_to; ?>" /> <input type="hidden" class="clickthrough" value="<?php echo $row['car_name'] ?>" /> <div id="<?php echo $row['car_id'];?>" class="clickthrough2 col-5-6"><?php echo $row['car_name'] ?> <?php echo $row[ 'quantity']; ?> <?php } } ?> referrer-ajax2.php: Car Details <?php $result=$ mysqli->query($sql); if($result->num_rows === 0) { echo 'No Cars in selected time period.'; } else { while ($row = $result->fetch_array()) { ?> <?php echo $row['car_details'] ?> <?php echo $row[ 'quantity']; ?> <?php } } ?> < Back EDIT: I have tried the below be it did not work: $('#backref').click(function () { $('.declined4').hide(); $('.declined3').show(); });
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27864893
tagged with: jquery
has answer: http://stackoverflow.com/a/27864893
tagged with: php
has title: Using jQuery to navigate between divs

http://stackoverflow.com/q/27962626
accepted answer: http://stackoverflow.com/a/27962727
has title: Add all values in an array JavaScript/jquery
tagged with: function
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/27962727
has body: Click me to calculate your average time myData = [34, 67, 78]; var arrayTotalValue = 0; $("#timeCalac").click(function () { // arrayTotalValue = add value of myData array function arrayTotalValue = arrayTotalValue/myData.length; $("#timeCalac").html(arrayTotalValue); }); I am making a function that records how long it took for the user to click on a element I then use the .push() command to add this number to the myData array. Is there a JavaScript or jQuery function that can add the value of the myData array and then store it in the arrayTotalValue variable.
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/27871449
has body: I have problem with getting state for component which is loaded by react-router on path with dynamic segment /item/:id: var Item = React.createClass({ mixins: [State], getInitialState: function () { return {data: {}}; }, loadTrackData: function () { api.getItemById(this.getParams().id, function (data) { this.setState({data: data}); }.bind(this)); }, componentDidMount: function () { this.loadTrackData(); }, componentWillReceiveProps: function () { this.loadTrackData(); }, render: function () { console.log(this.state); // empty `data` object return ( &lt;div&gt; &lt;h2&gt;{this.state.data.title.prop}&lt;/h2&gt; // doesn't work // but works with // &lt;h2&gt;{this.state.data.title}&lt;/h2&gt; &lt;/div&gt; ); } }); Any of these methods componentDidMount and componentWillReceiveProps are not called at all! And render logs empty data object as it's just initialized.. Router looks like: var routes = ( &lt;Route path="/" handler={Index}&gt; &lt;Route name="stream" path="/item/:id" handler={Item} /&gt; &lt;DefaultRoute handler={Dashboard} /&gt; &lt;/Route&gt; );
answer count: 0
has comment: http://stackoverflow.com/comment/44152416
has comment: http://stackoverflow.com/comment/44146019
has comment: http://stackoverflow.com/comment/44152063
type: Question
linked to: http://stackoverflow.com/q/27875906
tagged with: react-router
tagged with: javascript
has comment: http://stackoverflow.com/comment/44152608
score: 0
has comment: http://stackoverflow.com/comment/44153227
tagged with: reactjs
has title: setState doesn't set object on page with dynamic segments
type: UnansweredQuestion

http://stackoverflow.com/a/27889448
type: AcceptedAnswer
has body: 1) You need to wrap the second library in a bower package if you want it to be available to the bower package management system. npm is something entirely different and you won't be sharing between the two directly. 2) Yes, the user needs to ensure the dependencies are loaded in the right order on each page. Bower just ensures your dependencies are installed and at the correct version. 3) Generally, I'd avoid this. They're separate projects with orthogonal concerns. This is why we've created package managers like bower to begin with. Bonus: 4) Yes, you can achieve this with one repository. Each package management service requires their own configuration files - but there's nothing wrong with having a bower.json and a package.json both sitting at the root of your repository. You just use npm and bower separately and respectively to publish to each system. PS. This should have been more than 1 question.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27889337
has comment: http://stackoverflow.com/comment/44183821
accepted answer of: http://stackoverflow.com/q/27889337
upvote count: 1

http://stackoverflow.com/a/28224860
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: The answer is in the source code of bind - line 56(full snippet below). There the bind function calls the internal bindProperty function. All that bind is doing on top of bindProperty is ensuring that the given property exists. bind: function(name, observable, oneTime) { var property = this.propertyForAttribute(name); if (!property) { // TODO(sjmiles): this mixin method must use the special form // of `super` installed by `mixinMethod` in declaration/prototype.js return this.mixinSuper(arguments); } else { // use n-way Polymer binding var observer = this.bindProperty(property, observable, oneTime); // NOTE: reflecting binding information is typically required only for // tooling. It has a performance cost so it's opt-in in Node.bind. if (Platform.enableBindingsReflection &amp;&amp; observer) { observer.path = observable.path_; this._recordBinding(property, observer); } if (this.reflect[property]) { this.reflectPropertyToAttribute(property); } return observer; } So, you could use bindProperty, but I would not recommend it unless you can ensure the existence of the property, which you want to bind.
score: 4
type: Answer
answers question: http://stackoverflow.com/q/27882773
accepted answer of: http://stackoverflow.com/q/27882773

http://stackoverflow.com/comment/44258544
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27930622
has text: I have a functioning project at https://github.com/wsams/ace-editor-demo

http://stackoverflow.com/q/27880545
has body: Is there a way of making this shorter? var scrollPos = function() { var bodyTopPos = header.style.top &lt; ( document.body.scrollTop || document.documentElement.scrollTop ) -91; header.setAttribute('class', bodyTopPos ? 'sticky' : ''); }(); window.onscroll = function() { var bodyTopPos = header.style.top &lt; ( document.body.scrollTop || document.documentElement.scrollTop ) -91; header.setAttribute('class', bodyTopPos ? 'sticky' : ''); } I've tried writing the below but it seems to automatically set the header class to sticky. var scrollPos = function() { var bodyTopPos = header.style.top &lt; ( document.body.scrollTop || document.documentElement.scrollTop ) -91; header.setAttribute('class', bodyTopPos ? 'sticky' : ''); }(); window.onscroll = scrollPos(); You can see my working fiddle example HERE
tagged with: javascript
tagged with: scope
score: 0
accepted answer: http://stackoverflow.com/a/27880716
answer count: 1
tagged with: variables
has comment: http://stackoverflow.com/comment/44162640
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27880716
type: Question
has comment: http://stackoverflow.com/comment/44162815
tagged with: function
has title: JS: Making two functions do the same thing

http://stackoverflow.com/comment/44289705
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27907139
has text: I ran an abbreviated test last night based on your help, and it ran perfectly. I'll be re-running for all 'events' tonight and crediting your answer below. Thanks again, asynchronous concepts and where to place callbacks has been a stumbling block for me, but I feel like I have a much stronger handle on it now.

http://stackoverflow.com/comment/44019757
comment on: http://stackoverflow.com/q/27804922
score: 0
has text: This is a small part of a larger program, this is about as specific as I can make it, sorry.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44232235
has text: Can I do the authentication other than ordinary HTTP-Authentication via .htaccess files? I'm thinking if I wanna use a yubikey or something else to have a 2-way authentication...is that possible via HTTP?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27887975
type: Comment

http://stackoverflow.com/comment/44104251
score: 0
comment on: http://stackoverflow.com/q/27849804
type: QuestionComment
has text: I will try your suggestions, thanks
type: Comment

http://stackoverflow.com/comment/44078170
type: QuestionComment
type: Comment
has text: use + as a string concatenation operator in javascript.
comment on: http://stackoverflow.com/q/27836785
score: 0

http://stackoverflow.com/a/27866300
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27866224
has body: Basic idea of adding the click event, getting the hash, and selecting the element with that id. $("#links").on("click", "a", function(event) { var hash = this.hash; $(".selected").removeClass("selected"); $(this).addClass("selected"); $(hash).addClass("selected"); event.preventDefault(); }); p.selected { outline: 1px dashed black; } a.selected { font-weight: bold; } 1 2 3 a b c

http://stackoverflow.com/q/27866619
accepted answer: http://stackoverflow.com/a/27866672
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27867355
has comment: http://stackoverflow.com/comment/44136162
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/44136369
tagged with: javascript
has comment: http://stackoverflow.com/comment/44135842
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27867355
has comment: http://stackoverflow.com/comment/44136249
tagged with: jquery
has body: I'm trying to create a sequence of events as described below: 1) The user would click on .post-link which would scroll the page to the top if it isn't there already. 2) The #project-container would open up revealing the #loading-animation. 3) The post would load via Ajax. Right now, when I click on .post-link, everything seems to happen at once. How can I format the code below to make sure that one event happens after another one finishes? Essentially, this is what I'm trying to recreate. When you click on a post, notice how the hidden container opens up to reveal the loading animation, and then once the content has loaded, it opens up to display the content. JS $('.post-link').click(function(e) { e.preventDefault(); $('html, body').animate({ scrollTop : 0 },500, function() { $('#loading-animation').show(); }); var post_id = $(this).attr('rel'); var ajaxURL = site.ajaxurl; $.ajax({ type: 'POST', url: ajaxURL, data: {'action': 'load-content', post_id: post_id }, success: function(response) { $('#project-container').html(response); $('#loading-animation').hide(); return false; } }); }); HTML <?php $home_query = new WP_Query('post_type=projects'); while($home_query->have_posts()) : $home_query->the_post(); ?> <a class="post-link" href="#" rel="<?php the_ID(); ?>"> <article id="post-<?php the_ID(); ?>"> <?php the_title(); ?> <?php the_post_thumbnail( "home-thumb", array( 'class' => 'grayscale grayscale-fade') ); ?> <?php endwhile; ?> <?php wp_reset_postdata(); // reset the query ?> PHP /** * Enqueue scripts and styles. */ function starter_scripts() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', includes_url( '/js/jquery/jquery.js' ), false, NULL, true ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-effects-core'); wp_enqueue_style( 'starter-style', get_stylesheet_uri() ); wp_enqueue_script( 'gray', get_template_directory_uri() . '/js/min/jquery.gray.min.js', array('jquery'), '', true ); wp_enqueue_script( 'includes', get_template_director…
tagged with: ajax
has title: Have one event happen after another one finishes?
has answer: http://stackoverflow.com/a/27866672

http://stackoverflow.com/a/27871212
has comment: http://stackoverflow.com/comment/44145042
has body: This is a paid API. Youll need to set up your project on the Google developer console then youll have to input your CC billing info. Once thats done, turn on the API under the APIs tab. Then go to "Credentials". On the right hand side, click "Edit Settings", in the provided box, add the url to your domain where the file will be hosted like "http://mywebsite.com". Dont put the full address to the file like "http://mywebsite.com/mypage.html". Save your changes. As for why your file works when run locally, below are the addresses to my test files: local file, run on a mac file:///Volumes/Macintosh%20HD/Users/DoDSoftware/Desktop/soundTest.html local file, run on a PC file:///C:/Users/Flights%20Trainer/Desktop/soundTest.html hosted file http://affordable-glass.com/test/soundTest.html You see the file:/// in front of the local files? I'd guess that Google has the API set up to allow all origins coming from file:/// as they know those will be local files and not hosted files. This way, developers can test the api and create their apps before committing to a payment plan with them. But the of course they block any request originating from a hosted site that's not on a paid program with them.
accepted answer of: http://stackoverflow.com/q/27871019
downvote count: 0
answers question: http://stackoverflow.com/q/27871019
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44145106
score: 1
has comment: http://stackoverflow.com/comment/44145307
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44145021
has comment: http://stackoverflow.com/comment/44145987

http://stackoverflow.com/a/27863378
has comment: http://stackoverflow.com/comment/44245016
type: Answer
has comment: http://stackoverflow.com/comment/44204999
has comment: http://stackoverflow.com/comment/44151178
answers question: http://stackoverflow.com/q/27862298
has comment: http://stackoverflow.com/comment/44201227
has comment: http://stackoverflow.com/comment/44242775
has comment: http://stackoverflow.com/comment/44131047
has body: That's because radio button with the same name are in the same group, representing a single key-value pair as far as HTML is concerned: https://developer.mozilla.org/en/docs/Web/HTML/Element/Input
has comment: http://stackoverflow.com/comment/44141824
has comment: http://stackoverflow.com/comment/44130447
score: 0

http://stackoverflow.com/q/27822217
type: AnsweredQuestion
tagged with: closures
accepted answer: http://stackoverflow.com/a/27825060
has title: Object function () { } has no method 'my method'
type: Question
upvote count: 4
possible better answer: http://stackoverflow.com/a/27822270
answer count: 2
has answer: http://stackoverflow.com/a/27822270
has body: i am using a method (searchTransportation) for an event callback. exports.searchTransportation = function (items, num, UrlS) { //... } exports.doHotelInsertion = function(items, num, typetransport, UrlS, callback) { // (omitted code) event.on("STARTWITHAIRSEARCH" + num, searchTransportation ); //!!! causes error }; I tried smth like event.on("STARTWITHAIRSEARCH" + num, this.searchTransportation(items, num, UrlS).bind(this)); But this is breaking code and ends up with Object function () { } has no method 'searchTransportation' I understand that the event callback is at the global scope but is there a way to call an existing method? -- EDIT this is a bit like this SO question : Class methods as event handlers in javascript but with a nodejs twist. What s the most elegant way of doing this?
tagged with: javascript
tagged with: callback
favorite count: 0
score: 3
tagged with: events
has answer: http://stackoverflow.com/a/27825060
downvote count: 1
linked to: http://stackoverflow.com/q/229080

http://stackoverflow.com/a/27886385
answers question: http://stackoverflow.com/q/27886384
accepted answer of: http://stackoverflow.com/q/27886384
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: This is what I came up with, its pretty long and I wonder if it can be shortened: /.*(Linux;.*AppleWebKit.*Version\/\d+\.\d+.*Mobile).*/gi Explanation and remarks: Does not detect any of the mentioned here: Safari, Chrome, Different Mobile. Does detect 19 out of 20 mentioned here: Android Native, the one that is not getting detected does not comply with googles instructions (Google Developer) If you’re attempting to differentiate between the WebView and Chrome for Android, you should look for the presence of the Version/X.X string in the WebView user-agent string. Tried it without using 'Linux' but got false positive on safari browsers.
score: 2
upvote count: 2

http://stackoverflow.com/q/27942754
answer count: 1
tagged with: select
has answer: http://stackoverflow.com/a/27945491
has title: ComboBox implementation without "select" tag
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: Is there are any custom implementation of ComboBox element (i.e. drop-down list) without tag? May be some div with CSS or JavaScript?
tagged with: combobox
type: Question
score: 0

http://stackoverflow.com/comment/44654897
type: AnswerComment
score: 0
type: Comment
has text: I think versions of Android will play a role in whether or not this approach will work.
comment on: http://stackoverflow.com/a/28025770

http://stackoverflow.com/q/27919443
tagged with: grunt-contrib-concat
has body: I am new to grunt (literally installed it today and using it) and its great, but i cannot work out something. I have an angularJs project and i would like to concat all my javascript files into 3 files overall. So i would have "base" - all the vendor javascript files for plugins etc "app" - all the controllers etc used by all users "admin" - all the controllers etc used but only ever accessed by administrators Now i have install grunt and setup my task for concat, but how can i have multiple dest and src attributes? Example of grunt file grunt.initConfig({ // Metadata pkg: grunt.file.readJSON('package.json'), concat: { options: { stripBanners: true }, dist: { src: ['Scripts/jquery-*.js', '!Scripts/jquery-*.min.*', '!Scripts/jquery-*.intellisense.*', 'Scripts/bootstrap.js', 'Scripts/respond.js', 'js/**/*.js'], dest: 'dist/app.js' }, distCss: { src: ['Content/bootstrap.css', 'Content/site.css'], dest: 'dist/app.css' } }, }); Once i have figured this out, can i then have multiple ugilify attributes to ugilify each js file created?
tagged with: javascript
tagged with: gruntjs
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27919697
favorite count: 0
tagged with: angularjs
score: 6
upvote count: 6
tagged with: node.js
type: AnsweredQuestion
has title: Using Grunt to concat multiple js files but want them split?
accepted answer: http://stackoverflow.com/a/27919697
type: Question

http://stackoverflow.com/comment/44119029
comment on: http://stackoverflow.com/a/27858076
score: 0
type: AnswerComment
type: Comment
has text: In this case, you can just set `i` flag, since `\d` is not affected by casing (as far as ASCII goes).

http://stackoverflow.com/comment/44295815
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27948057
type: Comment
has text: I'm new to javascript/jquery, I can't understand what you mean

http://stackoverflow.com/a/27922661
has comment: http://stackoverflow.com/comment/44242613
has comment: http://stackoverflow.com/comment/44242339
score: 3
has body: There is value is properly indenting and formatting your code. You've missed the closing curly brace on loadprice. function loadprice () { $.getJSON('http://domain.com/pulsa/data.php', function (json) { $("#pricebtcbuy").append(json.price.btcbuy); $("#pricebtcactu").append(json.price.btcactu); $("#pricebtcsell").append(json.price.btcsell); $("#pricedlrbuy").append(jsonprice.usdbuy); $("#ppsaldo").append(json.price.paypal); $("#pricedlrsell").append(json.price.usdsell); }); } Also, are you trying to run this every 5 seconds? Or are you trying to run this after 5 seconds from when it's originally called? If you want to call it after 5 seconds, you'll need to call setTimeout outside the function definition. You also don't need the parenthesis after the function name in this case. setTimeout(loadprice, 5000); This would also work, and hopefully it differentiates calling a function and passing an object. setTimeout(function () { loadprice(); }, 5000); If you want to run this once every 5 seconds you'd use setInterval. But if that's your desire there are better ways to do that. setInterval(loadprice, 5000); Still a better way yet is to utilize the Promise $.getJSON returns. This way it won't run every 5 seconds, but each time the request is completed the Ajax call will happen in another 5 seconds. This will avoid potential problems if the response takes more than 5 seconds to get. function loadPrice () { var jqxhr; jqxhr = $.getJSON('http://domain.com/pulsa/data.php', function (json) { $("#pricebtcbuy").append(json.price.btcbuy); $("#pricebtcactu").append(json.price.btcactu); $("#pricebtcsell").append(json.price.btcsell); $("#pricedlrbuy").append(jsonprice.usdbuy); $("#ppsaldo").append(json.price.paypal); $("#pricedlrsell").append(json.price.usdsell); }); jqxhr.done(function () { setTimeout(loadPrice, 5000); }); }
has comment: http://stackoverflow.com/comment/44242410
answers question: http://stackoverflow.com/q/27922535
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27922535
type: Answer
downvote count: 0

http://stackoverflow.com/comment/44101195
has text: Can you provide the HTML please? Thanks!
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27848540
score: 2

http://stackoverflow.com/q/27877161
favorite count: 0
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/44156462
tagged with: php
has answer: http://stackoverflow.com/a/27877445
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/44156358
type: Question
has answer: http://stackoverflow.com/a/27877234
has comment: http://stackoverflow.com/comment/44155825
tagged with: javascript
has comment: http://stackoverflow.com/comment/44156247
has answer: http://stackoverflow.com/a/27877385
has title: php onclick once inside input
has comment: http://stackoverflow.com/comment/44156305
has body: &lt;progress value="0" max="100" id="p1"&gt;&lt;/progress&gt; &lt;div class="allQuestion"&gt;&lt;?php for($i=1; $i&lt;=10; $i++){?&gt;&lt;input type="radio" name="Dq[1]" value="&lt;?=$i?&gt;" onClick='incr();'&gt; &lt;?=$i?&gt; &lt;?php } ?&gt;&lt;/div&gt; js &lt;script type="text/javascript"&gt; function incr() { var v1=document.getElementById('p1').value; document.getElementById("p1").value= v1 + 1; } &lt;/script&gt; my intention is make the question between 1-10 point can only be clicked once , but the input was generate by php so if i put the onclick inside input , each radio i clicked will be increasing the progress bar , i only need the radio only be clicked once and the progress bar remain the same % it have , lets each question is 1% once clicked it only increasing 1% , when reclick it still 1%. or and i also dont wanted use jquery.
answer count: 3

http://stackoverflow.com/a/27937861
type: Answer
answers question: http://stackoverflow.com/q/27937743
downvote count: 1
score: -1
has body: I think you can use some sort of logging framework , or you can write your own logging functions to log your error code on the file system.
upvote count: 0

http://stackoverflow.com/comment/44220059
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27910267
type: Comment
has text: Your absolutely right, I'm trying to compare the numbers up until the dash for each value. That dash in the string was throwing off the comparison.

http://stackoverflow.com/a/27830299
type: Answer
answers question: http://stackoverflow.com/q/27830168
has comment: http://stackoverflow.com/comment/44066873
score: 0
has body: Well, you used hover, but, you can use the MouseOver Directive. As the following example: Content

http://stackoverflow.com/a/27955353
upvote count: 1
answers question: http://stackoverflow.com/q/27955242
downvote count: 0
type: Answer
score: 1
has body: You could use ng-class to toggle an 'active' class, which would show/hide/transition your content divs. Data Explorer It’s a brave new data world. Explore and navigate new realms of possibility such as post density, sentiment analysis, and even sort by hue and saturation. Analytics Exciting twists on old standards, Socialight's analytic platform allows you to analyze any social account in the world. Track your competitors and make informed, comparative decisions for your next campaign. Export & Embed Enliven billboards, websites, or TV screens with tailored feeds of tagged content from your Data Explorer you can Improve your nextTransfer all of this useful information to outward facing products. Content Area 1 Content Area 2 Content Area 3 With the above, clicking the divs with the ng-click directive will change your scope's myActive variable to the corresponding value. That will then give the 'active' class to the section below it. You could then show/hide content based on the 'active' class, and add some CSS transitions to make it look snazzy.

http://stackoverflow.com/q/27824952
has comment: http://stackoverflow.com/comment/44056357
has body: I'm trying to reference child data within an object returned from a factory using Firebase, but I'm stumped. I can successfully get the user object that I want ($scope.user), but I can't seem to reference the data inside of it (such as $scope.user.name) - everything returns undefined. app.factory('Data', ['$firebase', function(){ var ref = new Firebase('https://something.firebaseio.com/users'); return { refUser: function(id){ return $firebase(ref.child(id)).$asObject(); } } }]); app.controller('MainCtrl', ['Data', function(Data){ $scope.user = Data.refUser(123); // 123 = user ID console.log($scope.user); // Returns user object successfully (containing 'name' key) console.log($scope.user.name); // Return undefined }]); What is it that I'm missing? I'm not quite sure where the problem even lies with my understanding: Angular, Firebase, or simple javascript.
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44219970
accepted answer: http://stackoverflow.com/a/27825248
has comment: http://stackoverflow.com/comment/44059136
has comment: http://stackoverflow.com/comment/44056287
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27825248
linked to: http://stackoverflow.com/q/26604472
has comment: http://stackoverflow.com/comment/44216755
type: Question
has comment: http://stackoverflow.com/comment/44059220
tagged with: firebase
linked to: http://stackoverflow.com/q/27049342
tagged with: javascript
has title: Reference data within object in AngularJs
has comment: http://stackoverflow.com/comment/44056206
score: 0
answer count: 1
tagged with: angularfire

http://stackoverflow.com/comment/44247434
type: Comment
has text: my cache in chrome has 91 items. exactly the ones you specified in your manifest here http://el.your-project.co.uk/manifest.appcache
comment on: http://stackoverflow.com/a/27924851
type: AnswerComment
score: 0

http://stackoverflow.com/q/27894056
tagged with: progress
favorite count: 0
downvote count: 0
tagged with: html5-audio
has comment: http://stackoverflow.com/comment/44189383
has comment: http://stackoverflow.com/comment/44252904
type: AnsweredQuestion
score: 3
has body: I created a custom player built to be responsive. So far, everything works fine, except I can't seem to get the audio to play at the spot where the user clicked on the progress bar. All tutorials I've seen for this use pixel values, whereas my player uses percentages, so when I set barSize = 100 + '%'; it breaks the code and I get an error message saying "Failed to set the currentTime property on HTMLMediaElement: The provided double value is non-finite". HTML &lt;!-- PROGRESS BAR --&gt; &lt;div id="progress_bar"&gt; &lt;div id="bar"&gt;&lt;/div&gt; &lt;/div&gt; JS CODE (for progress bar) // PROGRESS BAR // audio display var progress = document.getElementById('bar'); //click area var audioBar = document.getElementById('progress_bar'); var barSize = 100 + '%'; audio.addEventListener('timeupdate', updateProgress, false); function updateProgress() { if (audio.currentTime &gt; 0) { var value = 0; value = Math.floor((100 / audio.duration) * audio.currentTime); progress.style.width = value + '%'; } else{ $('#play').html('&lt;img src="img/play.png" width="70" height="70" /&gt;'); $(curTimeDisplay).html('0:00'); progress.style.width = 0; } } // CHANGING TIME ON PROGRESS BAR $('#progress_bar').bind('click', function (e) { var $div = $(e.target); var $display = $div.find('#progress_bar'); var offset = $div.offset(); var x = e.clientX - offset.left; //$('#bar').width(x); var newtime = x*audio.duration/barSize; audio.currentTime = newtime; progress.style.width = x + '%'; }); CSS #progress_bar { border:1px solid #500012; margin:1em 0; cursor:pointer; background:#f2f2f2; width:100%; height:20px; display:inline-block; padding:0; } #bar { background:#77001A; height:20px; display:inline-block; float:left; width:0%; } Any help is appreciated :) Thanks!
type: Question
answer count: 1
tagged with: javascript
has title: Update Progress Bar Using Percentage Values?
tagged with: click
has answer: http://stackoverflow.com/a/27896573
accepted answer: http://stackoverflow.com/a/27896573
upvote count: 3

http://stackoverflow.com/comment/44069138
type: QuestionComment
comment on: http://stackoverflow.com/q/27831622
has text: PHP is executed on the server first before the file is sent to the browser, then javascript is executed locally. So no, you can't just chuck php tags into a javascript file and expect it to work.
score: 0
type: Comment

http://stackoverflow.com/comment/44069363
has text: check my edit :) the first sentence still applies :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27831638
type: AnswerComment

http://stackoverflow.com/comment/44151748
comment on: http://stackoverflow.com/q/27874988
type: Comment
type: QuestionComment
has text: Did you check the console for errors? This might be a cross domain problem.
score: 1

http://stackoverflow.com/a/27887641
has comment: http://stackoverflow.com/comment/44176329
has comment: http://stackoverflow.com/comment/44176625
has body: No, there is nothing special about the $ identifier. The actual difference between your snippets is the = after the identifier - without, it calls it with a function as the argument, with it the function gets assigned. hello -&gt; alert "Hello CoffeeScript!" // compiles to: hello(function() { return alert("Hello CoffeeScript!"); }); hello = -&gt; alert "Hello CoffeeScript!" // compiles to: var hello; hello = function() { return alert("Hello CoffeeScript!"); }; So if your hello function does invoke the given callback (as $ does), your function expression will get executed in the first case (without the assignment). Notice that this is not a "self-invocation", as it's hello/$ that would call the function. For an IIFE (which is usually referred to as "self-invoking"), you'd use Coffeescripts do keyword.
has comment: http://stackoverflow.com/comment/44176458
has comment: http://stackoverflow.com/comment/44176203
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27887565

http://stackoverflow.com/a/27942922
type: Answer
has comment: http://stackoverflow.com/comment/50302879
answers question: http://stackoverflow.com/q/27844087
downvote count: 1
has comment: http://stackoverflow.com/comment/44313949
has comment: http://stackoverflow.com/comment/50291026
has comment: http://stackoverflow.com/comment/44283628
score: -1
has comment: http://stackoverflow.com/comment/50303085
has body: Inline mode is enabled by default - go to http://host:port/webpack-dev-server/
upvote count: 0
has comment: http://stackoverflow.com/comment/44299706

http://stackoverflow.com/q/27843478
accepted answer: http://stackoverflow.com/a/27844031
score: 0
tagged with: sinon
answer count: 1
has comment: http://stackoverflow.com/comment/44090911
has comment: http://stackoverflow.com/comment/44090879
has comment: http://stackoverflow.com/comment/44196846
tagged with: node.js
has body: I'm updating server code written in nodejs and trying to add unit test as i go and i can't find a good solution for the following case: classX.prototype.methodX = function () { // Create new session var session = new classY(); // Add the new session to the global list self.sessions[session.sessionId] = session; session.sendPushNotificationToCallee(); } I can easily test that the session object was added to the list of session, but how can i check that the sendPushNotificationToCallee was actually called? My original intent was to use sinon.js spies, but i can't find a way to do that as the object is created in the method... Thanks
type: AnsweredQuestion
has title: How to test that a javascript method creates an object and calls a method on that object
has answer: http://stackoverflow.com/a/27844031
tagged with: unit-testing
type: Question
tagged with: javascript

http://stackoverflow.com/q/27805037
tagged with: jquery
type: UnansweredQuestion
has title: Bootstrap multiple modal dismiss all with the last modal
has body: How can i create multiple overlapping modal popups, and dismiss all the modals with the close button (data-dismiss) on the last modal. Thanks in advance.
tagged with: twitter-bootstrap-3
tagged with: popup
has answer: http://stackoverflow.com/a/27805132
type: Question
has answer: http://stackoverflow.com/a/27806809
tagged with: javascript
score: 0
answer count: 2
tagged with: modal-dialog

http://stackoverflow.com/comment/44030520
comment on: http://stackoverflow.com/a/27809949
has text: I see. There shouldn't be any difference... my guess is that something else is going on that you haven't mentioned here.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27847493
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am using html2canvas to take "screenshots" of the current browser window. I would like to save the screenshot as Base64 encoded data which can later be used to create an html img. For example, I might want to save the String that canvas.toDataURL() returns in the browser's local storage, and retrieve it later. The following code works fine: html2canvas(document.body, { onrendered: function(canvas) { localStorage.setItem('screenshot', JSON.stringify(canvas.toDataURL())); } }); I can later retrieve it and create an image from it, for example using Angular: &lt;img data-ng-src="{{imgData}}"/&gt; What I want to do though, is have a scaled down version of the screenshot. I can simply scale the resulting image using CSS, but I want to save storage space. In other words, I want the String encoding to represent an image that is, for example, 200 pixels wide instead of (say) 1000 pixels wide. I do not care about the quality of the image. This is the closest I've come: saveScreenshot = function(name, scaleFactor) { html2canvas(document.body, { onrendered: function(canvas) { var ctx = canvas.getContext('2d'); var img = new Image(); img.onload = function() { ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.scale(scaleFactor, scaleFactor); ctx.drawImage(img, 0, 0); //canvas.width *= scaleFactor; //canvas.height *= scaleFactor; localStorage.setItem('screenshot', JSON.stringify(canvas.toDataURL())); } img.src = canvas.toDataURL(); } }); } This almost works - the "picture" is scaled correctly, but the resulting image is still the same size as the original, with the rest of the space apparently filled in with transparent pixels. If I uncomment the 2 lines above which set the canvas' height and width, then the image is the right size, but it's all blank. I feel like I'm close - what am I missing?
type: AnsweredQuestion
has title: Given a canvas object, how can I get a scaled down "version" of it as an image/Base64-encoded byte array?
type: Question
tagged with: canvas
tagged with: javascript
tagged with: html2canvas
has answer: http://stackoverflow.com/a/27847681
accepted answer: http://stackoverflow.com/a/27847681
score: 0

http://stackoverflow.com/comment/44046126
type: AnswerComment
type: Comment
has text: `split` was to extract only the date. `toLocaleString()` gives the time also
comment on: http://stackoverflow.com/a/27820028
score: 0

http://stackoverflow.com/q/27807914
favorite count: 0
possible better answer: http://stackoverflow.com/a/33389411
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27828674
score: 2
upvote count: 2
tagged with: unit-testing
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27828674
has title: How do you mock an angularjs $resource factory
answer count: 2
has answer: http://stackoverflow.com/a/33389411
downvote count: 0
tagged with: javascript
tagged with: jasmine
has body: I have a resource factory angular.module('mean.clusters').factory('Clusters', ['$resource', function($resource) { return $resource('clusters/:clusterId/:action', { clusterId: '@_id' }, { update: {method: 'PUT'}, status: {method: 'GET', params: {action:'status'}} }); }]); and a controller angular.module('mean.clusters').controller('ClustersController', ['$scope', '$location', 'Clusters', function ($scope, $location, Clusters) { $scope.create = function () { var cluster = new Clusters(); cluster.$save(function (response) { $location.path('clusters/' + response._id); }); }; $scope.update = function () { var cluster = $scope.cluster; cluster.$update(function () { $location.path('clusters/' + cluster._id); }); }; $scope.find = function () { Clusters.query(function (clusters) { $scope.clusters = clusters; }); }; }]); I am writing my unit tests and every example I find is using some form of $httpBackend.expect to mock the response from the server, and I can do that just fine. My problems is, when unit testing my controller functions I would like to mock the Clusters object. If I'm using $httpBackend.expect, and I introduce a bug in my factory every unit test in my controller will fail. I would like to have my test of $scope.create test only $scope.create and not also my factory code. I've tried adding a provider in the beforeEach(module('mean', function ($provide) { part of my tests but I cant seem to get it right. I also tried clusterSpy = function (properties){ for(var k in properties) this[k]=properties[k]; }; clusterSpy.$save = jasmine.createSpy().and.callFake(function (cb) { cb({_id: '1'}); }); and setting Clusters = clusterSpy; in the before(inject but in the create function, the spy gets lost with Error: Expected a spy, but got Function. I have been able to get a spy object to work for the cluster.$update type calls but then it fails at var cluster = new Clusters(); with a 'not a function' error. I can create a function that works for var cluster = new Clusters(); b…

http://stackoverflow.com/comment/44103091
has text: Actually Sockets would be more simple and easy since they're the kind of technology created to handle this sort of information exchange. The truth is that Ajax is more popular. The concept makes you think that sockets would be harder, but just outcome the prejudice and try to research some simple codes in the matter and you might go the other way
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27844953
type: QuestionComment

http://stackoverflow.com/comment/44213259
type: AnswerComment
has text: I really appreciate this. The ncurses module might be right what I need, and should be able to help because it can return cursor x position, I can test how far each character will move the cursor forward. In any case, it's useful to hear confirmation about the complexity of the issue! Thanks again! :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27893115

http://stackoverflow.com/a/27952402
has comment: http://stackoverflow.com/comment/44303824
has body: Single Regex Here is a straightforward (relative to the scale of your problem) single regex that accounts for all the sample inputs provided – but does not "allow a seemingly infinite number of extra characters to be tacked onto the end of the valid possibilities": ^(\d{4}(\d([\dA-Z]|(\.(\d{1,2}|[A-Z]))|\d[A-Z]|[A-Z](\.\d[A-Z]?|[\dA-Z]\.\d))?|[A-Z]\.\d)|[A-Z]{3}-\d{4,6})$ Debuggex Demo Below is a snippet to test the regex with the sample inputs provided: var regex = new RegExp("^(\\d{4}(\\d([\\dA-Z]|(\\.(\\d{1,2}|[A-Z]))|\\d[A-Z]|[A-Z](\\.\\d[A-Z]?|[\\dA-Z]\\.\\d))?|[A-Z]\\.\\d)|[A-Z]{3}-\\d{4,6})$"); // tests for the sample inputs provided that are all expected to match var tests = [ '12345', '12345.6', '12345.67', '12345.A', '123456', '123456A', '12345A', '12345A.6', '12345A.6B', '12345A6.7', '12345AB.6', '1234A.5', 'ABC-1234', 'ABC-12345', 'ABC-123456' ]; for (var i = 0; i &lt; tests.length; i++) { var result = "'" + tests[i] + "' =&gt; "; if (regex.test(tests[i])) { result += 'Yup!'; } else { result += 'Nope...'; } console.log(result); } Rationale Clearly a top-level alternation (|) is the key to the old-variants/new-variant split; but I think that starting with \d{4,5} (particularly the {4,5} quantifier) for the old variants is the root of overmatching woes. Instead start with what is common to all the old variants – four opening digits (i.e. \d{4}): this allows you to then straightforwardly use follow-on, inner alternations to match the old variants' divergences beyond their first four characters. Details This plays out as follows: ^ – start of the input string ( – start of the 1st-level alternation for old variants and the new variant \d{4} – the four digits with which all old variants start ( – start of the 2nd-level alternation for old variants' primary divergences \d – a fifth digit ( – start of 3rd-level alternations for optional divergences where the first five characters are digits [\dA-Z] – a digit or letter | – OR (3rd-level) (\.(\d{1,2}|[A-Z])) – a p…
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44300388
answers question: http://stackoverflow.com/q/27951545
has comment: http://stackoverflow.com/comment/44302238
score: 2
downvote count: 0

jquery-waypoints
tags question: http://stackoverflow.com/q/27853166
tag name: jquery-waypoints
type: Tag

http://stackoverflow.com/q/27961441
has answer: http://stackoverflow.com/a/27979000
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44316356
has title: jQuery image fader doesn't stop when the window loses focus
type: Question
has comment: http://stackoverflow.com/comment/44323500
answer count: 1
tagged with: window
tagged with: javascript
tagged with: jquery
score: 0
tagged with: focus
has body: I have a simple jQuery image fader, just cycles images in and out of focus. Here's a pen: http://codepen.io/designsoutheast/pen/xbqjZL Here's the code behind the fading: $('img.bgfade').hide(); function anim() { $(".slider img.bgfade").first().appendTo('.slider').fadeOut(1000); $(".slider img").first().fadeIn(10); setTimeout(anim, 3500); } anim(); }); It works fine, but when the window or tab loses focus for a time, and I return to it, the animation has queued and flashes different images / goes berserk until it catches up. I've tried using the jQuery visibility plugin, but haven't been able to get it to work. I've also tried using standard (window).blur.. but I'm not sure how to properly stop the animation during that time. I've tried clearTimeout, but I think I'm doing it wrong. Here's what I've tried: var faderVar; function anim() { $(".slider img.bgfade").first().appendTo('.slider').fadeOut(1000); $(".slider img").first().fadeIn(10); faderVar = setTimeout(function() {anim}, 3500); } function stopFader() { clearTimeout(faderVar); } anim(); $(window).focus(function() { var faderVar; function anim() { $(".slider img.bgfade").first().appendTo('.slider').fadeOut(1000); $(".slider img").first().fadeIn(10); faderVar = setTimeout(function() {anim}, 3500); } function stopFader() { clearTimeout(faderVar); } anim(); }); $(window).blur(function() { stopFader(); }); I THINK I'm on the right track, but I'm quite new to jQuery and I'm pretty sure the clearTimeout is written wrong. I hope someone can help!

http://stackoverflow.com/comment/44144997
comment on: http://stackoverflow.com/q/27870490
has text: There is a section in the duplicate question that says: *What if the property names are dynamic and I don't know them beforehand?* . Did you read that?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44310025
comment on: http://stackoverflow.com/q/27957710
type: QuestionComment
has text: There is an error in your code, try changing the second line in your videos array: { category: 'landscape', sources: [ { type: 'video/webm', src: 'http://zippy.gfycat.com/SpottedDefensiveAbalone.webm' }, { type: 'video/mp4', src: 'http://zippy.gfycat.com/SpottedDefensiveAbalone.mp4' } ] }, It seems to work now..
score: 0
type: Comment

http://stackoverflow.com/a/27850144
downvote count: 0
has comment: http://stackoverflow.com/comment/44105222
has comment: http://stackoverflow.com/comment/44105042
type: Answer
has comment: http://stackoverflow.com/comment/44105490
has comment: http://stackoverflow.com/comment/44104674
has body: The problem with your code is becuase you added jQuery.js after the background.js file Here is the fix: "background":{ "scripts": ["jquery.js", "background.js"] }, Another alternative for the executeScrit task: chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if (changeInfo.status != 'complete') return; if (tab.url.indexOf('yahoo.com') != -1) { chrome.tabs.executeScript(tabId, { code: 'alert(1)' }); } });
upvote count: 3
has comment: http://stackoverflow.com/comment/44104729
has comment: http://stackoverflow.com/comment/44104467
answers question: http://stackoverflow.com/q/27850092
score: 3
accepted answer of: http://stackoverflow.com/q/27850092
has comment: http://stackoverflow.com/comment/44105236
has comment: http://stackoverflow.com/comment/44120075
has comment: http://stackoverflow.com/comment/44107035
has comment: http://stackoverflow.com/comment/44104485
has comment: http://stackoverflow.com/comment/44105537
type: AcceptedAnswer

servlets
tags question: http://stackoverflow.com/q/27953402
tags question: http://stackoverflow.com/q/27848608
tags question: http://stackoverflow.com/q/27846377
tags question: http://stackoverflow.com/q/27925420
tags question: http://stackoverflow.com/q/27962599
tags question: http://stackoverflow.com/q/27837289
tags question: http://stackoverflow.com/q/27901151
tags question: http://stackoverflow.com/q/27852787
tags question: http://stackoverflow.com/q/27846536
tags question: http://stackoverflow.com/q/27926962
tags question: http://stackoverflow.com/q/27833119
tag name: servlets
type: Tag
tags question: http://stackoverflow.com/q/27904518

http://stackoverflow.com/comment/44169980
comment on: http://stackoverflow.com/a/27883941
has text: Another example with standard and user-defined formulas for data manipulation and formatting: http://jsfiddle.net/agershun/6dycw1jz/2/. If this approach is Ok for you, I can add standard formatting functions to the library.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28051970
answers question: http://stackoverflow.com/q/27861109
has body: The problem happens because you have an onclick on the "product-overlay" div. What you need to do is, when the user clicks on the label tag, stop the propagation of the event so it doesn't execute the product-overlay's onclick. In order to do that, just add a event.stopPropagation(); at the beginning/end of the event that handles the label click event. If you want to see how it would work in a quick way without changing any code: Go to your demo link. Open the JavaScript console. Execute the following code: $(".overlay-content label").on("click", function() { event.stopPropagation(); }); Now you can click on the "Add to compare" label without being redirected anywhere. (Notice that the checkbox won't be checked as you stop the propagation of the event, you need to add the stopPropagation call wherever you were handling the label's click)
score: 0
type: Answer

http://stackoverflow.com/comment/44219776
has text: @atlMapper And can we assume that the value of `field` is `"name"`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27910052
score: 1

http://stackoverflow.com/q/27901070
score: 0
answer count: 2
has body: I have the following sample text: hello,Good Morning,Nice to meet you,awesome How do I allow allow spaces to be typed only between text and not before or after special characters. For example I do not want to allow spaces before and after a comma? Code jQuery(document).ready(function() { jQuery('#s').bind('keyup blur', function() { var selectedInput = jQuery(this); selectedInput.val(selectedInput.val().replace(/[\s]/g, '')); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="text" id="s" value="hello,Good Morning,Nice to meet you,awesome" /&gt; Final Answer: use: (/(,\s)|(\s,)/g, ',') selectedInput.val( selectedInput.val().replace(/(,\s)|(\s,)/g, ',') );
has comment: http://stackoverflow.com/comment/44201891
tagged with: jquery
has comment: http://stackoverflow.com/comment/44201855
has comment: http://stackoverflow.com/comment/44201768
has answer: http://stackoverflow.com/a/27901425
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44202268
has comment: http://stackoverflow.com/comment/44202022
type: Question
has comment: http://stackoverflow.com/comment/44201984
has comment: http://stackoverflow.com/comment/44201947
has comment: http://stackoverflow.com/comment/44202024
tagged with: javascript
has comment: http://stackoverflow.com/comment/44201743
has answer: http://stackoverflow.com/a/27901572
possible better answer: http://stackoverflow.com/a/27901425
accepted answer: http://stackoverflow.com/a/27901572
has title: Space between text but not after and before text

http://stackoverflow.com/a/27841442
has body: I think you can try things as seen on this page : http://sonata-project.org/bundles/admin/master/doc/reference/form_types.html (see SONATA_TYPE_MODEL_AUTOCOMPLETE)
has comment: http://stackoverflow.com/comment/44088578
has comment: http://stackoverflow.com/comment/44254119
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/44118476
answers question: http://stackoverflow.com/q/27839472
has comment: http://stackoverflow.com/comment/44236628

http://stackoverflow.com/q/27956436
has comment: http://stackoverflow.com/comment/44308171
type: AnsweredQuestion
has body: I have to add "Asia/Bangkok" (ICT) to moment.js, as it doesn't seem to support it by default. After loading moment.js and moment-timezone.js I tried defining this specific timezone following this example: moment.tz.add({ "zones": { "Asia/Bangkok": [ "6:42:4 - LMT 1880 6:42:4", "6:42:4 - BMT 1920_3 6:42:4", "7 - ICT" ], } }); var currentTimeString = moment().tz('Asia/Bangkok').format('DD MMM YYYY, HH:mm:ss'); However, I keep getting the error: "Moment Timezone has no data for Asia/Bangkok. See http://momentjs.com/timezone/docs/#/data-loading/." Any ideas why?
has comment: http://stackoverflow.com/comment/44307677
score: 3
has answer: http://stackoverflow.com/a/27977422
has title: Add new timezone to moment.js timezone
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: timezone
accepted answer: http://stackoverflow.com/a/27977422
tagged with: datetime
tagged with: momentjs
has comment: http://stackoverflow.com/comment/44308969
upvote count: 3

http://stackoverflow.com/comment/44096208
comment on: http://stackoverflow.com/a/27845260
score: 0
type: Comment
has text: @XGreen thanks for your comment. I will try to figure out what went wrong.
type: AnswerComment

http://stackoverflow.com/comment/44205362
type: QuestionComment
comment on: http://stackoverflow.com/q/27902969
has text: @Justinas $("selector").text().length These give me all text length that div stored. With overflow text also
score: 0
type: Comment

http://stackoverflow.com/q/27855305
linked to: http://stackoverflow.com/q/8228281
has body: This probably is not a new question, but where is the purpose of wrapping a function or codes inside ((function () {...})());? for instance, //Self-evoking anonymous functions ((function () { alert("hi"); })()); What's the difference with no wrap, alert("hi"); I still get the same result - hi What can you pass/ put in the brackets in the end bit - })());? and why?
duplicate of: http://stackoverflow.com/q/8228281
linked to: http://stackoverflow.com/q/592396
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/592396
accepted answer: http://stackoverflow.com/a/27855372
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44114013
score: 0
tagged with: anonymous-function
answer count: 1
has title: Javascript - what is the purpose of wrapping functions or codes in a function?
has answer: http://stackoverflow.com/a/27855372

http://stackoverflow.com/comment/44100201
type: Comment
comment on: http://stackoverflow.com/a/27848177
has text: I understood it as the content I want is post page loading in the client, so it is only normal that the server where I run the PHP can't get the contents I need.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44097528
comment on: http://stackoverflow.com/a/27845681
has text: I misunderstood your original question. My bad on that one. I don't know if it's possible to use `datetime` type for the parent and `category` type for the `drilldown` children.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27919110
has comment: http://stackoverflow.com/comment/44484033
type: Question
has comment: http://stackoverflow.com/comment/44270276
tagged with: javascript
score: 0
tagged with: rtcdatachannel
answer count: 1
tagged with: webrtc
has answer: http://stackoverflow.com/a/43014542
type: UnansweredQuestion
has title: erratic behaviour of RTC datachannel
has body: I am using RTC datachannel to transfer data (about 200kb) every 100ms( using timeout) between two peers( both chrome browsers, one windows pc n other mac). For some reason, suddenly for no reason, in general after approx 5 minutes, one of the peers stop receiving the data, after some more time, the other peer also stops receiving the data. After lot of debugging, I found out that both peers are still transmitting the data, and from network traffic analysis, it was clear that the other machine is receiving the data, but the browser does not invoke channel.onmessage. part of my code: function timepot1(){ // I have cheked, this keeps getting called, no problem here try { .... channel.send(JSON.stringify(jsObject)); }catch (err) { console.log(err); } setTimeout(timepot1, 100); }; is there some known bug that is causing this, or is it because I am transferring large amount of data from both peers on same channel at same time? EDIT Apparently, I was using two datachannels( one for transmission in each direction), when I changed to single channel. It stopped working much quicker. this is going sound stupid, but when I clear the console( in chrome browser) the receiving of data on that browser stops almost immediately( but eh machine still receives the data ).

http://stackoverflow.com/q/27888611
has comment: http://stackoverflow.com/comment/44178111
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27888754
favorite count: 0
possible better answer: http://stackoverflow.com/a/27888754
has title: Using getElementById to find child element
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27888622
tagged with: css
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44178390
accepted answer: http://stackoverflow.com/a/27888622
tagged with: javascript
has body: In Javascript, I need to select child elements with getElementById(): #topbarsection li a {} I've tried this: topbarsection = document.getElementById('topbarsection&gt;li&gt;a'); and this: topbarsection = document.getElementById('topbarsection li a');

http://stackoverflow.com/comment/44098154
comment on: http://stackoverflow.com/q/27836554
type: Comment
type: QuestionComment
has text: Try to avoid eval, this is so dangerous... the best theory in mind is send a JSON object directly from the server side. As for the reason that you don't see the grid, is because SlickGrid works with everything or nothing, basically means get me all the data or else I'm (the grid) not doing anything!
score: 0

http://stackoverflow.com/comment/44050999
has text: is there a reason why you don't want to use the event names? you said you have events on links but unless I'm missing something why bind events to lots of 'a' tags?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27822467

http://stackoverflow.com/q/27846195
upvote count: 1
tagged with: php
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44096454
has comment: http://stackoverflow.com/comment/44097072
has answer: http://stackoverflow.com/a/27846750
has comment: http://stackoverflow.com/comment/44096815
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44096589
favorite count: 0
score: 0
has title: How can I add the current pathname to a href with a different url?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44097209
has answer: http://stackoverflow.com/a/74437330
accepted answer: http://stackoverflow.com/a/27846750
has body: I'm currently splitting a website up so the English version resides on the subdomain en. and the French version resides on the www. Before doing this I have a drop down menu that selects the current language by appending the url with the language code so clicking 'English' will add /en/ after the .com and clicking 'French' will add /fr/ currently if the user chooses to change languages on a product page it will stay on the same page. I would like to do the same but rather than using the current url and ammending the /en/ to /fr/ or vice versa it will add the current filepath to the end of the url in the href on the anchor tag. English français Above is what I have currently but this just takes the user to the french homepage. I tried to write a script to append the filepath to the url but this doesn't work, see below: I'm not sure if it helps but an example of one of the urls is en.domain.com/en/c/62/lenfance/ if french is selected I would like it to go to www.domain.com/fr/c/62/lenfance/ - i would like to take the /c/62/lenfance/ and append this to the href in the anchor tag Any help would be massively appreciated! Thanks, Chris
possible better answer: http://stackoverflow.com/a/74437330

http://stackoverflow.com/a/28785531
has body: You're nearly there. The context menu is displayed on MouseRightButtonUp. public MainPage() { LayoutRoot.MouseRightButtonUp += (s, e) =&gt; { e.Handled = true; }; }
type: Answer
answers question: http://stackoverflow.com/q/27941457
score: 0

http://stackoverflow.com/comment/44063106
has text: I amended the code following your instructions, added the template to the views folder. But I get, Error: Failed to lookup view "form" in views directory "C:\myapp\dick\views/form.html
comment on: http://stackoverflow.com/a/27827430
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27949664
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27949783
accepted answer: http://stackoverflow.com/a/27949783
type: Question
tagged with: radio-button
answer count: 1
tagged with: javascript
has body: I have encountered a problem where checking a radio button using JavaScript does not work when used in a called function, and I have not a clue why this happens - see working fiddle: http://jsfiddle.net/Vulcan/0zykejvh/3/ I have tried several forms of doing this, such as document.getElementById("id").checked= true and var radioVar = document.getElementById("id") radioVar.checked = true I would rather not have to use jQuery as I have no idea how to use it
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Radio button checked property fails in function - JavaScript
has comment: http://stackoverflow.com/comment/44294396

http://stackoverflow.com/comment/44145210
score: 0
type: AnswerComment
type: Comment
has text: Thanks, but no, I can't do that because that method is not on `$scope`. That is why I use the `ControllerAs` syntax.
comment on: http://stackoverflow.com/a/27871209

http://stackoverflow.com/q/27884020
accepted answer: http://stackoverflow.com/a/27998713
score: 2
has answer: http://stackoverflow.com/a/27884093
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27952262
has comment: http://stackoverflow.com/comment/44300312
has comment: http://stackoverflow.com/comment/44301969
type: Question
has title: Click image, hide other images and animate image sliding with JQUERY
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27998713
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27954239
tagged with: css
answer count: 4
has body: Just want to preface by saying this my first post, but definitely a long time reader of these forums, so be kind. What I'm using: jQuery and Bootstrap 3 What I'm trying to accomplish I have 5 images centered in a row. I want to be able to click one of the images and have the following happen: fadeOut or hide the other 4 images, slide the remaining image to the far left of the row and slide into view another div to use as a container for other content.(I was able to get the code working that changes the content based on image click, just need help with the animation portion). Here's my JSFiddle for what I've been able to accomplish. Any help outside this question (code etiquette etc.) is appreciated. Only been doing this about 3 months or so now, but having a blast. Still getting use to some lingo so explaining like I'm 5 is ok. Edit 1: http://jsfiddle.net/eps7tpyd/ Here's something even closer, but the animation for the divs moving to the right seems to only happen for the 1st one and I suspect it's because it's class is the only one changing. The other divs don't require a class change to move left. Because the other ones get hidden, they move all the way left in the bootstrap row. Edit2: Here's my final solution for anyone else trying (doesn't have the reveal div functionality, but don't think it'll be too hard to do. If I get a chance in the next day or so I'll post it up when I'm done. http://jsfiddle.net/8g9tL5zw/ JQUERY $(document).ready(function () { $('div.container2').hide(); $('div.roster').click(function () { if ($(this).hasClass("offset")) { $(this).toggleClass("col-xs-offset-1"); $('div.roster').not(this).fadeToggle(); $('div.container2').toggle(); } else { $('div.roster').not(this).fadeToggle(); $('div.container2').toggle(); } }); }); HTML TEST CSS .container { width: 95%; margin-top: 15px; } article .roster { overflow: hidden; -webkit-transition: width 0.1s ease, margin 0.1s ease; -moz-transition: width 0.1s ease, margin 0.1s ease; -o-transition: widt…
upvote count: 2
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/27954239

http://stackoverflow.com/comment/44207078
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27903765
has text: `$("#selectStatus").bind("change", function() {`

http://stackoverflow.com/comment/44039911
type: QuestionComment
comment on: http://stackoverflow.com/q/27816760
score: 0
has text: @ArunChandranC : textbox id is txtVal, It can be accessed in child form but not in parent form.
type: Comment

http://stackoverflow.com/comment/44338216
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27954855
has text: If what you need is just process the JSON data you get from that $http.get call and split it in "name" and "surname" fields, then you only need to do something like:`$scope.persons = $scope.OutAnagrafica.map(function (person) { var nameParts = person.split(" "), name = nameParts[0], surname = nameParts.slice(1).join(" "); return { "name": name, "surname": surname }; });`

http://stackoverflow.com/comment/44019911
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27804902
score: 0
has text: alright, thanks guys for the suggestion. Leave the answer & i will accept it. Once again thank you.

http://stackoverflow.com/comment/44096939
has text: there is an html form on the same page that is setting these values which are all text field data, Except the ad_link variable, which is a URL to a file that gets uploaded on that form as well. I'm wondering if the file is causing the problem here as well. As for why the data() method. That is part of my question here, how to format the success function to correctly pull the json data
score: 0
comment on: http://stackoverflow.com/q/27846412
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44194332
score: 0
type: AnswerComment
has text: Have you followed all of my advice? I really don't like giving answers only to find that the OP ignores them. Add the `page.error` event handler and see what errors there are.
comment on: http://stackoverflow.com/a/27885866
type: Comment

http://stackoverflow.com/comment/44251651
has text: No problem. Note that you might want to use onchange listeners instead of onclicks because you can also check the buttons using the keyboard or by touching, etc.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27927063

http://stackoverflow.com/q/27874925
has comment: http://stackoverflow.com/comment/44194493
has title: angular fileModel not working in ng-repeat
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44151585
score: 0
has body: my directive is as below angularApp.directive('fileModel', ['$parse','flash', function ($parse, flash) { return { restrict: 'A', link: function (scope, element, attrs) { var model = $parse(attrs.fileModel); var modelSetter = model.assign; element.bind('change', function () { console.log(scope.tools); if (element[0].files[0].size &lt;= 4000000) { if (attrs.fileType != 'image' || element[0].files[0].type == "image/jpg" || element[0].files[0].type == "image/jpeg" || element[0].files[0].type == "image/png" || element[0].files[0].type == "image/gif" || element[0].files[0].type == "image/bmp") { scope.$apply(function () { modelSetter(scope, element[0].files[0]); }); } else { flash.pop({ title: 'Warning', body: 'Please select logo of type jpg,png,gif or bmp', type: 'warning' }); } } else { flash.pop({ title: 'Warning', body: 'Please select max 4 MB in size', type: 'warning' }); } }); } }; }]); its working individual but if I use it in ng-repeat like below its not working &lt;div class="form-group browse-file" ng-repeat="casestudy in tools.casestudies"&gt; &lt;input type="file" file-model="tools.casestudies[$index]", file-type="doc" class="col-lg-4 browse-file-info" /&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/44152128
has comment: http://stackoverflow.com/comment/44153256
tagged with: angularjs
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/44254119
comment on: http://stackoverflow.com/a/27841442
score: 0
type: AnswerComment
has text: It comes directly from the Sonata doc
type: Comment

http://stackoverflow.com/comment/44105871
type: Comment
comment on: http://stackoverflow.com/a/27850900
has text: hmm quite cool actually. Had to think about it for a minute to figure out why it works.
score: 0
type: AnswerComment

http://stackoverflow.com/a/27841900
has body: In jQuery you don't need what do you demonstrate, just use the callback function of the event: $(document).ready(function(){ $('#emailForm').submit(function(event){ // Do what do you want onsubmit here }) })
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44091018
upvote count: 5
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27841748
answers question: http://stackoverflow.com/q/27841748
score: 5

http://stackoverflow.com/comment/44055990
score: 0
type: Comment
has text: Yes it's working upon clicking on "Submit!" button. How can I make this work after pressing "enter" or "return" ? :)
type: AnswerComment
comment on: http://stackoverflow.com/a/27825032

http://stackoverflow.com/comment/44062437
type: QuestionComment
comment on: http://stackoverflow.com/q/27828248
score: 0
has text: are you saying resize the .child so it fills the parent?
type: Comment

http://stackoverflow.com/q/27843225
has body: I've been using require() to break my code up into modules, but the results of doing this seem to be sporadic and inconsistent. For example, in main.js, I have two requires()s: var moduleOne = require('cloud/moduleOne.js'); var moduleTwo = require('cloud/moduleTwo.js'); Calling methods which are appended to moduleOne via exports produces the correct result: moduleOne.methodOne(argumentOne); // is defined Where as doing the same thing to the second module doesn't. It tells me the method is undefined. moduleTwo.methodTwo(argumentTwo); // is undefined I'm really confused why this is so inconsistent. In each source file, I'm declaring the functions like so (There's no function wrapper to create a local namespace): // moduleOne.js exports.methodOne = function(argumentOne) { // Code } // moduleTwo.js exports.methodTwo = function(argumentTwo) { // Code } My linter tells me all the code is valid, and code in moduleOne executes as expected and passes the tests I have for it. Has anyone else experienced this, and if so, what was the solution? Both files are indeed in the cloud directory and both of them are on Parse.
answer count: 1
has title: require() doesn't consistently return methods appended to the exports object
tagged with: javascript
has answer: http://stackoverflow.com/a/27881750
has comment: http://stackoverflow.com/comment/44090442
has comment: http://stackoverflow.com/comment/44164933
tagged with: parse-platform
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44164498
has comment: http://stackoverflow.com/comment/44090352
score: 0

http://stackoverflow.com/comment/132869144
comment on: http://stackoverflow.com/a/27925561
has text: Thanks @Bergi +1 "It's specified that all callbacks are invoked asynchronously. All of them. No exceptions" - So, will Promise.prototype.catch() and Promise.prototype.finally() **always** run asynchronously as well? **or what callbacks** are you referring to?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44248155
comment on: http://stackoverflow.com/q/27923586
type: Comment
type: QuestionComment
score: 0
has text: No, in Chrome extensions, definitely not. I searched all documentation but only leaves making windows with borders and buttons (awkward options for users). In Chrome apps I can create transparent windows with *chrome.app.window.create* (properties: **alphaEnabled and AlwaysOnTop**), but these properties are only available for the version of Chrome dev (without compatibility for users)

http://stackoverflow.com/comment/44127559
has text: Yes, that's an option. I'll give it a try now
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27862340

http://stackoverflow.com/comment/44316381
has text: @Fuzzyma that is why there is a + after .
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27961425

http://stackoverflow.com/q/27806415
has answer: http://stackoverflow.com/a/27806701
accepted answer: http://stackoverflow.com/a/27806701
has answer: http://stackoverflow.com/a/27806519
has comment: http://stackoverflow.com/comment/44022060
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44021921
tagged with: javascript
tagged with: jquery
score: 0
has title: How to make a element to follow another but not in the line?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/27806519
has body: I'm making a snake game. I'm trying to make the player turn so the body elements of it should follow the head and should be created after it's head. &lt;!--Player--&gt; &lt;div class="snake"&gt;&lt;/div&gt; Ok. This is the snake and the game is throwing all of the parts inside. Head and body parts. var pos = 100; //Snake Grows var grow = function() { $('&lt;div&gt;&lt;/div&gt;').addClass('body').prependTo('.snake').css('left', pos * score * 1.1 +'%'); } This function is called later when snake eats the food. It creates a block that prepends to the snake's body but when it turns it just goes vertically. Is there a follow() function or something simmilar that will make the body parts go through same path as the head? If not any ideas how to solve this? I'm new to programing so any advices would be helpful.
type: AnsweredQuestion

http://stackoverflow.com/comment/44016462
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27803734
has text: Is $(this) an input?
score: 0

http://stackoverflow.com/a/27947101
has comment: http://stackoverflow.com/comment/56159988
has comment: http://stackoverflow.com/comment/44289224
accepted answer of: http://stackoverflow.com/q/27946559
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27946559
has comment: http://stackoverflow.com/comment/44289435
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44292283
has body: The problem is that by the time the blur event fires, the for loop has exited and the value of i will be set to the last value it arrived at when the for loop exited. Then, eventually, when the blur event fires judge.validate(document.getElementById(divs[i]) will fail because i is not what you expected. One way to fix it is by forming a closure over the value of i: for (var i = 0; i &lt; arrayLength; i++) { (function(index) { // index is the current i value $(document.getElementById(divs[index])).blur(function() { judge.validate(document.getElementById(divs[index]), { valid: function(element) { element.style.border = '1px solid green'; }, invalid: function(element, messages) { element.style.border = '1px solid red'; // alert(messages.join(',')); } }); }); })(i); // pass i to the immediately executing anonymous function (closure) } So we put the $.blur code inside a closure and pass i in. Inside the closure i will be called index. The value of index will be the expected value at the time the loop executed the code, and will remain that way after the loop exits. Notice how inside the blur handler we're now using divs[index]. The thing to take away from this particular problem is that the blur event handler function is asynchronous and won't evaluate divs[i] until the blur event happens which will be at a time after the for loop has exited and left the value of i at its last value i == arrayLength - 1. Here's some more reading on that: Calling an asynchronous function within a for loop in JavaScript Another way to fix this would be to save the element you find with document.getElementById(divs[i]) and then use this inside the handler: for (var i = 0; i &lt; arrayLength; i++) { var field = $(document.getElementById(divs[i])); field.blur(function() { judge.validate(this, { // `this` is the field element valid: function(element) { element.style.border = '1px solid green'; }, invalid: function(element, messages) { element.style.border = '1px solid red'; // alert(messages.j…

http://stackoverflow.com/a/27878523
answers question: http://stackoverflow.com/q/27878430
downvote count: 0
score: 1
has body: There is typo. It should be success instead of 'succes' phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http', '$log', function ($scope, $http, $log) { $http.get('http://localhost:8080/webapp/rest/myresource/posts'). success(function (data) { $scope.posts = data; }); $scope.data = "hello world"; $scope.chiliSpicy = function () { $log.info('chili function'); }; $scope.sendData = function () { $http.post('http://localhost:8080/webapp/rest/myresource/', {'data' : $scope.data} ) .success(function (data, status, headers, config) { // !!! here is line 39 $log.info('sent'); }) .error(function (data, status, headers, config) { $log.error('not sent') }); }; }]);
upvote count: 1
type: Answer

http://stackoverflow.com/q/27824984
has comment: http://stackoverflow.com/comment/44055932
has comment: http://stackoverflow.com/comment/44056034
has comment: http://stackoverflow.com/comment/44055847
has comment: http://stackoverflow.com/comment/44056181
has body: I have image in my page, which I want to protect by directly viewing from it's URL. Basically, I want to hide/encrypt image source. &lt;img src="www.mywebsite.com/media/1.jpg" alt="customer_id" /&gt; I have disabled right click on the image by some sort of javascript. But, still one can get the image source from source code of the page. I also tried by adding these attribute in image. ondrag="return false" ondragstart="return false" oncontextmenu="return false" galleryimg="no" onmousedown="return false" Is there any way to solve this problem? Thanks.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44056147
has comment: http://stackoverflow.com/comment/44055840
tagged with: javascript
has comment: http://stackoverflow.com/comment/44055841
has comment: http://stackoverflow.com/comment/44055983
favorite count: 0
has comment: http://stackoverflow.com/comment/44056144
has comment: http://stackoverflow.com/comment/44056001
has comment: http://stackoverflow.com/comment/44056179
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44056241
has answer: http://stackoverflow.com/a/27825171
has comment: http://stackoverflow.com/comment/44056003
has comment: http://stackoverflow.com/comment/44056026
has answer: http://stackoverflow.com/a/27825304
has comment: http://stackoverflow.com/comment/44056187
linked to: http://stackoverflow.com/q/18870937
has comment: http://stackoverflow.com/comment/44055865
score: 0
has comment: http://stackoverflow.com/comment/44056218
has comment: http://stackoverflow.com/comment/44056070
answer count: 2
tagged with: encryption
upvote count: 1
tagged with: php
downvote count: 1
has title: Protect image in browser php

google-fusion-tables
type: Tag
tag name: google-fusion-tables
tags question: http://stackoverflow.com/q/27832734

http://stackoverflow.com/q/27926611
tagged with: javascript
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/27926876
has answer: http://stackoverflow.com/a/27926876
accepted answer: http://stackoverflow.com/a/27926920
type: AnsweredQuestion
has title: Fore apply new element as default element for directive
has body: How to force setup new element as default element from directive? With attention new element must be connected to this scope. example: &lt;div ng-test /&gt; JS: app.directive("ngTest", ["$interval", "$compile", function($interval, $compile) { return { restrict:'A', link: function($scope, $element, $attrs) { if($element[0].tagName === "div"){ var el = document.createElement('span'); el.setAttribute('ngTest','') $element[0].outerHTML = el.outerHTML; } console.log($element[0]) // still &lt;div&gt;, but from domDocument has been changed to span // how to force apply? } } }]);
upvote count: 1
type: Question
tagged with: angularjs-directive
score: 1
has answer: http://stackoverflow.com/a/27926920
has comment: http://stackoverflow.com/comment/44250687
answer count: 2
downvote count: 0

http://stackoverflow.com/q/27869316
answer count: 3
has title: Email matching regex taking long time in java but evaluates quickly in java script
has body: The following email validation code in Java takes forever to give an answer. /* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /* Name of the class has to be "Main" only if the class is public. */ class abc { private static Pattern validEmailPattern = Pattern.compile("^[a-zA-Z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:.[a-zA-Z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*" + "@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); public static void validateEmailPattern(String emailId) { Matcher emailMatcher = validEmailPattern.matcher(emailId); if (emailMatcher.matches()) { System.out.println("MATCHED"); } else { System.out.println("UN- MATCHED"); } } public static void main (String[] args) { String emailId = "tmaloneysdkjhrfsdlfhsldhflsdhflshlfhsf+NA5@amazonsdafshkjhfksefskdhkjksdhhfskjhfjhkhkffakhfkahskfhkahsdkjhf840h0ry0wy430ohwrghkcghkvlbhj.com"; long start = System.currentTimeMillis(); validateEmailPattern(emailId); long end = System.currentTimeMillis(); System.out.println(end-start); } } while the counter part in javascript gives a good performance: var email = "tmaloneysdkjhrfsdlfhsldhflsdhflshlfhsf+NA5@amazonsdafshkjhfksefskdhkjksdhhfskjhfjhkhkffakhfkahskfhkahsdkjhf840h0ry0wy430ohwrghkcghkvlbhj.com"; //Email is stored as a request preference whose max length is 200. Although email can be of 256 characters, if (email.length &lt;= 200) { var validEmailRegex = /^[a-zA-Z0-9!#$%&amp;'*+\/=?\^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&amp;'*+\/=?\^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/; if(validEmailRegex.test(email)) { console.log("Matched"); } else { console.log("Not Matched"); } } Here is a fiddle for the same: http://jsfiddle.net/amandeepautam/HKhw8/548/ Note that the email string in question is less than 200 characters in length. What can be the reasons for this? What can be a su…
has comment: http://stackoverflow.com/comment/44141050
has comment: http://stackoverflow.com/comment/44141382
has comment: http://stackoverflow.com/comment/44141159
tagged with: java
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27869507
has comment: http://stackoverflow.com/comment/44141641
tagged with: javascript
has comment: http://stackoverflow.com/comment/44141198
type: Question
has answer: http://stackoverflow.com/a/27870309
tagged with: regex
has answer: http://stackoverflow.com/a/27869373
has comment: http://stackoverflow.com/comment/44141571
score: 0

http://stackoverflow.com/a/27832375
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27831965
answers question: http://stackoverflow.com/q/27831965
has comment: http://stackoverflow.com/comment/44089000
upvote count: 1
has body: You are using a CompositeView to display a Collection, but you need to define a childView to render the models var LeafView = Backbone.Marionette.ItemView.extend({ // ... }); var TreeView = Backbone.Marionette.CollectionView.extend({ childView: LeafView }) here is an updated fiddle. http://jsfiddle.net/6ok1rptq/ Now the "result" showing in the html, without being familiar with the underscore source, I believe this is caused by the fact that the data given to the template is null, and a quick look at the source of underscore shows that it is using with http://underscorejs.org/docs/underscore.html#section-148 "If a variable is not specified, place data values in local scope." Meaning that the template can't find a "name" variable, and will instead look it up in the global scope (window) Result is just the name of the jsfiddle iframe containing the result of the fiddle &lt;iframe name="result" ...&gt;
type: Answer
downvote count: 0

http://stackoverflow.com/comment/44172771
score: 0
comment on: http://stackoverflow.com/q/27885804
type: QuestionComment
type: Comment
has text: Your JavaScript makes a POST request and says that the POST body is a JSON document, but you have no `data` parameter so there isn't a POST body.

waveform
tag name: waveform
type: Tag
tags question: http://stackoverflow.com/q/27903004
tags question: http://stackoverflow.com/q/27923243
tags question: http://stackoverflow.com/q/27911613

http://stackoverflow.com/a/27937741
downvote count: 1
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/27937689
has body: Perhaps you can try to reduce the Zoom:14 level
type: Answer
has comment: http://stackoverflow.com/comment/44272260

http://stackoverflow.com/q/27860884
score: 0
has body: I made a game using html, javascript, and the Phaser library. It works perfectly fine on my localhost. However when I upload it to Github (via the web interface), and run it, it gives this error: Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at http://www.imagesup.net/dt-1514207740759.png may not be loaded. Could someone please explain what I'm doing wrong, and how to fix it? Thanks.
answer count: 3
has title: Javascript Phaser cross-origin error
tagged with: image
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28374109
has answer: http://stackoverflow.com/a/39251757
type: Question
has answer: http://stackoverflow.com/a/31886195
tagged with: phaser-framework

http://stackoverflow.com/comment/44080986
type: Comment
type: QuestionComment
has text: It seems that you have a page that is populated dynamically. You haven't actually defined in what way the page is different from what you expect. Is the content empty? Have you tried to take a screenshot (`page.render`)? Your first snippet is correct. Maybe you have page errors and regardless of the amount of time you wait, the page won't change ...
comment on: http://stackoverflow.com/q/27836951
score: 0

http://stackoverflow.com/comment/44205931
comment on: http://stackoverflow.com/q/27902340
score: 0
type: QuestionComment
type: Comment
has text: Infact, even when I changed the top property directly, it didn't change. if($("#middleContainer").height() > 500){ $(".footer").css("top", "-850px"); }

http://stackoverflow.com/q/27839870
has answer: http://stackoverflow.com/a/31436493
has answer: http://stackoverflow.com/a/60333036
favorite count: 0
has title: access textarea with spring-thymeleaf
type: UnansweredQuestion
tagged with: spring
has comment: http://stackoverflow.com/comment/44083394
has answer: http://stackoverflow.com/a/34551752
upvote count: 5
tagged with: java
has body: following Problem: I try to change the text of a textarea. I'm using Sping and Thymeleaf. Right now my Code looks like this: Spring: [...] modelMap.addAttribute("Email", "035and so on"); modelMap.addAttribute("Notes", "Please take this text and use it!"); [...] Thymeleaf: [...] [...] the telephone String works fine, but i dont know how to access the Textarea. Would be glad if someone could help me.
type: Question
score: 5
downvote count: 0
tagged with: javascript
answer count: 3

http://stackoverflow.com/comment/44287379
comment on: http://stackoverflow.com/q/27946057
type: Comment
type: QuestionComment
score: 0
has text: @Quentin thank you very much for a quick reply. I'll get to that soon too, I'm just starting to learn :)

dynamics-nav
type: Tag
tags question: http://stackoverflow.com/q/27949506
tag name: dynamics-nav

http://stackoverflow.com/comment/44281240
has text: Isn't this simply because you create an ad-hoc (on the stack) dialog and when the method ends this terminates (and auto closes)?
comment on: http://stackoverflow.com/q/27942688
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44201856
type: QuestionComment
comment on: http://stackoverflow.com/q/27900565
has text: which plugin is this popover bootstrap or jquery send the plugin js link.
score: 0
type: Comment

http://stackoverflow.com/a/27819901
type: Answer
answers question: http://stackoverflow.com/q/27819771
score: 0
has body: Build a REST service and use Angular to retrieve the data. Here is a nice detailed description how to accomplish this.

http://stackoverflow.com/q/27815833
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27816071
has comment: http://stackoverflow.com/comment/44038391
has comment: http://stackoverflow.com/comment/44037946
has body: I've been trying to figuring out how to hide and display text through JavaScript. There is a script that I am loading here to generate the message data. Here I am grabbing the sender from the mail-generator.js with this code bellow. var sender = currentMessage.sender; var body = currentMessage.body; var date = currentMessage.date; var subject = currentMessage.subject; // Sender var mySenderElement = document.createElement('div'); mySenderElement.setAttribute('id','sender') mySenderElement.innerHTML = sender; mainElement.appendChild(mySenderElement); This gives me this result in the HTML Rick Roger Now I want fetch the message data and I do this here // Body var myBodyElement = document.createElement('div'); myBodyElement.setAttribute('id','body'); myBodyElement.innerHTML = body; mainElement.appendChild(myBodyElement); My result is this in the HTML We need to save Buffy from Hansel and Gretel. Well, you were busy trying to get yourself lit on fire. The only thing Willow was ever good for, the only thing I ever had going for me were those moments, just moments, where Tara would look at me and I was wonderful. Everyone's a hero in their own way, in their own not that heroic way. Planet's coming up a mite fast. What I want to happen is for body to be hidden when the page loads. In the place of body I would like to have a little bit of text saying click to read message and when clicked upon the body message appears. Here is a link to my fiddle http://jsfiddle.net/kapena/6qf4j8cn/ I have a feeling that the solution has something to do with a .addEventListener("click", myFunction); Just not sure on how to hide the paragraph and place in text saying click to read the message. Any help would be greatly appreciated. Just starting JS so please bare in mind that I am a beginner. Even just point me in the right direction would be cool :) Thank you
tagged with: javascript
has comment: http://stackoverflow.com/comment/44038192
score: 0
has comment: http://stackoverflow.com/comment/44038312
answer count: 3
has comment: http://stackoverflow.com/comment/44037998
has answer: http://stackoverflow.com/a/27816038
favorite count: 0
has title: Click to show hidden text
has comment: http://stackoverflow.com/comment/44037981
possible better answer: http://stackoverflow.com/a/27816416
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27816416
tagged with: css
has comment: http://stackoverflow.com/comment/44038104
has answer: http://stackoverflow.com/a/27816071
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44038016
type: Question

http://stackoverflow.com/comment/44143598
type: Comment
has text: Thank you for the help Dario. It didn't work. I am just getting a blank screen, the .dae model does not appear. Here is file with inserted Collada loader: http://www.filedropper.com/colladaloader
comment on: http://stackoverflow.com/a/27867381
type: AnswerComment
score: 0

http://stackoverflow.com/q/27844214
has body: I have a function responsive that changes behaviour of certain elements on my website, including hiding popups etc. I call it in 2 cases: $(document).ready(responsive); $(window).resize(responsive); The problem occurs on android chrome, as the virtual keyboard actually changes the height of the screen, and triggers responsive function, which closes my popups (some of them have text fields, making it impossible to type). How can I prevent this from happening? I read somewhere a good point that android virtual keyboard only changes height of the screen, not a width, so I assume it would be a good idea to compare width before and after resize. So I created this function to compare the widths before and after and run resize() if width is different, but it doesn't work as expected, and console logs show different document widths even though I only changed the height of the screen (using chrome developer tools). Any idea what went wrong or how can I prevent function responsive being launched on height change? function resizeWidth() { var existingWidth = $(document).width(); $(window).resize(function() { var newWidth = $(document).width(); if (existingWidth != newWidth) { $(window).resize(responsive); console.log(existingWidth); console.log(newWidth); }; }); }; $(window).resize(resizeWidth);
tagged with: javascript
tagged with: android-virtual-keyboard
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27844359
tagged with: android
type: AnsweredQuestion
score: 2
upvote count: 2
has title: Call jquery function only when window width gets resized
has comment: http://stackoverflow.com/comment/44092215
tagged with: google-chrome
type: Question
accepted answer: http://stackoverflow.com/a/27844359

http://stackoverflow.com/comment/44171830
comment on: http://stackoverflow.com/q/27885179
score: 0
has text: i want to get 2 iframe src from group of iframe and i will print the second iframe src to another div.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/137013211
type: AnswerComment
comment on: http://stackoverflow.com/a/41016410
score: 0
type: Comment
has text: So, what about handlers in the qml? something like `onClicked` is there a Function type?

http://stackoverflow.com/q/27848907
type: AnsweredQuestion
has title: Chrome Extension add YouTube tags
has comment: http://stackoverflow.com/comment/44101801
accepted answer: http://stackoverflow.com/a/27849276
type: Question
tagged with: javascript
tagged with: dom-events
score: 0
tagged with: google-chrome-extension
answer count: 1
has body: I'm writing a Chrome extension that I would like to add tags to the YouTube edit page Specifically more than one. I can insert the tag text as a string with each tag delimited by a comma. For YouTube to take this comma delimited string and split it into tags correctly the tag insertion space needs to receive a keyup or change event. I've looked at a LOT of Stack Overflow posts that talk about triggering key events, but none of the code suggested there seems to be working for me. Unfortunately for some reason when I try to trigger the event, I get an error using the following code: document.getElementsByClassName("video-settings-add-tag")[0].focus(); document.getElementsByClassName("video-settings-add-tag")[0].keyup(); The error states: "Uncaught TypeError: undefined is not a function"; The focus code works so I'm definitely targeting the correct element. It's strange because other events (that don't actually do what I need) DO work, namely focus, blur and click. YouTube has event listeners bound to the video-settings-add-tag element that I need to trigger to get it to split the string into tags. Anyone know why this isn't working? P.S. I also tried defining the change event to see if that would work and this code didn't throw an error but also didn't do anything: var event = new KeyboardEvent('change'); document.getElementsByClassName("video-settings-add-tag")[0].dispatchEvent(event); document.getElementsByClassName("video-settings-add-tag")[0].change;
has answer: http://stackoverflow.com/a/27849276
has comment: http://stackoverflow.com/comment/44101742

http://stackoverflow.com/q/27854471
tagged with: javascript
has comment: http://stackoverflow.com/comment/44112601
favorite count: 0
has comment: http://stackoverflow.com/comment/44112557
has title: HTML concatenation in js failed
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27856085
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/27854522
has body: html += '&lt;div style="background: url("http://graph.facebook.com/' + photo + '/picture?type=normal") background-size: cover;&gt;'; I've been trying for 1 hour still couldn't get it done right.
has answer: http://stackoverflow.com/a/27854535
has comment: http://stackoverflow.com/comment/44112554
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27854507
has comment: http://stackoverflow.com/comment/44112547
score: -1
upvote count: 0

http://stackoverflow.com/q/27959498
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28083104
tagged with: dom
type: Question
has body: I have a web-page, containing image miniatures. Click on miniature calls javascript, that appends to DOM full-image gallery, and opens it in a modal view. Browser starts immediate fetching images after an appending, but the problem is that they are still fetching after the modal gallery is closed and the gallery is deleted from DOM. Is there any way to stop image loading? Thank you all.
tagged with: javascript
tagged with: image
score: 0
has title: stopping image loading with javascript
answer count: 1

http://stackoverflow.com/comment/44127594
comment on: http://stackoverflow.com/a/27841993
score: 0
type: Comment
has text: @MinalTelgade Here you are [fiddle](http://jsfiddle.net/1y4s57rL/16/) I have added all the instructions you need as a comment in the javascript column
type: AnswerComment

http://stackoverflow.com/q/27853763
has comment: http://stackoverflow.com/comment/44170031
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/518000
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/63950581
has body: I am kind of confused with the logic of results which go from one task to the other task in async.auto. For example in the following code logic I added some data to models in task1, which is initially an output from initialtask and in finalTask added data to models from task1 is reflected in results.initialTask1 as well. Similarly added data in task2 is reflected in results.initialTask1 in finalTask. To sum up all of results.initialTask1, results.task1[0], results.task2[0], results.task3[0] are identical in finalTask. Is this the logic of async.auto? Or is it something like reference by pointer in C++ which causes whatever changes for models in task1, it reflects in models in initialTask as well? async.auto({ initialTask: function(callback) { //Do some operations callback(null, name, initialModels); }, task1: ['initialTask', function(callback, results) { var models = results.initialTask[1]; //Add some more data to models callback(null, models); }], task2: ['initialTask', function(callback, results) { var models = results.initialTask[1]; //Add some more data to models callback(null, models); }], task3: ['initialTask', function(callback, results) { var models = results.initialTask[1]; //Add some more data to models callback(null, models); }], finalTask: ['task1', 'task2', 'task3', function(callback, results) { //Here the followings are the same: results.initialTask[1], results.task1[0], results.task2[0], results.task3[0] }] }); I'm looking for any answer which helps me make sure that is the logic or not? I'm not necessarily looking for any official documents or ...
has title: Results of tasks in async.auto
tagged with: asynchronous
possible better answer: http://stackoverflow.com/a/43594686
favorite count: 0
has answer: http://stackoverflow.com/a/27884448
has answer: http://stackoverflow.com/a/43594686
score: 6
upvote count: 6
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27884448

http://stackoverflow.com/q/27953091
has comment: http://stackoverflow.com/comment/44301304
has comment: http://stackoverflow.com/comment/44301464
tagged with: javascript
has answer: http://stackoverflow.com/a/54243646
has title: How to display real-time data in a web browser?
has comment: http://stackoverflow.com/comment/44301606
has answer: http://stackoverflow.com/a/54243597
tagged with: google-maps-api-3
answer count: 3
tagged with: real-time
has comment: http://stackoverflow.com/comment/44301444
has comment: http://stackoverflow.com/comment/44301999
has comment: http://stackoverflow.com/comment/44304494
downvote count: 0
has comment: http://stackoverflow.com/comment/44301421
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/44301327
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44303555
score: 1
has body: I have been given a task to design an ASP.net web application that does the following: (1) A related mobile application will be used by associates around the city. As they use the mobile application, their GPS locations are sent to a server. (2) The web app must use Google Maps to draw a map of the city and display markers showing the location of each associate. It was suggested to me that the web application should automatically refresh the data every three minutes. However, I can't stop wondering why I'm stuck with a polling solution; this seems obsolete in the 21st century. As far as the communication between the browser and the web server, I know of two solutions. One is a long-running HTTP request kept open for the duration of the user's visit to the app. (Demo here: http://danielsadventure.info/webconsoledemo) The other is HTML5 Web Sockets. I think that either of the above solutions should be sufficient for streaming data from the server to the browser in near real-time. That being said, the data model of the web application is in MS SQL. I know of no way to make it so that the web server knows when the data model is updated without making the web server poll the SQL server. I suppose that one possible solution might be to get the associate locations from SQL when the web app loads and then when updates from associates come it, send them down to all connected web browsers at the same time that they are updated in SQL. That would entail having the thread that processing the incoming data from the associate automatically communicate with other threads that were sending location data to a browser and I don't know how to do that. Even then, I see myself having to poll one thread from another. What is a good way of accomplishing my client's request without having to resort to a polling solution? If a polling solution is necessary, how can I minimize the drawbacks to it? I know that there are solutions out there. Otherwise, how would GMail be able to tell you when …
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28079600

http://stackoverflow.com/comment/44306393
comment on: http://stackoverflow.com/q/27955648
score: 0
type: Comment
type: QuestionComment
has text: what exactly is broken about it?

http://stackoverflow.com/comment/112749838
has text: this approach will display the document text without background graphics, header , footer and other elements.for long files with different elements positioning saving as web page will ruin the design.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/33690480

http://stackoverflow.com/a/27883966
has comment: http://stackoverflow.com/comment/44170608
has comment: http://stackoverflow.com/comment/44169782
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/44170654
answers question: http://stackoverflow.com/q/27852631
has comment: http://stackoverflow.com/comment/44169876
has body: It can be done with Express framework, example: var express = require('express'), bodyParser = require('body-parser'), app = express(), port = 3000; app.use(bodyParser.json()); app.post('/', function (req, res) { var body = req.body; var trackingNumber = body.msg.tracking_number; var slug = body.msg.slug; var token = body.msg.unique_token; console.log(trackingNumber, slug, token); res.json({ message: 'ok got it!' }); }); var server = app.listen(port, function () { var host = server.address().address var port = server.address().port console.log('Example app listening at http://%s:%s', host, port) }); Here is the GIT repository, just clone it and do npm install and then npm start. The server will run on port 3000 :D Note: I saw in Aftership Webhook's documentation, it said they will request POST HTTP method, not PUT so I create an example of post request. Just replace it with put if you want it to catch put request.
type: Answer
has comment: http://stackoverflow.com/comment/44169936
has comment: http://stackoverflow.com/comment/44170143
upvote count: 4
has comment: http://stackoverflow.com/comment/44169749
has comment: http://stackoverflow.com/comment/44170713
has comment: http://stackoverflow.com/comment/44169915
has comment: http://stackoverflow.com/comment/44172524

http://stackoverflow.com/comment/44108516
type: Comment
score: 0
type: AnswerComment
has text: @Dr.Molle @maurice Sorry I made a mistake writing the comment above. What I would say is that I declared `var markerCluster = new MarkerClusterer(map)` before the loop, then I called `markerClusterer.addMarker(marker)` from inside the loop.
comment on: http://stackoverflow.com/a/27850912

http://stackoverflow.com/q/27850907
has comment: http://stackoverflow.com/comment/44109143
has comment: http://stackoverflow.com/comment/44106962
has comment: http://stackoverflow.com/comment/44106809
score: 0
has title: socket.io keeping track of number of clients
has body: In Socket.io for Node, I am a little confused how the number of clients are being tracked. In the demo offered by Socket.io, they have a global variable numUsers in their server.js and when a new client connects, client.js communicates with server.js and numUsers increments. However, how does numUsers keep track of the number of clients, even though its value is not stored in a database? When every unique user goes on the website, are the socket connections directed to one server, where they all can see the value of numUsers, instead of numUsers being set to 0 for every user going to the website? Thank you.
has comment: http://stackoverflow.com/comment/44107233
has comment: http://stackoverflow.com/comment/44107044
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44109525
tagged with: node.js
has comment: http://stackoverflow.com/comment/44107128
tagged with: socket.io
type: Question
has comment: http://stackoverflow.com/comment/44107303
tagged with: javascript

http://stackoverflow.com/comment/44150742
has text: oops. I just realized I did not save the fiddle for you.. one sec
comment on: http://stackoverflow.com/a/27873773
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27896909
has comment: http://stackoverflow.com/comment/44194762
has body: If you want to introduce &lt;br/&gt; into the text then you need to use ng-bind-html directive to output HTML, instead of {{value}}. Assuming the source of the button text is trusted (i.e. not originally coming from the user or another third party source), you'd need to use $sce service to "trust" the resulting value as HTML: $sce.trustAsHtml. Here's an example that puts &lt;br/&gt; instead of space: app.filter("break", function($sce){ return function(value){ if (!angular.isString(value)) return value; return $sce.trustAsHtml(value.split(" ").join("&lt;br/&gt;")); }; }); And this is the usage: &lt;button ng-bind-html="name | break"&gt;&lt;/button&gt; Plunker to illustrate
accepted answer of: http://stackoverflow.com/q/27896856
type: Answer
answers question: http://stackoverflow.com/q/27896856
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44195420

http://stackoverflow.com/comment/44295824
has text: that's exactly it. thank you
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27950300

http://stackoverflow.com/a/27931092
answers question: http://stackoverflow.com/q/27930094
has body: Couple issues: First, you need to ensure that you are selecting the correct form. $('form') will select all forms, and $('form')[0] will select the first one. You should instead target the correct form. $('.data-form')[0] Next, when sending FormData, you have to set processData and contentType to false so that jQuery will not attempt to process FormData. (this is done within $.ajax({...})) contentType: false, processData: false Note: ajax file uploading will not work on IE &lt; 10 It's also a good practice (at least while debugging) to use event.preventDefault instead of return false, and to do it at the top of the handler so that if any syntax errors occur, your form won't submit leaving you with no way of seeing the errors. See Preston S's answer for an example.
accepted answer of: http://stackoverflow.com/q/27930094
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/44274316
score: 0
has text: I used `document.getElementById("ext-gen15-gp-location-AMSTERDAM5999-bd").style.background = "red"`and that field did change its color.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27925655

http://stackoverflow.com/q/27962599
score: -1
tagged with: servlets
type: Question
has body: IN order to test couchbase, I am needing to create servlet that edit in 1.000 JSON documents row '"flag": false' to '"flag":true'. How i can do this? My view, that finds documents with row '"flag": false': function (doc, meta) { if (meta.type == "json" &amp;&amp; doc.flag == false) { emit(doc.flag, null); } } My servlet, that print results: doGet(.... View view = client.getView("des1", "flag"); Query query = new Query(); query.setIncludeDocs(true); ViewResponse result = client.query(view, query); for(ViewRow row : result) { resp.getWriter().println(row.getId()); } Sorry for my bad English)
has title: CouchBase Editing documents from code
tagged with: javascript
answer count: 1
downvote count: 1
favorite count: 0
tagged with: view
has answer: http://stackoverflow.com/a/27971338
type: UnansweredQuestion
tagged with: couchbase
upvote count: 0
tagged with: java

http://stackoverflow.com/comment/44161969
type: Comment
has text: In Firefox, the first function's `alert()` informs `2` (not 10). If in `test()` I change `x()` to `return(x())` I get *undefined*. So here, `x` is not assigned to the function value, it references the local `(var) x`, as proven by checking that the global `x==10` still after calling `test()`.
comment on: http://stackoverflow.com/a/27880098
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44412155
type: Comment
has text: An important detail I overlooked caused a couple hours of frustration. Thanks for the patience to look at this and the keen eye!
comment on: http://stackoverflow.com/a/27963456
type: AnswerComment
score: 0

http://stackoverflow.com/a/27941473
answers question: http://stackoverflow.com/q/27941401
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44279449
has comment: http://stackoverflow.com/comment/44279436
has comment: http://stackoverflow.com/comment/44279562
score: 1
has comment: http://stackoverflow.com/comment/44279470
has comment: http://stackoverflow.com/comment/44279945
has body: Your html element hasn't id. Hence you can't select using the document.getElementById. If you want to fix this, you have to add this id, like below: &lt;input type="hidden" name="mobilepage" id="mobilepage" value=""/&gt; If you don't want to add an id and you want to leave this element as is, the you should use another method for selecting your element, document.getElementByName. Below I have added a code snippet to see that it works. alert(document.getElementById("mobilepage").value); &lt;input type="hidden" name="mobilepage" id="mobilepage" value="3"/&gt;

http://stackoverflow.com/a/27922076
upvote count: 3
type: Answer
has body: PHP used to have split and join functions, but they were deprecated as being aliases for the much wider used explode and implode functions. RTM What you're trying to do can be done using implode, explode, and str_replace. The latter should replace any \r characters (seeing as they're optional). You then can explode the string using \n as delimiter, and implode it again using &lt;br&gt;. But that would mean calling 3 functions, which is a bit redundant considering there is a single function that does exactly what you need: nl2br return implode( '&lt;br/&gt;', //split on \n explode( "\n", //remove any \r chars str_replace( "\r", '', $s ) ) ); //The results are the same as this clean, simple one-liner return nl2br($s); Tl;tr use nl2br, it's as simple as that, and it'll do exactly what you want, with the least amount of effort required.
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/27921992

http://stackoverflow.com/comment/44103677
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27849329
has text: Just updated the demo link and tested. Should be working fine now.
type: Comment

http://stackoverflow.com/a/57069898
answers question: http://stackoverflow.com/q/27851473
score: 0
type: Answer
has body: I don't know if it's still actual but restarting forever will help.

http://stackoverflow.com/comment/44179685
has text: xhr.upload.addEventListener("progress", function(evt) { if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; //Do something with upload progress here } }, false); Reference: http://stackoverflow.com/questions/19126994/what-is-the-cleanest-way-to-get-the-progress-of-jquery-ajax-request
type: Comment
comment on: http://stackoverflow.com/q/27888637
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44221619
type: Comment
has text: Thanks! When I check the box it says the length is 7 and will increment by one each time a check a new box so if I change it to be `> 7` it works. Any idea why?
comment on: http://stackoverflow.com/a/27909509
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44032653
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27812582
has text: popup where?. i am not sure what you are asking
type: Comment

http://stackoverflow.com/a/27850160
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27849880
accepted answer of: http://stackoverflow.com/q/27849880
type: Answer
upvote count: 1
score: 1
has body: If all you're trying to do is convert your JSON into usable models, you can just loop through and convert it, e.g. TestApp.allContacts = {}; TestApp.instantiateObjects = function(){ var jsonUnstrung = JSON.parse(TestApp.jsonStrung); for (var i in jsonUnstrung) { var obj = new TestApp.Contact(jsonUnstrung[i].name, jsonUnstrung[i].age); TestApp.allContacts[i] = obj; } }; And you'll have instances for all of them with the same keys. When you work with those objects as a group, however, you shouldn't be accessing them by their key (unless you're modifying one specific one), but should be iterating over the entire set. This can be done if they're stored in JSON or Array form, and there are plenty of examples for each elsewhere. If you're working with a specific one, you should have access to the key/index to preform any replacement/removal you need at that time.

http://stackoverflow.com/a/27809340
has comment: http://stackoverflow.com/comment/44030576
type: AcceptedAnswer
downvote count: 0
has body: You code says: responseencoding=XML and: RESPONSE-DATA-FORMAT=XML XML is not JSONP. To process a response as JSONP, the server must format the response as JSONP. eBay's API may or may not support JSONP, but if it does, you have to ask for that and not for XML.
type: Answer
accepted answer of: http://stackoverflow.com/q/27808618
answers question: http://stackoverflow.com/q/27808618
upvote count: 1
score: 1

http://stackoverflow.com/q/27849306
downvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/44102802
has answer: http://stackoverflow.com/a/27849387
has answer: http://stackoverflow.com/a/27849436
has comment: http://stackoverflow.com/comment/44102627
upvote count: 0
has comment: http://stackoverflow.com/comment/44102651
has title: jQuery not loading in MAMP (1.11.2) when running website locally
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44103295
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27849436
favorite count: 0
has comment: http://stackoverflow.com/comment/44102593
has comment: http://stackoverflow.com/comment/44102595
type: Question
possible better answer: http://stackoverflow.com/a/27849385
has body: Firstly I apologise for the fact that this question has been asked many times before, however none of the answers solved my problem so I thought that I would ask the question here. I downloaded jQuery 1.11.2 (uncompressed) to locally develop my website however my code which worked using the jQuery built in to jsfiddle did not work locally. Therefore I added the following code to check if the jQuery had loaded: However I didn't get either alert box making me wonder if it was the Javascript which was not working, however I got Javascript to work using some simple form validation code. I am using MAMP to host the PHP and Google Chrome as the broswer. The file is saved as a HTML file and the code is as follows: I obviously can't use the Google hosted library as I am running the website locally. To determine the file path for the Javascript I opened it in Google Chrome.
score: -2
has answer: http://stackoverflow.com/a/27849385

http://stackoverflow.com/q/27911985
has answer: http://stackoverflow.com/a/27912283
type: AnsweredQuestion
has title: Javascript - Need to remove li element when clicked
has comment: http://stackoverflow.com/comment/44223978
score: -1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44223994
has comment: http://stackoverflow.com/comment/44224020
answer count: 1
has body: I need some assistance with an assignment I'm working on. Using JavaScript, I need to use the .target event property in my removeItem() function to remove li elements when they are clicked on. Can anyone help? My code is below. function Post(item) { this.item = item; this.print = function() { var s = this.item; return s; } } var postList = []; window.onload = init; function init() { var submitButton = document.getElementById("submitButton"); submitButton.onclick = getAddedItem; } function getAddedItem() { var itemInput = document.getElementById("item"); var item = itemInput.value; if (item == null || item == "") { alert("Please enter an item"); return; } else { var post = new Post(item); postList.push(post); addPostToList(post); var theForm = document.querySelector("form"); theForm.reset(); } function addPostToList(post) { var postList = document.querySelector("ul"); var li = document.createElement("li"); li.onclick = removeItem(li); postList.appendChild(li); li.innerHTML = post.print(); } }; function removeItem(li) { var test = document.getElementsByTagName("li"); for (i = 0; i < test.length; i++) { test[i].onclick = function() { var test = document.querySelector("li"); if (test) { var testParent = test.parentElement; testParent.removeChild(test); } } } } p { font-style:italic } li:hover { cursor:pointer } Add an item: Click an item to remove it from the list.
accepted answer: http://stackoverflow.com/a/27912283
downvote count: 2
has comment: http://stackoverflow.com/comment/44223582
upvote count: 1
has comment: http://stackoverflow.com/comment/44224023
tagged with: javascript
has comment: http://stackoverflow.com/comment/44223836

http://stackoverflow.com/a/27938139
score: 1
accepted answer of: http://stackoverflow.com/q/27937282
answers question: http://stackoverflow.com/q/27937282
type: Answer
has body: YOU NEED THIS. google.setOnLoadCallback(drawData); google.load("visualization", "1", {packages:["corechart"]}); function drawData(){ var dataArray ='Task', 'Hours per Day'; var arr1=['Work','Eat','Commute','Watch TV','Sleep']; var arr2=[11,2,2,2,7]; for(var n=0; n < arr2.length; n++) { dataArray.push([arr1[n], parseInt(arr2[n])]); } var data = new google.visualization.arrayToDataTable(dataArray); var options = { title: 'My Daily Activities' }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } google.setOnLoadCallback(drawData);
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44280165
type: Comment
has text: Which checkboxes do you want to mark as "checked" and why?
type: QuestionComment
comment on: http://stackoverflow.com/q/27942212
score: 0

http://stackoverflow.com/a/27864604
accepted answer of: http://stackoverflow.com/q/27862668
answers question: http://stackoverflow.com/q/27862668
has comment: http://stackoverflow.com/comment/44149557
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/129016135
has comment: http://stackoverflow.com/comment/44149409
has comment: http://stackoverflow.com/comment/44149465
type: Answer
downvote count: 0
score: 1
has body: The problem come from the shapes location. The shapes are drawn in the predefined location, and their size are all 310px. Therefore when you assign the mouse event position to the target object, it becomes far away from the pointer. In order to make it works on the current implementation, i created a position references for each shape. positionReference = {}; SHAPE_SIZE=310; var yRelCount = 1; for(var i = 1; i&lt; 17;i++) { xRel = i % 4 || 4; yRel = yRelCount; if (xRel === 4) { yRelCount++; } positionReference['p'+i] = { x: xRel * SHAPE_SIZE / 4, y: yRel * SHAPE_SIZE / 4 } } the positionReference is an object which has the name of shape as the key (eg: p1, p2, p3, ...), and position x and y as the value. later on in the dragging event, utilize the position reference so that the shape stick to the mouse pointer function pressMove(evt){ console.log('move') var target = evt.target; var ref = positionReference[target.name]; target.x= stage.mouseX-ref.x+(SHAPE_SIZE/8); target.y= stage.mouseY-ref.y+(SHAPE_SIZE/8); } you may realise i also added the SHAPE_SIZE/8, the purpose of this is to adjust the position so that the mouse pointer appear in the middle of the shape. the working example: http://jsfiddle.net/1yyn4904/1/

http://stackoverflow.com/a/27891599
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44188408
type: Answer
upvote count: 14
has body: Do resolves only work on controllers? Yes, resolves only work on controllers. And if that is the case, how can I use a resolve inside a factory / service? Remember that factories and services return singleton objects, i.e. the first time a factory is injected into a controller, it runs any instantiation code you provide and creates an object, and then any subsequent times that factory is instantiated, that same object is returned. In other words: angular.module('someModule') .factory( 'SomeFactory' , function () { // this code only runs once object = {} object.now = Date.now(); return object ); SomeFactory.now will be the current time the first time the factory is injected into a controller, but it not update on subsequent usage. As such, the concept of resolve for a factory doesn't really make sense. If you want to have a service that does something dynamically (which is obviously very common), you need to put the logic inside functions on the singleton. For example, in the code sample you gave, your factory depended on a model. One approach would be to inject the model into the controller using the resolve method you've already got set up, then expose a method on the singleton that accepts a model and does what you need to do, like so: angular.module('someModule') .factory( 'SomeFactory', function () { return { doSomethingWithModel: function (model) { $http.post('wherever', model); } }); .controller('SomeController', function (SomeFactory, model) { SomeFactory.doSomethingWithModel(model); }); Alternatively, if you don't need the resolved value in the controller at all, don't put it directly in a resolve, instead put the resolve logic into a method on the service's singleton and call that method inside the resolve, passing the result to the controller. It's hard to be more detailed with abstract conversation, so if you need further pointers then provide a specific use-case.
score: 14
accepted answer of: http://stackoverflow.com/q/27891121
answers question: http://stackoverflow.com/q/27891121

http://stackoverflow.com/q/27957645
score: 4
answer count: 2
possible better answer: http://stackoverflow.com/a/28388587
has answer: http://stackoverflow.com/a/27961439
has body: I need to read (extract) the current lookAt of a camera in the scene. I have seen the following post but I could not get the lookAt from camera. three.js set and read camera look vector Thank you for your help.
accepted answer: http://stackoverflow.com/a/27961439
favorite count: 0
tagged with: three.js
upvote count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: camera
has answer: http://stackoverflow.com/a/28388587
has title: Three.js - Find the current LookAt of a camera?
linked to: http://stackoverflow.com/q/15696963
type: Question
tagged with: javascript

http://stackoverflow.com/q/27876557
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44155097
tagged with: nvm
has answer: http://stackoverflow.com/a/32701484
has body: On my way setting up Node.js with NVM, I stumbled upon an error when using Yeoman. I got the error Cannot find module 'yeoman-generator' After some research I found this post on StackOverflow, which is also about my problem. Now I tried to do so, but the problem I have is, that I want to use different versions of Node.js over the system with the use of NVM. Now is it possible to change the $NODE_PATH dynamically, if the Node.js version changes with the help of NVM? Because my $NODE_PATH is empty at the moment (this is causing the problem). $ which node /Users/dschmidt/.nvm/v0.10.35/bin/node $ which npm /Users/dschmidt/.nvm/v0.10.35/bin/npm $ echo $NODE_PATH [empty] Would be glad about every answer I get about this. I searched the web for this, but could not find one post about this specifically.
type: Question
has comment: http://stackoverflow.com/comment/46743291
tagged with: javascript
score: 66
favorite count: 0
possible better answer: http://stackoverflow.com/a/34777308
linked to: http://stackoverflow.com/q/12594541
accepted answer: http://stackoverflow.com/a/49293370
has answer: http://stackoverflow.com/a/34777308
has answer: http://stackoverflow.com/a/78501520
has comment: http://stackoverflow.com/comment/44155340
tagged with: node.js
has comment: http://stackoverflow.com/comment/47479617
downvote count: 0
tagged with: npm
has answer: http://stackoverflow.com/a/49293370
answer count: 5
has title: Node.js - Configuring $NODE_PATH with NVM
has answer: http://stackoverflow.com/a/66801676
upvote count: 66
has comment: http://stackoverflow.com/comment/46751157

http://stackoverflow.com/q/27808610
has comment: http://stackoverflow.com/comment/44026198
has comment: http://stackoverflow.com/comment/44027284
favorite count: 0
has body: Note: I'm really interested in "large" arrays sizes that work for other people. This is not the first time I've wondered about this and welcome feedback. The scheme that I detail below requires development-effort towards that goal, so it's better to know going in whether I should eat the bandwidth and drop the idea, or whether this is a practical method for marginal gain on bandwidth. In other cases, for others who may be curious, or for future projects of mine, the gain may be larger. Usually when I encounter a situation where a large javascript dataset is an option, there are usually other options and I tend to favor other options. I'm not actually sure what qualifies as large or too-large. I'm wondering what safely works in production. I know that the theoretical limits but I can't find anything on the practical limits. As I detail below, my array is 14000 elemnts and 356k in size. I realize, of course, that javascript is client side and depends on the specs of the client machine, my code, and to some extent, the version of the browser (in cases where related internal performance improved between versions). Like any respectable modern website, it will have a mobile version as well and that's honestly where the memory concerns come in. I don't actually think that this size is too large or near it for reasonable specs expectations of client machines, but I could be wrong and this is something I've long wondered about and haven't found any good information on. (Further, of course, the answer to this question would be quite different than it was N years ago). Edit: I am aware of the 32-bit limitations on Array size, but I'm asking about what can work in healthy production and perform well. Background: I'm in the planning stages of a bible search engine. I have a copy of the King James Version of the Bible filled with citations. Some of the citations are quite lengthy and as I'll be serving this over the net, I decided to rewrite the citations to an indexed array of t…
has title: Practical limits on array size
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44027237
has comment: http://stackoverflow.com/comment/44026669
has answer: http://stackoverflow.com/a/27809031
has comment: http://stackoverflow.com/comment/44028065
score: 4
has comment: http://stackoverflow.com/comment/44026261
has comment: http://stackoverflow.com/comment/44026551
has comment: http://stackoverflow.com/comment/44026552
has comment: http://stackoverflow.com/comment/44026335
has comment: http://stackoverflow.com/comment/44026280
has comment: http://stackoverflow.com/comment/44026494
has comment: http://stackoverflow.com/comment/44026779
type: Question
upvote count: 4
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44026291
has comment: http://stackoverflow.com/comment/44026388
answer count: 1

http://stackoverflow.com/a/27882164
has body: If you're going to use jQuery, use jQuery: $("#menu_row").find('button').hover(function () { flipColor(this.id); }); function flipColor(btn_id) { $('#'+btn_id).find('img').prop('src', home_blue.src); }
has comment: http://stackoverflow.com/comment/44166233
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27882087
answers question: http://stackoverflow.com/q/27882087
score: 1
upvote count: 1

http://stackoverflow.com/a/27816774
has body: A large concept of angular is to avoid these kind of DOM bindings as 2-way data binding is already provided. I assume myStat2 is inside an angular scope so why not set a scope value in your view: &lt;div id="myStat2" data-dimension="104" data-text="{{ dataText }}" data-percent="{{ dataPercent }}"&gt;&lt;/div&gt; You can then change it directly in the $scope: $scope.dataPercent = time; $scope.dataText = parseInt(time); I don't really understand what you are trying to achieve however as this code seems pointless: time = $('#myStat2').attr('data-percent'); $('#myStat2').empty(); $('#myStat2').attr('data-percent', time); I would recommend getting a better understand of angular and then moving this chart into some kind of directive.
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27816666
has comment: http://stackoverflow.com/comment/44041060
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44041172
downvote count: 0
has comment: http://stackoverflow.com/comment/44040718
answers question: http://stackoverflow.com/q/27816666
has comment: http://stackoverflow.com/comment/44041194
has comment: http://stackoverflow.com/comment/44039802
type: Answer
has comment: http://stackoverflow.com/comment/44040987
score: 3

http://stackoverflow.com/a/27919709
has body: Go With This You can check the string in jquery like below.. First you must echo the variable in php page. then, $.ajax({ url: 'destination.php', type:'POST', data: {q:str} }).done(function( data) { if(data=="something") { window.location.assign("http://www.your_url.com"); // } }); return false; }
score: 0
accepted answer of: http://stackoverflow.com/q/27919645
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27919645
type: Answer

http://stackoverflow.com/a/27909505
downvote count: 0
upvote count: 38
answers question: http://stackoverflow.com/q/27908318
has comment: http://stackoverflow.com/comment/45625427
type: Answer
has comment: http://stackoverflow.com/comment/69429065
score: 38
has body: Looks like you can use the orderBychild() method to order by child key or property (i.e. weight, length, or date). And if you chain that using startAt() &amp; endAt(), we can construct the query you're looking for: var startDate = 14200000000; var endDate = 14300000000; ref.orderByChild("date").startAt(startDate).endAt(endDate) .on("child_added", function(snapshot){ console.log("got the data!", snapshot); });

http://stackoverflow.com/q/27933887
has body: I am trying to set some options of the angular-datepicker which is based on pickadate using results from a web-api call. So far my code is: Date: My js file: var ServiceBasePath = "http://localhost:29050/api/"; var app = angular.module('myproj', ['angular-datepicker', 'ngTouch']); app.controller('mycontroller', function ($scope, $http) { $scope.dpoptions = { format: 'ddd, dd-mm-yyyy', min: new Date(), max: _max } $http.get(ServiceBasePath + 'settings/1'). success(function (data) { _max = data.MaxDays; $scope.config.duration = data.Duration; }); } If I set the _max value on declaration, and leave the service results out, it works fine. I think the problem is that the service doesn't return before the datepicker loads, but it seems to work okay for another field (not with datepicker) I have: Duration (in minutes): How can I get the datepicker settings to load from the results of my $http.get?
score: 0
answer count: 1
has title: Set options from service call results in angular-datepicker (pickadate.js)
tagged with: asp.net-web-api
tagged with: angularjs
type: UnansweredQuestion
tagged with: datepicker
type: Question
has answer: http://stackoverflow.com/a/27934509
tagged with: pickadate
tagged with: javascript

http://stackoverflow.com/a/27943128
downvote count: 1
has body: This is what I would give to you as a direction, it updates only once a minute so if you don't see the progressbar moving wait for it :) Fiddle HTML &lt;div id="prbar"&gt;&lt;span id="fill"&gt;&lt;/span&gt; &lt;/div&gt;&lt;span id="showleftmin"&gt;&lt;/span&gt; CSS #prbar { width:100px; border:1px solid black; height: 10px; } #fill { width:0px; background: red; height: 10px; display:block; } Javascript var start = parseInt("2325", 0); //start time var end = parseInt("2350", 0); //end time var totalminutes = end - start; var incrementer = 100/totalminutes; var lengthprbar = 0; var minutesleft = totalminutes; var fill = document.getElementById('fill'); setInterval(function () { if (minutesleft === 0) { return; } lengthprbar += incrementer; fill.style.width = lengthprbar + 'px'; document.getElementById('showleftmin').innerHTML = minutesleft - 1; minutesleft--; }, 60000);
type: Answer
has comment: http://stackoverflow.com/comment/44284555
upvote count: 2
score: 1
answers question: http://stackoverflow.com/q/27942599
has comment: http://stackoverflow.com/comment/44286763

http://stackoverflow.com/a/27826389
type: AcceptedAnswer
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27826052
type: Answer
has comment: http://stackoverflow.com/comment/44065601
answers question: http://stackoverflow.com/q/27826052
score: 2
has body: Apparently, the caption property exists, but it seems to be null for some cases, and when you evaluate (null).text, you are getting the error detailed in your question. Add pictures[p].caption &amp;&amp; to evaluate for caption in your inner if. This should work for you (note that I also merge your two ifs and I did all evaluations in only one if): for(p in pictures) { if (pictures[p].hasOwnProperty('caption') &amp;&amp; pictures[p].caption &amp;&amp; pictures[p].caption.text != null) { captionString = pictures[p].caption.text; } }
has comment: http://stackoverflow.com/comment/44066494

http://stackoverflow.com/comment/44025743
comment on: http://stackoverflow.com/q/27808138
score: 0
has text: I figured it out! i opened up web inspector and saw that 2 variables didn't exist so it couldn't save. i deleted them and some more errors popped up! so now its fixed!
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27954171
has body: If you do the following, you can cut the time down by a lot. It spends 25ms to 45ms to update for me. use the production build implement shouldComponentUpdate update the state immutably updateCompletedState: function (event) { var isCompleted = event.target.checked; this.setState({data: _.extend({}, this.state.data, { completed: isCompleted }) }); this.props.completedCallback(isCompleted); }, shouldComponentUpdate: function(nextProps, nextState){ return nextState.data.completed !== this.state.data.completed; }, Updated fiddle (there are a lot of questionable things about this code, daniula points out some of them)
answers question: http://stackoverflow.com/q/27952901
has comment: http://stackoverflow.com/comment/44303697
type: Answer
has comment: http://stackoverflow.com/comment/44312721
score: 9
upvote count: 9
has comment: http://stackoverflow.com/comment/44319867
has comment: http://stackoverflow.com/comment/44311131
accepted answer of: http://stackoverflow.com/q/27952901
has comment: http://stackoverflow.com/comment/52191706
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44040672
type: Comment
type: QuestionComment
has text: '5' is a string and + is used for string concatenation, so when using + with a string it will concatenate
score: 0
comment on: http://stackoverflow.com/q/27817290

http://stackoverflow.com/comment/80167297
type: AnswerComment
comment on: http://stackoverflow.com/a/27846725
type: Comment
score: 6
has text: 2 years later and we now have Resize Observer in the browser which will allow you to watch for resize events on individual elements https://developers.google.com/web/updates/2016/10/resizeobserver

http://stackoverflow.com/a/27846779
answers question: http://stackoverflow.com/q/27845166
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27845166
type: Answer
score: 1
upvote count: 1
has body: Looking at the documentation, it appears that you can force Titles to serialize as an array, even if there is only one occurrence, by adding a json:Array='true' attribute (where the json namespace is http://james.newtonking.com/projects/json) to the &lt;Titles&gt; nodes. You could add the appropriate attributes using something like this: Dim doc As New XmlDocument() doc.LoadXml(ds.GetXml()) ' Add the namespace declaration to the root node Dim nsAttr = doc.CreateAttribute("xmlns", "json", "http://www.w3.org/2000/xmlns/") nsAttr.Value = "http://james.newtonking.com/projects/json" doc.DocumentElement.Attributes.Append(nsAttr) ' Add the json:Array attribute to each Titles element For Each title As XmlElement In doc.SelectNodes("//Titles") Dim attr = doc.CreateAttribute("json:Array", "http://james.newtonking.com/projects/json") attr.Value = "true" title.Attributes.Append(attr) Next Dim jsonText As String = JsonConvert.SerializeXmlNode(doc).Replace("null", """""").Replace("'", "'") Return jsonText

http://stackoverflow.com/comment/44192408
type: AnswerComment
type: Comment
has text: I understand what you mean, I'm bound to the current api so I can't do much. I will update my post to include this fact.
comment on: http://stackoverflow.com/a/27895777
score: 0

http://stackoverflow.com/comment/44250171
has text: Okay. I just realised that the template is loading but the custom class is not getting added. Any ideas why?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27924033
type: QuestionComment

http://stackoverflow.com/comment/44041305
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27817632
has text: Why are you trying to use `before` and `after` in JQ? just add class and define `before` and `after` in css!

http://stackoverflow.com/a/40489122
answers question: http://stackoverflow.com/q/27844087
type: Answer
has body: It seems that that the answers got outdated and I did not manage to use any of them to add the inline via gulp, so I opened webpack-dev-server.js and copied the method that does that to my gulp file and modified it a bit. It works (even though it's a bit nasty): function addInline(config, hot) { var devClient = [require.resolve("webpack-dev-server/client/") + "?http://localhost:8080"]; if (hot) { devClient.push("webpack/hot/dev-server"); } [].concat(config).forEach(function (config) { if (typeof config.entry === "object" &amp;&amp; !Array.isArray(config.entry)) { Object.keys(config.entry).forEach(function (key) { config.entry[key] = devClient.concat(config.entry[key]); }); } else { config.entry = devClient.concat(config.entry); } }); } You will need to pass the config in there before you pass it to webpack: var webpackDevelopmentConfig = require('./Source/config/webpack.config.development.js'); addInline(webpackDevelopmentConfig) var compiler = webpack(webpackDevelopmentConfig);
score: 0

http://stackoverflow.com/comment/44063739
type: QuestionComment
comment on: http://stackoverflow.com/q/27828832
score: 0
has text: Assuming the filter code you have works, just trigger the change event on the right select
type: Comment

http://stackoverflow.com/a/27818434
has comment: http://stackoverflow.com/comment/44043822
type: Answer
answers question: http://stackoverflow.com/q/27818001
accepted answer of: http://stackoverflow.com/q/27818001
has comment: http://stackoverflow.com/comment/44043944
has comment: http://stackoverflow.com/comment/44044239
has comment: http://stackoverflow.com/comment/44043327
type: AcceptedAnswer
has body: I think you can use hash in this case. In your link, you do something like that, using your content's id: Travel In your offer.aspx page, you look for the hash: $(document).ready(function() { var hash = window.location.hash.replace('#', ''); // Check if it has something if (hash != '') { showonlyone(hash); // Highlight the correct tab, triggering the event that does that :) var index = hash.replace('newboxes', ''); $('#myHeader' + index).trigger('click'); } });
has comment: http://stackoverflow.com/comment/44044207
score: 0

http://stackoverflow.com/comment/44189580
has text: Thank you for pointing me out this. I didn't know the existence of it. I'm guessing this will not get the abstract of an article given the DOI, right?
type: AnswerComment
comment on: http://stackoverflow.com/a/27873999
score: 0
type: Comment

http://stackoverflow.com/q/27813731
tagged with: internet-explorer
tagged with: internet-explorer-8
has answer: http://stackoverflow.com/a/27813829
has title: event.returnvalue=false is not working in firefox?
score: 2
tagged with: firefox
downvote count: 0
has body: I am working on an old application to make it compatible with firefox. As the old application does not uses Jquery I have to do all my stuffs using Javascript only. I have a input field for entering date.This field should only allow 0-9 numeric values. So I have modified the code like this for making it compatible with firefox. var event = window.event || ffEvent ; //ffEvent is the function argument var intKeyCode = event.keyCode || event.which; if (intKeyCode &lt; 48 || intKeyCode &gt; 57){ if(event.preventDefault){ event.preventDefault(); } else{ event.returnValue = false; } } But now the problem is event.returnValue = false allows keys like Backspace,Tab,Delete,Arrow buttons where as event.preventDefault() does not allow these buttons. One must allow these buttons for a input field. So is there any solutions for firefox which exactly behave same as event.returnValue=false
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27814122
upvote count: 2
answer count: 2

http://stackoverflow.com/comment/44285156
score: 1
comment on: http://stackoverflow.com/a/27944203
type: AnswerComment
has text: @SamJolly change it to `document.querySelectorAll("textarea")`
type: Comment

http://stackoverflow.com/comment/44047164
has text: This is not what I need because when I resize, the size of the applications are is shrinked to 25. It must shrink in steps, as soon as the content cannot be placed on a single line anymore.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27820718
type: Comment

http://stackoverflow.com/a/27850326
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27850253
answers question: http://stackoverflow.com/q/27850253
upvote count: 2
has body: The on() has to be bound to an element that already exists in the DOM when the page is loaded to delegate the event to the element that was added dynamically: $(document).on("change", $("input[type='text']"), function () { alert("here"); }); Instead of $(document) any static parent element can be used to delegate the event.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/27900489
has body: There is a severe vulnerability in you server side code. You should always clean strings which arise from user inputs using methods like htmlspecialchars. Replace : $_REQUEST['search_details'] and $_REQUEST['search_input'] With : htmlspecialchars($_REQUEST['search_details'], ENT_QUOTES, 'UTF-8') and htmlspecialchars($_REQUEST['search_input'], ENT_QUOTES, 'UTF-8') Not doing this can make your website vulnerable where a malicious user could include scripts to snoop on your users. What this function does is convert special characters like &lt; to html HTML character entities like &amp;lt; so that it can't be interpreted as code by the browser on the client side.
upvote count: 2
answers question: http://stackoverflow.com/q/27900159
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44201766
downvote count: 0

http://stackoverflow.com/comment/44162185
has text: How are you accessing the route `/audio_upload`?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27880171

http://stackoverflow.com/comment/44100086
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27848187
type: AnswerComment
has text: Technically, it's not necessary, as the ELSE will catch the "flag undefined" condition, and then inside it sets the flag variable for a subsequent run. (But I agree it's bad form, I usually set 'global' flags like this at the top of my doc somewhere.)

http://stackoverflow.com/comment/44122061
has text: You're absolutely right. I edited the post. However, this is not the point. I create new list elements and I need access to them on submit.
comment on: http://stackoverflow.com/a/27859762
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44177682
score: 1
comment on: http://stackoverflow.com/q/27888274
type: QuestionComment
type: Comment
has text: What about switch statements? Also repetitive, should we rule them out?

http://stackoverflow.com/comment/44314470
type: Comment
score: 1
has text: Sorry, It's unclear to me what you're asking...
type: QuestionComment
comment on: http://stackoverflow.com/q/27960409

http://stackoverflow.com/q/27924430
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27924912
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
tagged with: extjs
has title: ExtJs 5: Combobox with memory store not display data
has answer: http://stackoverflow.com/a/27924912
tagged with: extjs5
tagged with: combobox
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27924541
has body: In my project I have a memory store with local data for a combobox. I insert the data via store.loadData() but also tried store.loadRawData(). The data is in the store, but when I assign it to a combobox, no selection of items is possible. The combobox is empty. For example I have the following data var data = [ { name: 'Tom', age: 20 }, { name: 'Peter', age: 30 } ]; I configer the store with a memory proxy and fields. var store = Ext.create('Ext.data.Store', { fields: [ 'name', 'age' ], proxy: { type: 'memory', reader: { type: 'json' } } }); Somwhere in my application I load the data into it with store.loadRawData(data, false); Then I assign the store to a combobox, but no selection is possible. var combobox = Ext.create('Ext.form.field.ComboBox', { queryMode: 'local', typeAhead: true, forceSelection: true, valueField: 'name', store: store }); But when I iterate over the data of the store and log it to console, every data row is in there. store.each(function(record){ console.log('name in store: %s', record.get('name')); }); // In console: // name in store: Tom // name in store: Peter I use ExtJs 5.0.1 and a fiddle can be found at Sencha Fiddle. What am I missing here? Thank you for every suggestion and hint.
has answer: http://stackoverflow.com/a/27924541
score: 1

http://stackoverflow.com/comment/44051872
comment on: http://stackoverflow.com/a/27823019
score: 0
type: AnswerComment
type: Comment
has text: Thanks! What a simple solution. I'll accept as soon as SO allows it.

http://stackoverflow.com/a/27900069
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/27899987
answers question: http://stackoverflow.com/q/27899987
type: Answer
has body: You can add an extra div in the DOM (#intro), that covers the whole screen while the background image gets loaded: CSS: #intro { width: 100%; position: fixed; top: 0; bottom: 0; z-index: 100; background-color:#2f3255; } Then, when the page loads, just hide that div: $(window).load(function() { // You could add a time out here if you like (setTimeout(function() { $('#intro').fadeOut(); }, 500)) $('#intro').fadeOut(); });

http://stackoverflow.com/comment/44195561
type: QuestionComment
comment on: http://stackoverflow.com/q/27897428
has text: Have you checked out Beautifulsoup?
score: 0
type: Comment

http://stackoverflow.com/q/27951436
has body: Been reading some JavaScript tutorials and attempted to make a simple login system. I used the following code for this purpose. The alert line properly executes but redirection line doesn't seem to produce any results. Question: How can I make it work? What is wrong with the code? Note: I am aware that this is not a secure login system. I just need it to properly redirect when different conditions are met. I also tried different syntaxes for redirection line (removing quotes, parentheses, etc.). None of them seemed to work… in case this is just a syntax error. Code: &lt;form name="loginForm" onsubmit="loginCheck()" method="post"&gt; &lt;input type="text" name="userName"&gt;&lt;br&gt; &lt;input type="text" name="passWord"&gt;&lt;br&gt;&lt;br&gt; &lt;input type="submit" value="Login"&gt; &lt;/form&gt; &lt;script&gt; function loginCheck() { var usr=document.loginForm.userName.value; var psw=document.loginForm.passWord.value; var username="admin"; var password="admin"; if ((usr==username) &amp;&amp; (psw=password)) { alert ("True Info"); window.location.href ("http://www.google.com"); return true; } else { alert ("False Info"); window.location.href ("http://www.google.com"); return false; } } &lt;/script&gt;
linked to: http://stackoverflow.com/q/503093
tagged with: authentication
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44298072
tagged with: javascript
has answer: http://stackoverflow.com/a/27951481
has answer: http://stackoverflow.com/a/27951484
score: 0
answer count: 3
favorite count: 0
tagged with: system
has title: Javascript - Simple Login Redirection
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44298097
has answer: http://stackoverflow.com/a/27951514

http://stackoverflow.com/comment/44260401
type: QuestionComment
type: Comment
has text: Before the `if` add `console.log("start: " + strtDt + " end: " + endDt);` and make sure they look OK.
comment on: http://stackoverflow.com/q/27931432
score: 0

http://stackoverflow.com/comment/44132966
comment on: http://stackoverflow.com/q/27865209
score: 0
has text: @SimonStaton how so? How is it any less secure then another page?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27960217
answers question: http://stackoverflow.com/q/27947152
accepted answer of: http://stackoverflow.com/q/27947152
type: Answer
score: 1
upvote count: 1
has body: It's working now :) I've used to the scripts from Kendo CDN as mentioned here: https://github.com/telerik/kendo-ui-core/#using-kendo-ui-core-via-the-kendo-static-cdn instead of those from the pre-configured zip package downloaded. or if you are using bower, so just use "bower install kendo-ui-core -save" as mentioned here: https://github.com/kendo-labs/bower-kendo-ui#about-kendo-ui-core and then the scripts includes from CDN (mentioned above) are even not needed anymore, so just remove them, because everything will be managed by bower so they will be installed and included.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27964020
type: UnansweredQuestion
tagged with: submit
answer count: 0
tagged with: addition
upvote count: 1
type: Question
tagged with: forms
tagged with: class
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has title: Adding class to display hidden div on button click
has body: I have a class added to a div to change from display: none; to display: block on the press of a button, before the site submits the form. I'm using this: $('#save-btn').click(function() { var errors = true; if ($.trim($('#text-text').val()).length == 0) { errors = false; $('#text-text').addClass('error'); $('.title-help').html('&lt;?php echo Yii::t('yii', 'Please add some text to your image!') ?&gt;').removeClass('hide'); $("html, body").animate({scrollTop: $('#text-text').offset().top - 100}, 400); } if (errors) { var $btn = $(this); fbLogin(function(){ canvas.deactivateAll(); canvas.renderAll(); $("#loadingDiv").addClass("appear"); $('#img-data').val(canvas.toDataURL()); $btn.closest('form').submit(); }); } return false; }); What I want to happen is the "appear" class to be added to the #loadingDiv, and the class is being loaded fine, however the form is being submitted instantly, so even though the class is being added to the div, it's not picking up the styles from the CSS in time... How can I achieve this? Any help much appreciated... Site can be seen here Cheers, Matt

http://stackoverflow.com/a/27827474
answers question: http://stackoverflow.com/q/27827175
downvote count: 0
has comment: http://stackoverflow.com/comment/44087529
score: 1
has body: You can use document.querySelectorAll('h2:nth-child(1) ul li:nth-child(2)') for example.
type: Answer
has comment: http://stackoverflow.com/comment/44062402
upvote count: 1

http://stackoverflow.com/comment/44298883
score: 0
type: AnswerComment
has text: $(this).parent() also produces no response
type: Comment
comment on: http://stackoverflow.com/a/27951792

http://stackoverflow.com/comment/44292539
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27911500
has text: To get the placement right for the second one, you have to make sure that the anchor is closed like `id="1">` exactly, not `id="1" >` or anything like that, any extra characters after the `id` will mess up the index. You could also try to find the position of the first `>` after the position of the `id` which would tell you right where the content of the anchor begins every time. My example was a little crude because it just adds 7 to the index of the id, which would account for all of these characters: "> which appear after the id and are not included in the anchors content
score: 0

http://stackoverflow.com/q/27846474
has comment: http://stackoverflow.com/comment/44096982
score: 15
possible better answer: http://stackoverflow.com/a/27846671
upvote count: 15
has answer: http://stackoverflow.com/a/27846671
has body: I have a question about the new tab for the link. Is there anyway I can set the browser tab title before user clicks a link? It seems like there is no way to debate the title for the new tab if the html contained in the new tab doesn't have title attribute. Am I right? How do I set the title? //the href is dynamic so I can't set them one by one because I have 100+ html file here &lt;a href="test.html" target="_blank"&gt;open me&lt;a&gt;
downvote count: 0
answer count: 7
tagged with: javascript
has answer: http://stackoverflow.com/a/27846892
has comment: http://stackoverflow.com/comment/44096859
has comment: http://stackoverflow.com/comment/44096916
has comment: http://stackoverflow.com/comment/44096803
favorite count: 0
accepted answer: http://stackoverflow.com/a/27847006
has comment: http://stackoverflow.com/comment/44096922
has answer: http://stackoverflow.com/a/27847976
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: How to set the title for the new browser tab?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44096996
has answer: http://stackoverflow.com/a/67508481
has answer: http://stackoverflow.com/a/27846633
has comment: http://stackoverflow.com/comment/44097125
has answer: http://stackoverflow.com/a/52371516
has comment: http://stackoverflow.com/comment/44096865
type: Question
has comment: http://stackoverflow.com/comment/44096964
has answer: http://stackoverflow.com/a/27847006
has comment: http://stackoverflow.com/comment/44096895

http://stackoverflow.com/q/27825845
linked to: http://stackoverflow.com/q/1357118
has answer: http://stackoverflow.com/a/27826537
downvote count: 3
has body: I am trying to prevent the page from refreshing when the "replayclick" is clicked. Id like it to just run the set time in and out for the "#cmp" elements. I am sure its something simple I am missing. $("#replayclick").click(function(event) { event.preventDefault(); setTimeout(function () { $("#replay").fadeOut(); }, 0); setTimeout(function () { $("#cmp1").fadeIn(); }, 0); setTimeout(function () { $("#cmp1").hide(); }, 2000); setTimeout(function () { $("#cmp2").fadeIn(); }, 2000); setTimeout(function () { $("#cmp2").hide(); }, 4000); setTimeout(function () { $("#cmp3").fadeIn(); }, 4000); setTimeout(function () { $("#cmp3").hide(); }, 6000); setTimeout(function () { $("#cmp4").fadeIn(); }, 6000); setTimeout(function () { $("#cmp4").hide(); },8000); setTimeout(function () { $("#replay").fadeIn(); }, 8000); }); HTML
has comment: http://stackoverflow.com/comment/44057543
type: Question
score: -2
has title: Jquery Prevent reload click function
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44058272
has comment: http://stackoverflow.com/comment/44057855
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44057547
has comment: http://stackoverflow.com/comment/44057566
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44058298
upvote count: 1

http://stackoverflow.com/a/27850828
has body: Personally, I think there's no rule about this, but the great Nicholas Zakas, in his book Maintainable JavaScript, tells that if you want to have a function easy to test and maintain, you never have to declare the event as follows: function myFunction(event) {} Instead, you'd have to declare the arguments that the function needs: function myFunction(clientX, clientY) {} And when you call the function, you must pass the arguments from the object event: // This won't work on IE8 and older versions. element.addEventListener('click', function(event) { myFunction(event.clientX, event.clientY); }, false); When you or another guy from your team have to test this function, s/he doesn't need to emulate any event.
answers question: http://stackoverflow.com/q/27850756
has comment: http://stackoverflow.com/comment/44106048
has comment: http://stackoverflow.com/comment/44106407
has comment: http://stackoverflow.com/comment/44105920
score: 0
type: Answer

http://stackoverflow.com/q/27960682
score: 39
has comment: http://stackoverflow.com/comment/44629049
has title: What is this code construct wrapping the parts of a library and what is it useful for?
upvote count: 49
possible better answer: http://stackoverflow.com/a/27960828
has answer: http://stackoverflow.com/a/27963704
downvote count: 10
favorite count: 0
has body: I imitated a library and was able to write following code. This code created 'c' object to which 'a' function is assigned. So, to call 'a', I will have to write c.a(). Also, I was able to add more functions to this 'c' object. I want to understand what is happening in this code. It doesn't look like normal object oriented programming. What is this type of javascript programming called? var c = (function(c) { if (c === undefined) { c = {}; } function a() { alert(1); } c.a = a; return c; }(c));
has answer: http://stackoverflow.com/a/27960777
accepted answer: http://stackoverflow.com/a/27960777
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27960835
has answer: http://stackoverflow.com/a/27960828
type: Question
has answer: http://stackoverflow.com/a/27973464
linked to: http://stackoverflow.com/q/18420992
has comment: http://stackoverflow.com/comment/44341833
has comment: http://stackoverflow.com/comment/44501427
tagged with: javascript
answer count: 6
tagged with: module-pattern
has comment: http://stackoverflow.com/comment/44356959
has answer: http://stackoverflow.com/a/27960846

http://stackoverflow.com/comment/44103017
comment on: http://stackoverflow.com/a/27849349
score: 0
type: AnswerComment
type: Comment
has text: does this prevent links inside the menu from working? according to **[this](http://stackoverflow.com/questions/1403615/use-jquery-to-hide-a-div-when-the-user-clicks-outside-of-it)** the jquery equivalent doesn't work.

http://stackoverflow.com/a/27877228
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/27877120
type: Answer
has body: your answer http://jsfiddle.net/mb6o4yd1/6/ My Modal var myApp = angular.module('myApp',['ngDialog']); //myApp.directive('myDirective', function() {}); //myApp.factory('myService', function() {}); function MyCtrl($scope, ngDialog) { $scope.clickToOpen = function () { ngDialog.open({ template: 'templateId' }); }; } function tt($scope) { $scope.test = function() { console.log("AaA"); } }
answers question: http://stackoverflow.com/q/27877120

http://stackoverflow.com/comment/44232552
comment on: http://stackoverflow.com/q/27917076
type: Comment
score: 0
has text: The drop down is generated from my mySQL database. I would like a button or a link to change depending on what store is selected. Here is my table: http://i.imgur.com/jSoZ2w5.png
type: QuestionComment

http://stackoverflow.com/q/27894900
tagged with: css
has title: the easiest way to change SVG icons in a span/div on hover?
type: AnsweredQuestion
has body: I have a Bootstrap website with a navigation like this: Messages And the icons are all named like this: I already got the 'Messages' part to change colors with CSS, but I also need to make the .SVG icons to change from "-grey" to "-blue" whenever someone hovers over the linked DIV. How would I achieve this? Possibly with CSS and if not, jQuery?
type: Question
has answer: http://stackoverflow.com/a/27895463
answer count: 2
possible better answer: http://stackoverflow.com/a/27894932
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27894932
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27895463
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/a/27827541
has body: If you don't want to rely on the ID names matching other element names, you can use an object as a map to specify actions. //using a map lets you easily add or remove cases without duplicating code, and doesn't require you to use standardized names for your elements and events. var action_map = {temperature_event:{show:"#poplist_temp", hide:".temperature-params", remove:"#temperature_event" }, load_event:{show:"#poplist_load", hide:".load-params", remove:"#load_event", }, price_event:{show:"#poplist_price", hide:".price-params", remove:"#price_event", }, duty_event:{show:"#poplist_duty", hide:".duty-params", remove:"#duty_event" }, default_event:{show:"#poplist_program", hide:".program-params", remove:"#duty_event", } }; $("#btn_remove_event_type").click(function() { var selectedId = $(".selected-type").attr("id"); if (!action_map[selectedId]) selectedId = "default_event"; $(action_map[selectedId].show).show(); $(action_map[selectedId].hide).hide(); $(action_map[selectedId].remove).remove(); } });
type: Answer
has comment: http://stackoverflow.com/comment/44062889
answers question: http://stackoverflow.com/q/27827216
score: 0

http://stackoverflow.com/q/27957710
has answer: http://stackoverflow.com/a/27958394
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44309895
type: Question
has comment: http://stackoverflow.com/comment/44309954
has title: How to properly insert tag into html with javascript?
has comment: http://stackoverflow.com/comment/44309772
has body: I'm just getting started here with javascript and have made this. I have made a codepen that shows the two issues I am having 1) there are two duplicate videos being loaded in, when I delete one of the video tags it prevents the randomize button from working or any video from loading up. I am only trying to have one video load in. 2) In the codepen I have a button that clicks to randomize but instead I am trying to have the video wrapped with an tag so that the video can be clicked to initiate the randomize. Whenever I try and do this I get an undefined error or the videos will not load in =/ Play video Your browser does not support the video element. If you click on the codepen you will hopefully be able to see where the two videos are being loaded in and where the click tag is. Any help is greatly appreciated!! I've been trying to figure it out all night :/ Here is the codepen Codepen Thanks in advance!
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44310670
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44309809
has answer: http://stackoverflow.com/a/27958334
favorite count: 0
has comment: http://stackoverflow.com/comment/44309680
has comment: http://stackoverflow.com/comment/44310337
has comment: http://stackoverflow.com/comment/44310158
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44310025
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44309703

http://stackoverflow.com/q/27848001
type: Question
has comment: http://stackoverflow.com/comment/45988083
has comment: http://stackoverflow.com/comment/44894723
tagged with: firefox
downvote count: 0
favorite count: 0
has body: I recently read about the solution for these protractor issues: Unable to easily pass context to addMockModule #695 feat(addMockModule): add third parameter to pass context #787 I have been eager to DRY up my protractor tests and this was the solution I needed. This solution is working great with ChromeDriver, but with FirefoxDriver it's oddly broken. Here's my code (in a beforeEach() block: var httpBackendMock = function() { angular.module('httpBackendMock', ['ngMockE2E']) .value('mockData', arguments[0]) .run(function ($httpBackend, mockData) { $httpBackend.whenGET(/.*aggregates/) .respond(200, mockData.testAggregates); $httpBackend.whenGET(/.*merchants\/123456/) .respond(200, mockData.testMerchant); }); }; browser.addMockModule('httpBackendMock', httpBackendMock, { testAggregates: testAggregates, testMerchant: testMerchant }); (testAggregates and testMerchant are defined previously.) This works perfectly in Chrome, but in Firefox when the whenGET expectations fire they return no data. It fails whether I use the mockData object or directly use arguments[0]. But it gets weirder. If I try to inspect the mockData module value I created above in a later browser.executeScript() call, the data is there, and console.log renders it the same way in both Chrome and Firefox. browser.get('index.html#/experiments'); browser.executeScript(function() { return angular.injector(["httpBackendMock"]).get('mockData'); }).then(function(data) { console.log("DATA", data); }); When the test runs the data shows up as expected. The only workaround for this I have found is to JSON.stringify() the input to addMockModule() and JSON.parse() it inside. It seems to work, but is ugly - the framework should already be taking care of it. So I think this is a bug, but I'm really not sure which component this is a bug in.
tagged with: angularjs
score: 3
has comment: http://stackoverflow.com/comment/60901352
answer count: 0
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44962011
tagged with: protractor
has title: Protractor `addMockModule()` with arguments not handling structured data properly in Firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/60813941

http://stackoverflow.com/q/27813464
type: Question
tagged with: function
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/27814308
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/27814768
accepted answer: http://stackoverflow.com/a/27814897
type: AnsweredQuestion
has title: How can I dynamically generate input fields with Javascript and then use their values?
has answer: http://stackoverflow.com/a/27814897
has answer: http://stackoverflow.com/a/27814768
tagged with: forms
has body: I'd like to be able to find the number value of the courseAmount input field upon submit, and then generate new input fields (into the hourForm form underneath the initialForm) through the onsubmit method in javascript, and then retrieve the value from each of the generated input fields upon the submission of the hourForm form and place those values into an array. However, I'm having difficulty with actually generating the input fields with javascript, and I suspect that I'm having difficulty with retrieving the value of the courseAmount input and porting that to my createInput() function, but I'm not exactly sure if that's the issue. Here's my HTML: Number of hours for which you would like to study Number of courses you would like to study for State the desired time spent working in each course And here's my Javascript: var notedOverallHours = document.getElementById("overallHours").value * 60; var courseNumberTotal = document.getElementById("courseAmount").value; var counter = 0; function createInput() { var newForm = document.getElementById("hourForm"); document.getElementById("initialForm").style.display = "none"; document.getElementById("hourForm").style.display = "block"; for (i = 0; i <= courseNumberTotal; i++) { newForm.innerHTML = " Course #" + (counter + 1) + " " + " "; counter++; } newForm.innerHTML = " "; } Can someone help me figure this Javascript out? My JSFiddle attempts have been futile because JSFiddle does not take kindly to forms reloading the page. Thank you!

http://stackoverflow.com/q/27812749
answer count: 3
has body: My code is: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="change"/> The error I get is: CS1061: 'ASP.webform1_aspx' does not contain a definition for 'change' and no extension method 'change' accepting a first argument of type 'ASP.webform1_aspx' could be found. What is the problem?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27812758
has answer: http://stackoverflow.com/a/27812782
has answer: http://stackoverflow.com/a/27812819
accepted answer: http://stackoverflow.com/a/27812819
type: Question
has title: Calling a Javascript function from ASP.NET
tagged with: javascript
tagged with: asp.net
score: 0
possible better answer: http://stackoverflow.com/a/27812758

http://stackoverflow.com/q/27923253
tagged with: javascript
has comment: http://stackoverflow.com/comment/44243549
has comment: http://stackoverflow.com/comment/44244726
answer count: 1
downvote count: 0
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/44244669
has comment: http://stackoverflow.com/comment/44248093
linked to: http://stackoverflow.com/q/16550356
has body: Say the following statements have been executed, in this order: promiseA.then(function() { console.log('A1'); }); promiseB.then(function() { console.log('B'); }); promiseA.then(function() { console.log('A2'); }); Now promiseA is fullfilled followed by promiseB. Is it defined in the spec (is this the latest spec?) in which order the three callbacks are triggered? Will A1 always be triggered before A2? (Update: Yes, per 2.2.6.1 from this spec, as pointed to from this answer.) Will A1/A2 always be triggered before B (since A was fulfilled before B)?
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/44246023
has title: In what order are Promise callbacks triggered?
upvote count: 3
has comment: http://stackoverflow.com/comment/44243862
type: Question
has answer: http://stackoverflow.com/a/27925561
has comment: http://stackoverflow.com/comment/44244879
accepted answer: http://stackoverflow.com/a/27925561

http://stackoverflow.com/comment/44063782
comment on: http://stackoverflow.com/q/27828804
has text: `'http://example.com/?n=%%';` - this literal alone breaks it. Leave `http` aside, and it works ok. Wow.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44306059
comment on: http://stackoverflow.com/q/27955533
score: 0
type: Comment
has text: so that you can use the variable to reference the object returned. `a.someMethodOfA();` for instance.
type: QuestionComment

http://stackoverflow.com/a/27859318
has body: There actually was (still is) a syntax designed for this exact purpose or not having to type the selector twice or save it into a variable but people don't use it because it has a lot of other issues: with(document.querySelector('.wrap')){ // don't actually do this :D style.height = lato; style.width = lato; // ... all other changes } That's very frowned upon though, idiomatic DOM manipulation would simply cache it into a variable and call it twice saying explicitness is good here.
answers question: http://stackoverflow.com/q/27859161
has comment: http://stackoverflow.com/comment/44121633
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44121416
has comment: http://stackoverflow.com/comment/44121390
downvote count: 0
has comment: http://stackoverflow.com/comment/44121607

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/27836262
tags question: http://stackoverflow.com/q/27939682
tags question: http://stackoverflow.com/q/27894322
tags question: http://stackoverflow.com/q/27929742
tags question: http://stackoverflow.com/q/27894900
tags question: http://stackoverflow.com/q/27838938
tags question: http://stackoverflow.com/q/27818936
tags question: http://stackoverflow.com/q/27821895
tags question: http://stackoverflow.com/q/27856670
tags question: http://stackoverflow.com/q/27826200
tags question: http://stackoverflow.com/q/27821067
tags question: http://stackoverflow.com/q/27856721
tags question: http://stackoverflow.com/q/27899177
tags question: http://stackoverflow.com/q/27840296
tags question: http://stackoverflow.com/q/27844732
tags question: http://stackoverflow.com/q/27946042
tags question: http://stackoverflow.com/q/27913266
tags question: http://stackoverflow.com/q/27951560
tag name: svg
tags question: http://stackoverflow.com/q/27926501
tags question: http://stackoverflow.com/q/27915100
tags question: http://stackoverflow.com/q/27873075
tags question: http://stackoverflow.com/q/27900260
tags question: http://stackoverflow.com/q/27862465
tags question: http://stackoverflow.com/q/27962996
tags question: http://stackoverflow.com/q/27948312
tags question: http://stackoverflow.com/q/27938902
tags question: http://stackoverflow.com/q/27959610
tags question: http://stackoverflow.com/q/27892200
tags question: http://stackoverflow.com/q/27901675
tags question: http://stackoverflow.com/q/27963400
tags question: http://stackoverflow.com/q/27854302
tags question: http://stackoverflow.com/q/27925596
tags question: http://stackoverflow.com/q/27806132
tags question: http://stackoverflow.com/q/27883455
tags question: http://stackoverflow.com/q/27827981
tags question: http://stackoverflow.com/q/27942575
tags question: http://stackoverflow.com/q/27854409
tags question: http://stackoverflow.com/q/27880534
tags question: http://stackoverflow.com/q/27900771
tags question: http://stackoverflow.com/q/27876078
tags question: http://stackoverflow.com/q/27848597
tags question: http://stackoverflow.com/q/27844884
tags question: http://stackoverflow.com/q/27940335
tags question: http://stackoverflow.com/q/27903004
tags question: http://stackoverflow.com/q/27845161
tags question: http://stackoverflow.com/q/27804203
tags question: http://stackoverflow.com/q/27962154
tags question: http://stackoverflow.com/q/27949573
type: Tag

http://stackoverflow.com/a/27955369
has comment: http://stackoverflow.com/comment/44307661
has comment: http://stackoverflow.com/comment/44309447
has comment: http://stackoverflow.com/comment/44307199
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27932434
upvote count: 1
answers question: http://stackoverflow.com/q/27932434
has body: Queries on tables is fine, but you can't use the each() function, as that is restricted to only work in background jobs. You'll have to use find() or first() or get() depending on your needs. UPDATE OK, after seeing your full code I have some ideas as to why it isn't working. First off you're sending res.send("Success"); before you're finished, I'm not positive but I think this causes it to stop running the rest of your code (haven't checked, could be wrong). Also you're doing multiple async operations without chaining them so the contactQuery.first() will run before the twilio.sendSMS() is finished. Inside twilio.sendSMS() you're calling response.success() / response.error(). These are for cloud methods, not web hooks, so I expect these would be throwing errors server-side (check the logs on the Dashboard). Inside contactQuery.first() you are using alert() which isn't supported in cloud code. I'm not sure if those mistakes will be caught early and throw errors or if they'll raise run-time exceptions, but they should be fixed, your code re-deployed and try again. Then report any errors in the server logs.
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44144940
has text: for files you need to look into $_FILES and for the rest in $_POST - after all is done you should return the json structure - if you use some framework etc. normally you return a structure from controller/function if you just have a small script echo json_encode({"result" => "ok"}) or whatever you need
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27870973
type: AnswerComment

http://stackoverflow.com/comment/44625295
type: Comment
has text: The issue was with the image url.In our case image url contains "https" as its scheme name due to which it was showing the Unknown Exception.so by changing the scheme to "http" resolved the issue.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27941416

http://stackoverflow.com/q/27938895
has title: Save file from javascript and set custom name
has body: I wonder is there a way to override save file dialogue, while saving file in javascript. I have a file (html or text or image) that is saved in localstorage. I would like to download it, but to set its download name to whatever I need. Right now it works, but it defaults to download (name) and file type (all). This is the code that allows me to selectively pick whatever I need from local storage, but as I described above I have issue with name. I can't use server for this, as this is standalone Backbone project. var base64 = window.btoa(this.model.get("filecontent")), fileDownLoadInformation; fileDownLoadInformation = "Download" //All file type have these options extraOptions = " " + fileDownLoadInformation + " "; //etc...
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: local-storage
has answer: http://stackoverflow.com/a/27939317
type: Question

http://stackoverflow.com/a/27950366
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27950354
downvote count: 0
type: Answer
has body: = is only setting the value you need == if (transdec==3) {$(".atrans").html("NOT PUBLISHED");} else {$(".atransaction").html("PUBLISHED");} if (transdec==0) {$(".atransaction").html("in LISTINGS.");} if (transdec==1) {$(".atransaction").html("in RECENT TRANSACTIONS");} if (transdec==2)....

http://stackoverflow.com/comment/44046540
score: 0
type: Comment
type: QuestionComment
has text: have tried enabling cors from webapiconfig file?
comment on: http://stackoverflow.com/q/27820404

http://stackoverflow.com/q/27895365
answer count: 4
has answer: http://stackoverflow.com/a/27895446
has comment: http://stackoverflow.com/comment/44191845
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44192087
has answer: http://stackoverflow.com/a/27895461
has comment: http://stackoverflow.com/comment/44191729
has answer: http://stackoverflow.com/a/27895637
type: Question
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27895440
has answer: http://stackoverflow.com/a/27895440
has title: Is it good practice to add properties on array in javascript
downvote count: 1
has body: Array is an Object in JavaScript so Can/Should we store custom properties on it ? When we use an array, most of the times we need to maintain the current pointer/current index for the array. I see two implementations for that: Implementation 1 var myArray = [2, 4 ,6, 8, 10], var myArray_top = 0; Implementation 2 var myArray = [2, 4 ,6, 8, 10], myArray.top = 0; // Notice I have added top as property of array Pros of #2 I do not need to maintain multiple variables for each of my array. Code looks more readable Cons of #2 If I pass the array to a method and that method may manipulate the contents and return a new array with the contents. In that case I might lose the value of "top" outside the function. Which of the two is more better approach ?
favorite count: 0
score: 8
upvote count: 9
accepted answer: http://stackoverflow.com/a/27895637

http://stackoverflow.com/comment/97907342
type: Comment
score: 1
has text: this looks appropriate way for inapp webviews. google sign in API with popup has issues with webview when popup tries to close itself and return callback to original window.
type: AnswerComment
comment on: http://stackoverflow.com/a/47702334

http://stackoverflow.com/comment/44166385
type: Comment
has text: no.. that has no bearing on the element that is raising the event. you're attaching an event to each element in the nodelist.. the e.target will be the element that raises the event
comment on: http://stackoverflow.com/a/27882286
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44220844
has text: @atmd Not true. Multiplication implies both sides are numbers so javascript implicitly converts them. Try it
type: QuestionComment
comment on: http://stackoverflow.com/q/27901561
score: 0
type: Comment

http://stackoverflow.com/a/27858105
score: 0
has comment: http://stackoverflow.com/comment/44120761
has comment: http://stackoverflow.com/comment/44121406
has comment: http://stackoverflow.com/comment/44121111
has comment: http://stackoverflow.com/comment/44122482
has comment: http://stackoverflow.com/comment/44122722
type: Answer
has comment: http://stackoverflow.com/comment/44122455
has comment: http://stackoverflow.com/comment/44121605
has comment: http://stackoverflow.com/comment/44121060
answers question: http://stackoverflow.com/q/27854459
has body: The algorithm is very simple: You have an array of banknote and coin denominations, sorted in descending order. Look at the denominations in that order and see how many coins of that denomination you have to give out. Reduce the leftover change accordingly. Here's one implementation that returns a dictionary whose keys are the denominations and whose values indicate how many items of that denomnation are included in the change. Items ehose value is zero are not included in the dictionary: function change(amount, coins) { var res = {}; for (var i = 0; amount &gt; 0 &amp;&amp; i &lt; coins.length; i++) { var value = coins[i]; if (value &lt;= amount) { res[value] = Math.floor(amount / value); amount -= value * res[value]; } } return res; } For example: c = change(431, [5000, 2000, 1000, 500, 200, 50, 20, 10, 5, 2, 1]); // c == { 1: 1, 10: 1, 20: 1, 200: 2 } Note how the coin denominations are given in cents throughout. If you use the more natural-seeming dollar representation, you'll get floating-point numbers and you may run into rounding issues. (Numbers in Javascript are floating-point numbers, but if they represent integers in a certain range, which should suffice for your problem, they are accurate.)

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/27834630
tags question: http://stackoverflow.com/q/27905780
tag name: google-oauth

http://stackoverflow.com/q/27838027
favorite count: 0
has answer: http://stackoverflow.com/a/28056116
tagged with: angularjs
type: Question
has body: I want to sort a column of true/false checkboxes in a table with AngularJs (i.e. show all empty checkboxes first and vice versa). The checkboxes are bound to a model and the checkmarks show up accordingly, but I am not able to sort the column. Is it possible to do this in angular?
tagged with: checkbox
tagged with: angularjs-ng-repeat
tagged with: angularjs-orderby
answer count: 2
upvote count: 1
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27838325
has title: Sort on checkbox value in angularjs
downvote count: 0
score: 1

http://stackoverflow.com/q/27886319
answer count: 1
type: UnansweredQuestion
tagged with: yeoman
has answer: http://stackoverflow.com/a/27886445
has title: bower js file keep missing after grunt complie
has body: make web app with yeoman I installed 'angular-loading-bar' with this code bower install angular-loading-bar and add path of this js file in app/index.html &lt;script src="bower_components/angular-loading-bar/build/loading-bar.min.js"&gt;&lt;/script&gt; it looks work perfectly. BUT everytime grunt compile, added path in index.html gone.. i tried both section and and i checked grunt:dist, it seems like that js file is not included in scripts/vendor.xxxxx.js
type: Question
tagged with: compilation
tagged with: javascript
tagged with: gruntjs
score: 0

http://stackoverflow.com/q/27816084
possible better answer: http://stackoverflow.com/a/27816165
has answer: http://stackoverflow.com/a/27816165
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27816142
has body: I have a registration mechanism in which rootscope variable is send via service. After success it updates the $rootScope.success field. But the angularjs services is callback dependent.The service update the rootscope.success but the function sequentially execute the code. How do i wait for service to complete its response and then further process? .controller('RegisterAccountCtrl', function ($scope,$rootScope,registerUser,$location) { $rootScope.success = false; $scope.registration = $rootScope.registration; $scope.getEnterGeneratedCode = function(){ $rootScope.registration = $scope.registration; registerUser.registerUser(); if($rootScope.success){ $location.path('/confirm'); } } And inside service .service('registerUser',function($http,$rootScope,$ionicLoading){ this.registerUser = function(){ $ionicLoading.show(); $http({ method: 'POST', datatype:'json', data:{obj:$rootScope.registration}, url: 'http://localhost/LoginService.asmx/CreateUser', contentType: "application/json; charset=utf-8", cache: false }).success(function (data, status, headers, config){ if (status == '200') { var obj = data; $rootScope.success = true; $ionicLoading.hide(); //alert(obj); } }).error(function (data, status, headers, config){ $ionicLoading.hide(); }); }; return this; })
has title: How to handle callback in angularjs?
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: callback
accepted answer: http://stackoverflow.com/a/27816142
favorite count: 0
score: 8
upvote count: 8
tagged with: angularjs

http://stackoverflow.com/comment/44247520
comment on: http://stackoverflow.com/a/27889445
type: Comment
has text: I wish the system allowed to vote for multiple answers. your answer really taught me something new @Rory McCrossan. Thanks you very much!
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44273729
type: AnswerComment
has text: Just paste the code in the link and edit it as you like. It would work fine.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27930401

http://stackoverflow.com/a/27809487
has comment: http://stackoverflow.com/comment/44028838
type: Answer
has comment: http://stackoverflow.com/comment/44038418
upvote count: 3
answers question: http://stackoverflow.com/q/27808968
has body: The issue is caused by data-rel="back" in #linkConfirmacaoDialog confirmation button. When you hit that button, you give two different navigation orders. What happens is that you navigate to target page and then back in history. Use data-rel="back" only when you want to close popup and remain in same page. Another issue, popup div shouldn't be wrapped in div other than page div. Moreover, you are adding multiple click listeners to #linkConfirmacaoDialog whenever a list item is clicked. Place click binding outside other click binding. $(function () { var itens = $('#ulMusicas&gt;li'); /* list item click listener */ itens.click(function () { var nomeMusica = $(this).find('a').text(); $('#dialogTitle').text('Add "' + nomeMusica + '"?'); $('#popupConfirmacao').popup('open', { positionTo: 'window', transition: 'pop' }); }); /* confirmation button - popup */ $('#linkConfirmacaoDialog').click(function () { $.mobile.changePage('/Controller2'); }); });
accepted answer of: http://stackoverflow.com/q/27808968
score: 3
has comment: http://stackoverflow.com/comment/44064087
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44123644
score: 0
type: Comment
type: QuestionComment
has text: Can you clarify the way you can use javascript in your case? As in, can you not upload files, but add javascript to the HTML in a ` ` tag?
comment on: http://stackoverflow.com/q/27860586

http://stackoverflow.com/comment/44300955
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27938517
has text: With this Expression: `<([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1>` you can match Phrases like ` xxx `. It doesent work with Tags like or with Tags nested in themself. The Text between the Tags is Captured in the 2. Group, if you want to get that substring.

http://stackoverflow.com/comment/44190581
type: Comment
type: QuestionComment
has text: Can you post your script with queries you're trying?
score: 1
comment on: http://stackoverflow.com/q/27894711

http://stackoverflow.com/comment/44123539
comment on: http://stackoverflow.com/q/27860155
score: 0
has text: What are you expecting as a result from your comparison?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27958396
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/19625940
downvote count: 0
answer count: 1
tagged with: meteor
favorite count: 0
has title: Meteor Reactive Nested Object Update Parent Object
upvote count: 1
type: AnsweredQuestion
score: 1
has body: I'm trying to make a javascript object reactive such that when a sub-object is updated, the original (parent) object is updated - both in the views and in the javascript. This almost does it except when the "Done?" button is clicked, the console.log output is only accurate the FIRST time. After that, toggling any sub-items correctly updates the view but the underlying javascript is NOT updated as the "selected" values for the subitems are no longer correct. Moreover, I'd like to be able to simplify and simply have the parent items object update when any sub-items are toggled as selected or not. I come from AngularJS and this is far simpler - if you pass in an object and then update a property of that object, the parent property is updated as well and kept in sync automatically. It seems the this and data context are getters but not setters? Template.currentData() seems related but I haven't been able to get that to work: https://github.com/meteor/meteor/issues/2010 The way I got the items to update was to manually update it by setting and comparing an index to update the main parent object from the inner sub data context but again that's not ideal and gets messier and messier as you get more nested as I'd need ALL nested indices to be able to back-track up to the main items object to then overwrite the whole thing to force an update. How to Get Parent Data Context in Meteor on an Event Long story short, I want the given data context (from an event) to be able to be a setter such that if I'm in an {{#each }} and happen to be on items[1].subitem[2] then I can just do this.selected =!this.selected and that will then effectively update items[1].subitem[2].selected (reactively - updating both the javascript object itself and the DOM). So then later I can check the value of items[1].subitem[2].selected and know it's reliable and accurate. Currently I'm getting the DOM to update based on the selected boolean but the parent items array is inaccurate. HTML / template: {{#eac…
has answer: http://stackoverflow.com/a/27976595
accepted answer: http://stackoverflow.com/a/27976595

http://stackoverflow.com/q/27813294
has comment: http://stackoverflow.com/comment/44035643
type: Question
has comment: http://stackoverflow.com/comment/44033975
score: 0
has answer: http://stackoverflow.com/a/27813653
tagged with: php
has body: First, I build a single php page with &lt;script type="text/javascript" &gt; function ShowDIV() { if (popUpDiv.style.display=="none") {popUpDiv.style.display="block"; blanket.style.display="block"; } else { popUpDiv.style.display="none"; blanket.style.display="none";} } &lt;/script&gt; and in my code I can call this function &lt;a href="#" onClick="ShowDIV();"&gt; everything works... but then I wanted to separate that file into main.php (which now includes header.php) in my header.php, I added the same JS code: &lt;script type="text/javascript" &gt; function ShowDIV() { if (popUpDiv.style.display=="none") {popUpDiv.style.display="block"; blanket.style.display="block"; } else { popUpDiv.style.display="none"; blanket.style.display="none";} } &lt;/script&gt; but now it doesn't work, my console tells me: Cannot read property display of Undefined Does it mean I have to pass somehow the propreties to the new header.php file?
answer count: 1
has comment: http://stackoverflow.com/comment/44033896
has comment: http://stackoverflow.com/comment/44033941
has comment: http://stackoverflow.com/comment/44034139
accepted answer: http://stackoverflow.com/a/27813653
tagged with: javascript
has comment: http://stackoverflow.com/comment/44033733
has title: how to pass properties to JS file inside a PHP include
has comment: http://stackoverflow.com/comment/44033792
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44033777

http://stackoverflow.com/a/34192121
upvote count: 1
has body: You don't need to use document.write in this situation. You use a jquery selector and the .html() method (or .append() or similar) to place content inside an element. For example, if you had a div with the class container var content = ' Some content '; $('div.container').html(content); this code would replace the contents of the container with the value of content. You'll notice that CSS style selectors are used for selecting elements, so to select the entire body you can use $('body') or for all text inputs, you can use $('input[type="text"]') .html() will replace the entire innner content, and .append() will add to the element after the other content.
score: 1
answers question: http://stackoverflow.com/q/27844304
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44344553
comment on: http://stackoverflow.com/a/27927848
has text: One notable detail: $location.path() has a URLDecoded version of the URI, which is a problem when the encoded data has slashes in it. However, if I use window.location instead, the solution works perfectly. Exactly what I needed.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44055042
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27824313
has text: Xotic750.. do you mind explaining a little bit about how using node.js helps me with this. I'm new to programming. I installed it, opened it, and it just gives me prompt. No idea what to do from there. Is this something I'm going to just have to dig into and read about? I thought cscript was a good way to simply run my js.
score: 0

http://stackoverflow.com/q/27900863
has answer: http://stackoverflow.com/a/27900960
downvote count: 1
answer count: 4
has answer: http://stackoverflow.com/a/27900965
favorite count: 0
upvote count: 0
type: UnansweredQuestion
has title: Javascript Function does not return expected output
has body: I am just a little confused on why I get the output of [Function] when I am executing a function that I created. var nameString = function (name) { return "Hi, I am" + " " + name; }; nameString("Yasser"); console.log(nameString); I understand that I am using the function within console.log to print out the value of it. Is it not supposed to print out my name "yasser" instead of saying function?
score: -1
has answer: http://stackoverflow.com/a/27900887
has answer: http://stackoverflow.com/a/27904058
type: Question
tagged with: javascript

http://stackoverflow.com/q/27953788
score: 0
has comment: http://stackoverflow.com/comment/44335966
answer count: 1
has answer: http://stackoverflow.com/a/27972612
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/44341751
tagged with: wordpress
type: Question
has title: How to use images to change dropdown selection?
tagged with: woocommerce
has comment: http://stackoverflow.com/comment/44303828
tagged with: javascript
has body: what I'm trying to accomplish is to have image thumbnails replace the dropdown box in a woocommerce variation product page. The way I went to trying to get that to work is when a user clicks on an variation product image, the (will be hidden) dropdown box will change to the correct value just as if the user had interacted with the dropdown box itself. the file I'm working with is variable.php. Here is a snippet of the code. All my custom codes start with the option tag loop just before the closing Select tag. $loop = 0; foreach ( $attributes as $name =&gt; $options ) : $loop++; $countimg = 0;?&gt; &lt;select id="&lt;?php echo esc_attr( sanitize_title( $name ) ); ?&gt;" name="attribute_&lt;?php echo sanitize_title( $name ); ?&gt;" &gt; &lt;option value=""&gt;&lt;?php echo __( 'Choose an option', 'woocommerce' ) ?&gt;&amp;hellip;&lt;/option&gt; &lt;?php if ( is_array( $options ) ) { if ( isset( $_REQUEST[ 'attribute_' . sanitize_title( $name ) ] ) ) { $selected_value = $_REQUEST[ 'attribute_' . sanitize_title( $name ) ]; } elseif ( isset( $selected_attributes[ sanitize_title( $name ) ] ) ) { $selected_value = $selected_attributes[ sanitize_title( $name ) ]; } else { $selected_value = ''; } // Get terms if this is a taxonomy - ordered if ( taxonomy_exists( $name ) ) { $orderby = wc_attribute_orderby( $name ); switch ( $orderby ) { case 'name' : $args = array( 'orderby' =&gt; 'name', 'hide_empty' =&gt; false, 'menu_order' =&gt; false ); break; case 'id' : $args = array( 'orderby' =&gt; 'id', 'order' =&gt; 'ASC', 'menu_order' =&gt; false, 'hide_empty' =&gt; false ); break; case 'menu_order' : $args = array( 'menu_order' =&gt; 'ASC', 'hide_empty' =&gt; false ); break; } $terms = get_terms( $name, $args ); $count = 1; foreach ( $terms as $term ) { if ( ! in_array( $term-&gt;slug, $options ) ) continue; echo '&lt;option id="' . $count . '" value="' . esc_attr( $term-&gt;slug ) . '" ' . selected( sanitize_title( $selected_value ), sanitize_title( $term-&gt;slug ), false ) . …

http://stackoverflow.com/a/28552301
has comment: http://stackoverflow.com/comment/76836313
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27895735
type: Answer
upvote count: 1
has body: In answer to my own question, the best solution was to use the flot.resize.js plugin for flot charts. I had initially included it in the index.html file, but needed to include it in the actual controllers view html file for it to get accessed, due to the nature of angularJS (I'm still learning). So I dropped the jquery.flot.resize.js into my project an referenced it like so: The lower tech solution, was going to be a screen refresh on resize, but the resize plugin was much more elegant. Lower tech solution: window.onresize = function(event) { window.location.reload(); }

http://stackoverflow.com/a/27960389
downvote count: 3
upvote count: 0
has comment: http://stackoverflow.com/comment/44314315
answers question: http://stackoverflow.com/q/27960293
score: -3
type: Answer
has body: You don't need jQuery for that, but try this APPLY Also if you are trying to verify coupons than this is not a good way to do that - your code will be easy to read in source of your website - you should do it on the server side
has comment: http://stackoverflow.com/comment/44314947

http://stackoverflow.com/a/27813951
has body: @Vidhipriya Joshi, u should make some changes in your existing code like below: In HTML file , you do: &lt;input type="text" name="filter_attr[]" size="70" id="filter_attr" filter="50"&gt; Note: name attribute is an array to store all input values, and also do the same in js and php files.. Suggestion: Better to use jquery append function inplace of innerHTML. See the link for more guidness.. Add/Remove Input Fields Dynamically in php Hope it will fullfill your need.. :)
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27813603

http://stackoverflow.com/a/27820978
answers question: http://stackoverflow.com/q/27820918
has comment: http://stackoverflow.com/comment/44047632
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44047836
downvote count: 0
has comment: http://stackoverflow.com/comment/44047548
has comment: http://stackoverflow.com/comment/44047801
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/27820918
has body: you haven't included the jQuery library (so you have a reference error with the $ symbol) you don't call the function matchColumHeights (and your code is not executed) A .column2 element is missing (so the comparison don't work as you expect) As a side note you have also a typo in your css (loat instead of float) and your parent should be wider than 700px (since you've applied some margin and padding to your columns) See this example: http://jsfiddle.net/0e2vLyvb/2/
score: 2
has comment: http://stackoverflow.com/comment/44048324

relative-path
type: Tag
tags question: http://stackoverflow.com/q/27892310
tag name: relative-path
tags question: http://stackoverflow.com/q/27869873

http://stackoverflow.com/comment/44131562
score: 0
type: AnswerComment
type: Comment
has text: Please post your entire code, because it works for me.
comment on: http://stackoverflow.com/a/27840684

http://stackoverflow.com/comment/44308209
has text: All function declarations will be hoisted, and thus available before the reset call. So this isn't the problem here.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27956704

http://stackoverflow.com/a/27807714
has comment: http://stackoverflow.com/comment/44024620
has comment: http://stackoverflow.com/comment/44024534
upvote count: 2
has comment: http://stackoverflow.com/comment/44024884
has comment: http://stackoverflow.com/comment/44024535
type: Answer
score: 2
downvote count: 0
has body: Your variable is being treated as a string, place it outside the quotes and add it to the string with a +: $(document).ready(function(){ var x = $("article:last-child").offset(); $('#content').css('height' : x.top + 'px'); });
answers question: http://stackoverflow.com/q/27807692

http://stackoverflow.com/a/49725737
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27808402
downvote count: 0
has body: Using the concurrently package looks like a less tricky &amp; painful way. This avoids detached processes (&amp;) alltogether. And promises to be more cross-plattform, too. npm install concurrently --save and then in package.json "runBoth": "concurrently \"npm run taskA\" \"npm run taskB\"", Tested (under Ubuntu 16.04, npm 5.6), also see here.

http://stackoverflow.com/comment/44140266
type: AnswerComment
type: Comment
has text: that one gave me the result I wanted, just had to change -4 to a -3. Thank you, very much appreciated.
score: 0
comment on: http://stackoverflow.com/a/27868938

http://stackoverflow.com/q/27886099
score: 6
possible better answer: http://stackoverflow.com/a/27886197
tagged with: regex
has answer: http://stackoverflow.com/a/27886197
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44173715
has title: Regex. How to get multiple matches from this string?
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27886420
has comment: http://stackoverflow.com/comment/44173356
upvote count: 6
tagged with: javascript
has answer: http://stackoverflow.com/a/27886162
accepted answer: http://stackoverflow.com/a/27886162
has body: I am using javascript regex. Let's say I have the following string: XXX_1_XXX XXX_2_XXX XXX_3_XXX YYY_1_YYY YYY_2_YYY YYY_3_YYY and I'd like to run a regex and get a result with this pattern: Match1 1. XXX_1_XXX 2. YYY_1_YYY Match2 1. XXX_2_XXX 2. YYY_2_YYY Match3 1. XXX_3_XXX 2. YYY_3_YYY I have tried variations of this: /(XXX_(.)_XXX)(.)*?(YYY_\2_YYY)/g but it stops at the first match only. Is there any way to do this with regex? or I am better off iterating over it as an array?
answer count: 3
has comment: http://stackoverflow.com/comment/44173416
has comment: http://stackoverflow.com/comment/44173419
has comment: http://stackoverflow.com/comment/44173402

http://stackoverflow.com/a/27924836
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27924756
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27924756
score: 7
type: Answer
has body: Try putting your condition in parentheses so that it's evaluated before string concatenation. var selectedProjectStatusText = "-- Please Select --"; alert("== " + (selectedProjectStatusText == "-- Please Select --")); alert("=== " + (selectedProjectStatusText === "-- Please Select --"));
upvote count: 7

http://stackoverflow.com/comment/53695965
has text: @raphaelRauwolf PointCloud -> Points. Thanks for the tip.
comment on: http://stackoverflow.com/a/27866242
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/86499241
has text: @MohsenZia If you want to preview them using either of these services, you're going to have to pass an unauthenticated link to the service, or (I still haven't had a chance to test if this works) use a basic auth URL. (E.g. `https://username:password@whatever.host/path/to/word.doc`). My recommendation is to render whatever docs you need into PDF, and serve them to the user through access controlled paths.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27958186

http://stackoverflow.com/comment/44321681
type: QuestionComment
has text: no, directive. what do you mean by of type text/ng-template? Im using the regular script tag as "text/javascript". can you direct me to an example.
score: 0
comment on: http://stackoverflow.com/q/27961474
type: Comment

http://stackoverflow.com/comment/44585747
type: AnswerComment
comment on: http://stackoverflow.com/a/28105103
has text: `autofocus` is a boolean attribute, just like `required`. Both `autofocus="true"` and `autofocus="false"` are incorrect; both will be interpreted as `autofocus` attribute *is present* causing the input to autofocus. Since the input is shown when regCodeRequired is true, you can safely replace `autofocus="{{regCodeRequired}}"` with `autofocus`.
type: Comment
score: 2

http://stackoverflow.com/comment/44056948
comment on: http://stackoverflow.com/q/27825493
has text: Or rather a simple `[0, 0, 0, 1, 2, 2][val]` for this specific case?
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/27865387
score: 1
upvote count: 1
tagged with: cocos2d-js
type: Question
answer count: 2
tagged with: cocostudio
has body: I'm trying to figure out the cocos2d Javascript environment. I'm using Cocos Studio v2.1 beta to generate a scene. Right now the scene just has a label so I can know if it worked. I publish it to a Cocos Code IDE project created by Cocos Studio. After some searching, it seems you can load any CSB as a Node by using: var imported = ccs.csLoader.createNode("res/MainScene.csb"); Node seems to be the root object for a lot of different things. I'm looking for a way to take this Node and pass it a call to cc.director.runScene(imported); I tried calling getScene() but that seemed like a stretch. imported shouldn't have a parent that's a Scene, it IS a scene. I have a main.js that looks like this: cc.game.onStart = function(){ cc.view.adjustViewPort(true); cc.view.setDesignResolutionSize(800, 450, cc.ResolutionPolicy.SHOW_ALL); cc.view.resizeWithBrowserSize(true); //load resources cc.LoaderScene.preload(g_resources, function () { var imported = ccs.csLoader.createNode("res/MainScene.csb"); cc.director.runScene(imported); }, this); }; cc.game.run(); When I run the game, it crashes as soon as I run it. Here's the console output: Console: listening on 0.0.0.0 : 6050 Console: listening on 0.0.0.0 : 6060 Ready for GLSL Ready for OpenGL 2.0 { gl.version: 2.1.0 - Build 8.15.10.2622 gl.supports_NPOT: true cocos2d.x.version: cocos2d-x 3.3 cocos2d.x.compiled_with_profiler: false cocos2d.x.build_type: DEBUG cocos2d.x.compiled_with_gl_state_cache: true gl.max_texture_size: 8192 gl.vendor: Intel gl.renderer: Intel(R) HD Graphics gl.max_texture_units: 16 gl.supports_ETC1: false gl.supports_S3TC: true gl.supports_ATITC: false gl.supports_PVRTC: false gl.supports_BGRA8888: false gl.supports_discard_framebuffer: false gl.supports_vertex_array_object: true } cocos2d: fullPathForFilename: No file found at script/jsb_debugger.jsc. Possible missing file. cocos2d: fullPathForFilename: No file found at script/debugger/DevToolsUtils.jsc. Possible missing file. cocos2d: fullPathForFilename: No file…
tagged with: javascript
has answer: http://stackoverflow.com/a/28213705
has title: Run scene generated in CocosStudio?
tagged with: cocos2d-x
downvote count: 0
has comment: http://stackoverflow.com/comment/45220222
favorite count: 0
has comment: http://stackoverflow.com/comment/45205993
has comment: http://stackoverflow.com/comment/45212688
has answer: http://stackoverflow.com/a/27921544
type: UnansweredQuestion

http://stackoverflow.com/comment/44246124
type: AnswerComment
has text: what would you like to change? you can edit each record in the store. A memory store is used in memory and lost when its no longer needed.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27924541

http://stackoverflow.com/comment/44154223
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/13901520/grey-area-in-google-maps
score: 0
comment on: http://stackoverflow.com/q/27876407

http://stackoverflow.com/comment/44236225
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27919156
type: Comment
has text: The styles are generated within html, I can not change this. The above scenario was just example, multiple style rules are applied.

http://stackoverflow.com/comment/44127787
has text: Well your calling `gBenerateUpload()` on that button `onclick=`....?
comment on: http://stackoverflow.com/q/27862865
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44086732
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27841403
has text: *"new Array(3); will create an array with three elements that are undefined"* not quite true. It creates empty array, without any values at all, even undefined (so called "holes"). it's just reading missing indexes returns `undefined`.

http://stackoverflow.com/q/27810409
tagged with: mongoose
tagged with: javascript
tagged with: express
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44043584
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/44043244
has body: I've set up the code below on my node server in order to fill Event objects in my database with photos based on parameters sent to Instagram in a GET request through the API (latitude, longitude, distance, max_timestamp). My code pulls the first event from my database correctly, but then gets stuck in an infinite loop at the first console.log statement. I'm seeing: sending request to Instagram for New Years Eve - Times Square with max_timestamp: 1419984000 logged to my console dozens of times in a matter of seconds. I'm not sure why the rest of my code is not running. // modules ================================================= var express = require('express.io'); var app = express(); var port = process.env.PORT || 6060; var io = require('socket.io').listen(app.listen(port)); var request = require('request'); var Instagram = require('instagram-node-lib'); var mongoose = require('mongoose'); var bodyParser = require('body-parser'); var methodOverride = require('method-override'); var db = require('./config/db'); var Event = require('./app/models/event'); // configuration =========================================== mongoose.connect(db.url); // connect to our mongoDB database // get all data/stuff of the body (POST) parameters app.use(bodyParser.json()); // parse application/json app.use(bodyParser.json({ type: 'application/vnd.api+json' })); // parse application/vnd.api+json as json app.use(bodyParser.urlencoded({ extended: true })); // parse application/x-www-form- urlencoded app.use(methodOverride('X-HTTP-Method-Override')); // override with the X-HTTP-Method- Override header in the request. simulate DELETE/PUT app.use(express.static(__dirname + '/public')); // set the static files location /public/img will be /img for users var baseUrl = 'https://api.instagram.com/v1/media/search?lat='; var clientId = MY-CLIENT-ID; Event.find({}, function(err, events) { events.forEach(function(event) { var name = event.event; var latitude = event.latitude; var longitude = event.lon…
has comment: http://stackoverflow.com/comment/44029909
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/44043957
has title: Node server code stuck in infinite loop
has comment: http://stackoverflow.com/comment/44043712
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44043153
downvote count: 0

http://stackoverflow.com/q/27852145
has answer: http://stackoverflow.com/a/27852951
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27852603
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/44109096
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/44108417
has answer: http://stackoverflow.com/a/27852603
accepted answer: http://stackoverflow.com/a/38992556
has body: I am Totally new to angular js, Little bit difficult to understand the routing concept in the angular js. I am developing admin site. I need to structure like following. I've Login.html = this is separate page, instead of partial Signup.html = This is also separate page, instead of partial After success login, it'll go to dashboard where I'll load all my partials using ng-view. How could I do that ? I googled it. I can only see all like only for partial views. I did like following, but not working. I knew this is wrong, but don't know how to do Project: app.js var nApp = angular.module('nApp', ['ngRoute']); nApp .config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/Login', { templateUrl: 'App/Login/Login.html', controller: 'LoginController', caseInsensitiveMatch:true }).when('/Signup', { templateUrl: 'App/Signup/Signup.html', controller: 'SignupController', caseInsensitiveMatch:true }).when('/Dashboard', { templateUrl: 'App/Index.html', controller: 'DashboardController', caseInsensitiveMatch:true }) .otherwise({ redirectTo: '/Login' }); }]); Login.html Signup.html Index.html Placed app.js under App directory \ Is there any other way to do that please mention ...
type: AnsweredQuestion
score: 2
has title: Loading two different pages Angular js
has answer: http://stackoverflow.com/a/38992556
has comment: http://stackoverflow.com/comment/44109069
has comment: http://stackoverflow.com/comment/44108264
type: Question
has comment: http://stackoverflow.com/comment/44109039

knockout.js
tags question: http://stackoverflow.com/q/27918647
tags question: http://stackoverflow.com/q/27854581
tags question: http://stackoverflow.com/q/27845943
tags question: http://stackoverflow.com/q/27812475
tags question: http://stackoverflow.com/q/27817366
tags question: http://stackoverflow.com/q/27958047
tags question: http://stackoverflow.com/q/27959208
tags question: http://stackoverflow.com/q/27910948
tags question: http://stackoverflow.com/q/27857046
tags question: http://stackoverflow.com/q/27941256
tags question: http://stackoverflow.com/q/27871617
tags question: http://stackoverflow.com/q/27816497
tag name: knockout.js
tags question: http://stackoverflow.com/q/27810843
tags question: http://stackoverflow.com/q/27846406
tags question: http://stackoverflow.com/q/27831704
tags question: http://stackoverflow.com/q/27954419
tags question: http://stackoverflow.com/q/27940428
tags question: http://stackoverflow.com/q/27812956
tags question: http://stackoverflow.com/q/27841206
tags question: http://stackoverflow.com/q/27820521
tags question: http://stackoverflow.com/q/27962399
tags question: http://stackoverflow.com/q/27847772
tags question: http://stackoverflow.com/q/27908789
tags question: http://stackoverflow.com/q/27815572
tags question: http://stackoverflow.com/q/27832986
tags question: http://stackoverflow.com/q/27808289
tags question: http://stackoverflow.com/q/27939385
tags question: http://stackoverflow.com/q/27849267
type: Tag
tags question: http://stackoverflow.com/q/27921354
tags question: http://stackoverflow.com/q/27847315
tags question: http://stackoverflow.com/q/27911768
tags question: http://stackoverflow.com/q/27913085
tags question: http://stackoverflow.com/q/27912706
tags question: http://stackoverflow.com/q/27851817
tags question: http://stackoverflow.com/q/27910441
tags question: http://stackoverflow.com/q/27953262
tags question: http://stackoverflow.com/q/27868973
tags question: http://stackoverflow.com/q/27909541
tags question: http://stackoverflow.com/q/27942746

http://stackoverflow.com/q/27942367
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/44280478
has answer: http://stackoverflow.com/a/27942802
has title: get the html of the second td of selected tr of datatable
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
type: Question
has body: i have a datatable... Now i have this code, which chages the class or a tr to "selected" when clicked.. $(document).ready(function() { $("#domains_list tbody").on( "click", "tr", function () { $(this).toggleClass("selected"); } ); }); Now my datatable comes like this... Now as you can see there are two pages showing different selected rows now i write this code $('#butto').click(function() { $("#domains_list").find("tr.selected").each(function() { $(this).find("td:eq(1)").each(function() { alert($(this).html()); }); }); }); this above code was intended to show all the html in the second &lt;td&gt; of the selected &lt;tr&gt; But the problem is, it alerts only the &lt;td&gt; html of &lt;tr&gt; in the opened page... i.e. if page 1 is open then it alerts only &lt;td&gt; html of page 1, if page 2 is open then it alerts only &lt;td&gt; html of page 2, How can i make it to alert all the html of the irrespective of the page opened?
tagged with: javascript
has answer: http://stackoverflow.com/a/27942815
score: 0

http://stackoverflow.com/q/27948023
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27949017
tagged with: d3.js
has title: D3 stagger animations
has body: I am trying to stagger enter (and transitions but starting with enter) animations for a d3 piece I am working on. Admittedly, I don't have a great grasp on this D3, as I am just starting out with it, but here is what I am trying - nodeEnter.append("text") .transition() .delay(100) .each("start", function() { d3.select(this) .attr("dy", ".35em") .text(function(d) { return d.name; }); }); So, the intended effect is having each enter transition delayed by 60ms of the previous one. Kind of like if I were to loop through and do something like delay = i*60 . I would appreciate any guidance. Thanks!
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27949017
type: Question

http://stackoverflow.com/q/27853161
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44110544
possible better answer: http://stackoverflow.com/a/27853365
tagged with: css
has answer: http://stackoverflow.com/a/27853495
has comment: http://stackoverflow.com/comment/44110462
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44110615
has comment: http://stackoverflow.com/comment/44110644
has comment: http://stackoverflow.com/comment/44110435
has comment: http://stackoverflow.com/comment/44110500
type: Question
has comment: http://stackoverflow.com/comment/44110683
score: 1
has answer: http://stackoverflow.com/a/27853365
has body: I am doing a web in where I want to prevent an user to access a content before he or she fulfill some predefined goal. For example, I want to prevent an user to go to certain place of my page until they go to another place before. Like to prevent someone without the proper level to access that part of the web. I want to avoid the use of password if possible. I am going to use it in several parts of my webpage. Thanks for your help.
upvote count: 2
answer count: 2
tagged with: locking
downvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44110667
favorite count: 0
accepted answer: http://stackoverflow.com/a/27853495
has title: How i block part of the content for unprivileged users
has comment: http://stackoverflow.com/comment/44110634

http://stackoverflow.com/a/27851719
has comment: http://stackoverflow.com/comment/44108267
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44107670
has comment: http://stackoverflow.com/comment/44108014
type: Answer
accepted answer of: http://stackoverflow.com/q/27851166
has comment: http://stackoverflow.com/comment/44108000
answers question: http://stackoverflow.com/q/27851166
has comment: http://stackoverflow.com/comment/44107522
score: 1
upvote count: 1
has body: I think you are referring to this line: var Texto = "Hola, Escribiste: "+'@(ViewBag.Message)'; You need the quotation marks around @(ViewBag.Message) because this line is evaluated by two totally different languages. You need to understand the difference between what is happening on the server and what is happening on the client. Here is what happens: The SERVER prepares the content to send to the client. In doing so, among other things, it parses all Razor expressions on the page and, where appropriate, replaces them with content. In this case the expression @(ViewBag.Message) is replaced with whatever the user entered. The quotation marks are outside of the Razor expression, so they will be left alone. So for example this line could be sent as var Texto = "Hola, Escribiste: "+'uno dos tres'; The page with the replaced content is sent to the client The CLIENT recognizes that the code is Javascript and executes it. At this point the content has already been replaced, so Javascript doesn't actually see the part @(ViewBag.Message), and it has no idea it was ever there. All it sees is the replaced line as per point 1 Now try to think about what would happen if the single quotes weren't there. In that case the Javascript would see the following line: var Texto = "Hola, Escribiste: "+uno dos tres; Which is clearly wrong because there are no quotation marks around some of the text. This is why you need the quotation marks. Also, you need to careful in this case, because if your user enters a text that contains a single quote, your code will break. For example if the text to display is Don't enter single quotes, the "replaced" line would become: var Texto = "Hola, Escribiste: "+'Don't enter single quotes'; The above line has mismatched quotes and throws an exception, as well as leaving your application vuylnerable to a kind of attack called XSS (Cross-Site Scripting). So if you just need to display the lenght of the text, there is a better way to do this. You don't need Ja…

datetime
tags question: http://stackoverflow.com/q/27829896
tags question: http://stackoverflow.com/q/27826179
tags question: http://stackoverflow.com/q/27958108
tags question: http://stackoverflow.com/q/27951204
tags question: http://stackoverflow.com/q/27883478
tags question: http://stackoverflow.com/q/27953474
tags question: http://stackoverflow.com/q/27865932
tag name: datetime
tags question: http://stackoverflow.com/q/27847752
tags question: http://stackoverflow.com/q/27956436
type: Tag
tags question: http://stackoverflow.com/q/27887022

http://stackoverflow.com/comment/44089378
comment on: http://stackoverflow.com/q/27842802
has text: The second way seems to work fine.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/67954582
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27841988
has body: Alert is a interface which have the abstract methods below void accept(); void dismiss(); String getText(); void sendKeys(String keysToSend); new WebDriverWait(driver,10). until(ExpectedConditions.alertIsPresent()).accept(); alertIsPresent() internally return the driver.switchTo.alert(); then we don't have to write it explicitly hope this is been helpful

http://stackoverflow.com/a/29424699
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27868958
type: Answer
accepted answer of: http://stackoverflow.com/q/27868958
has comment: http://stackoverflow.com/comment/62082343
score: 1
upvote count: 1
downvote count: 0
has body: Apparently, it's not supported yet: there's a feature request and a few discussion about it. Furthermore, it appears that it has an attempt to support it, but it still needs revision, and probably some work. I think it would be a great opportunity for anyone interested on it to test and contribute.

http://stackoverflow.com/a/27814715
score: 1
has comment: http://stackoverflow.com/comment/44037235
has comment: http://stackoverflow.com/comment/44037730
has comment: http://stackoverflow.com/comment/44037900
upvote count: 1
has comment: http://stackoverflow.com/comment/44041012
has body: First you are missing to append ","(comma) in following code search_val = search_val+"\""+div_val_arr[j].replace("&lt;li&gt;","")+"\""; Above code will make array as following: search_val =["value1""value2""value3""value4"]; Add comma and make sure it will genrate array as follows. search_val =["value1","value2","value3","value4"];
has comment: http://stackoverflow.com/comment/44040942
type: Answer
answers question: http://stackoverflow.com/q/27814315
downvote count: 0

http://stackoverflow.com/a/27990570
upvote count: 9
has body: I was searching for a while and I have found an possibility. It was very easy at the end... I let this here, maybe anybody is interested in. for (var i in data) var monthSource = new Object(); monthSource.title = data[i]+' présents'; monthSource.start = i; // this should be date object monthSource.end = new Date(y, m, d); //to now month[a] = monthSource; a++; } $('#calendar').fullCalendar({ viewRender: function (view) { $('#calendar').fullCalendar( 'removeEvents'); $('#calendar').fullCalendar('addEventSource', month); }
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27920314
score: 9

http://stackoverflow.com/q/27859642
has title: Angular JS breadcrumbs returning to home page with parametrs
answer count: 2
has answer: http://stackoverflow.com/a/27859799
tagged with: javascript
score: 0
tagged with: angularjs
tagged with: breadcrumbs
type: UnansweredQuestion
type: Question
has body: I want to have breadcrumbs like : Home / Cars / Audi / T8, where Home, Cars and Audi sends back to HomePage but with different parameters e.g. Cars checkbox clicked etc. I use AngularJS with ui.router and ncy-angular-breadcrumb. $stateProvider .state('main',{ url: '/', templateUrl: 'views/main.html', controller: 'MainCtrl', ncyBreadcrumb: { label: 'HomePage' } }) .state('main.type',{ controller: function($scope, breadcrumbsFctry) { $scope.defaultType = 'car'; }, ncyBreadcrumb: { label: '{{defaultType}}', parent: 'main' } }) .state('main.type.make',{ controller: function($scope, breadcrumbsFctry) { $scope.defaultMake = 'audi'; }, ncyBreadcrumb: { label: '{{defaultMake}}', parent: 'main.type' } }) .state('car', { url: '/ad/:name-:id', templateUrl: 'views/ad/ad.html', controller: 'AdCtrl', ncyBreadcrumb: { label: ':name', parent: 'main.type.make' } }) Factory : .factory('breadcrumbsFctry', function () { var type = ''; var make = ''; return { }; }); How share the parameters via states with different Controllers ?
has answer: http://stackoverflow.com/a/27859817

http://stackoverflow.com/q/27918261
tagged with: tsd
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question
tagged with: typescript
tagged with: javascript
upvote count: 1
answer count: 1
has title: Publishing a TypeScript library with Bower
favorite count: 0
has answer: http://stackoverflow.com/a/27918262
has body: How to properly build and package a TypeScript library so that it can be used from both JavaScript and TypeScript code easily using Bower and TSD?
tagged with: bower

datatables
tags question: http://stackoverflow.com/q/27852497
tags question: http://stackoverflow.com/q/27867139
tags question: http://stackoverflow.com/q/27918051
tags question: http://stackoverflow.com/q/27947688
tags question: http://stackoverflow.com/q/27936139
tags question: http://stackoverflow.com/q/27846899
tags question: http://stackoverflow.com/q/27900343
tags question: http://stackoverflow.com/q/27817802
tags question: http://stackoverflow.com/q/27920289
type: Tag
tags question: http://stackoverflow.com/q/27956307
tags question: http://stackoverflow.com/q/27869171
tag name: datatables
tags question: http://stackoverflow.com/q/27900138
tags question: http://stackoverflow.com/q/27843664
tags question: http://stackoverflow.com/q/27908303

http://stackoverflow.com/comment/44157455
type: Comment
comment on: http://stackoverflow.com/q/27877864
score: 0
has text: Sounds like you should be working on faster pageloads instead ?
type: QuestionComment

http://stackoverflow.com/q/27834039
has answer: http://stackoverflow.com/a/27834139
possible better answer: http://stackoverflow.com/a/27834243
has answer: http://stackoverflow.com/a/27834147
has title: HTML-CSS div is 3px taller than child
linked to: http://stackoverflow.com/q/2628050
has answer: http://stackoverflow.com/a/27834243
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 5
accepted answer: http://stackoverflow.com/a/27834092
tagged with: http://stackoverflow.com/tag/html
has body: I'm working on a project that uses several divs of the same class, each containing a single child element that might be an image or an iframe, of unspecified height. I'd like the container div to be exactly the height of its child element, but the default height is 3px taller than the child. I've got a JSfiddle demonstrating the problem at http://jsfiddle.net/52me041n/2/. HTML: CSS: .outside{ background-color: red; } I'd like to know whether it's possible to set the div to the proper height with just CSS, and if not, how to right it with JS.
tagged with: css
has comment: http://stackoverflow.com/comment/44073523
upvote count: 11
has answer: http://stackoverflow.com/a/27834131
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27834092
score: 11
type: Question
has comment: http://stackoverflow.com/comment/44073464

http://stackoverflow.com/q/27900200
score: 1
favorite count: 0
has body: Using PHP/cURL I'm trying to login to www.teliatv.dk with my credentials and return some json from a file on the domain, while keeping the session alive by storing the session cookie in a txt file. &lt;?php // Login to www.teliatv.dk $username = "xxxxxxx"; $password = "xxxxxxxx"; $file = dirname(__FILE__) . "cookie.txt"; $ch = curl_init("http://www.teliatv.dk/"); curl_setopt($ch, CURLOPT_COOKIEFILE, $file); curl_setopt($ch, CURLOPT_COOKIEJAR, $file); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIESESSION, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); echo curl_exec ($ch); curl_close($ch); // Display content of cookie.txt echo file_get_contents($file); // Retrieve json content $ch = curl_init("https://www.teliatv.dk/rest/secure/livechannels/2087/decryptionticket_postasget?deviceType=WEB&amp;callback=jQuery161003904806077480316_1421055449439&amp;_=1421055849886"); curl_setopt($ch, CURLOPT_COOKIEFILE, $file); curl_setopt($ch, CURLOPT_COOKIEJAR, $file); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); echo curl_exec ($ch); curl_close($ch); ?&gt; However, my script doesn't seem to be able to login to the site in the first place. The action attribute in the login form on the site is empty and the HTTPheader doesn't reveal a URL when submitting the form. Apparently the site uses Embedded JavaScript (EJS) so generate the HTML content of the site (which I'm unfamiliar with). I don't know if somehow this is the reason why I'm unable to find the URL where username and password is sent? I hope somebody's able to help me out.
type: UnansweredQuestion
tagged with: php
tagged with: curl
has comment: http://stackoverflow.com/comment/44200208
has title: How to find the url where login credentials are send to?
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44200159
has comment: http://stackoverflow.com/comment/44203193
tagged with: ejs
has answer: http://stackoverflow.com/a/27900387
answer count: 1
downvote count: 0

http://stackoverflow.com/a/27955480
has comment: http://stackoverflow.com/comment/44306865
downvote count: 0
has comment: http://stackoverflow.com/comment/44308127
has comment: http://stackoverflow.com/comment/44306737
has body: This is happening because your test image is quite small and it is already loaded before your code gets a chance to run. So load is not fired (as image already loaded). I have made small change to your code and updated the fiddle. The changes are as follows: show loader image at start create an Image object and wire onload of this object assign it source (the actual image that you want to load) when event occurs, assign source to original image var im = new Image(); im.onload = function () { $("#img2Replace")[0].src = im.src; }; im.src = "http://dummyimage.com/375x375/000/fff"; Well now we have to do this for each image: var imgs = $("article.project img.attachment-home-thumb"); $.each(imgs, function () { var $this = $(this); var im = new Image(); im.onload = function () { var theImage = $this; $this.hide("slow"); theImage[0].src = im.src; $this.show('fast'); }; im.src = $this.data("mainsrc"); }); Note that to simulate delay in loading actual image, I have used setTimeout in fiddle.
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/44306486
has comment: http://stackoverflow.com/comment/44306669
accepted answer of: http://stackoverflow.com/q/27955318
answers question: http://stackoverflow.com/q/27955318
type: Answer
upvote count: 4

http://stackoverflow.com/comment/44098858
comment on: http://stackoverflow.com/a/27847232
type: Comment
score: 0
type: AnswerComment
has text: Hope i am not over asking, but Angular is quite difficult. Now i can't get the detail partial to work. This is my controller: `code .controller('RobotCtrl', function($scope, $stateParams, Robot) { $scope.robot = Robot.get({robotName: $stateParams.robotName}); }); `

http://stackoverflow.com/q/27958108
has answer: http://stackoverflow.com/a/27958220
type: Question
answer count: 2
has title: How to I convert 5PM to Javascript date object?
has body: I have a string like "9:00:00 AM" How do I convert it into a Javascript datetime object? Currently I am using bootstrap timepicker but the control passes the value back as string http://jdewit.github.com/bootstrap-timepicker
tagged with: javascript
score: 0
tagged with: datetimepicker
tagged with: datetime
tagged with: angularjs
has answer: http://stackoverflow.com/a/27958828
type: UnansweredQuestion

http://stackoverflow.com/q/27881916
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27882226
has body: How can I take a input value and put into a variable in angularJS? this is the working testing version on my page but I did javascript and jquery together with angularJS to make it work but it is still giving me errors. I know there must be a way to take the input value and put it inside of a var value through angularJS with out writting it manually how I'm doing it. http://www.jaysg.com/poster index.html Find That Poster Search app.js // angular (function() { var app = angular.module('store', ['store-products']);//main app ng-app app.controller('StoreController',[ '$http', function($http){ var store = this; store.products = [ ]; $(document).ready(function() { $( "input" ).keyup(function() { var value = $( this ).val(); $('button').click(function() { $http.get("http://api.themoviedb.org/3/search/movie?api_key=2f6ab7c6dc3db52d34703aae308640ef&query=" + value ).success(function(data){ store.products = data; }); }); }) .keyup(); }); }]); })();
score: 0
possible better answer: http://stackoverflow.com/a/27882102
has title: How can I take a input value and put into a variable in angularJS?
has answer: http://stackoverflow.com/a/27882226
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27882102
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/44020674
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27805861
type: QuestionComment
has text: If you go to Google.com, and hit the little keyboard icon on the right side in the seach field, is that what you're looking for ?

http://stackoverflow.com/q/27882357
has title: Making Meteor reactive for html elements
accepted answer: http://stackoverflow.com/a/27883020
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: meteor
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/27883020
has body: So I have a modal box that allows the user to edit / save some data. I just want to add that unlike other Meteor apps, I don't want to save the data straight away - I want the user to fill in all the fields before hitting save where it will save to the database and send to server etc. This is mainly because I want the user to be able to hit the "cancel" button to revert all changes. I have a drop down box at the start of the form where depending on the value, fields will be shown or hidden Input Formula And I have a handlebar around a field like this to determine whether I want to show it {{#if isFormula }} {{/if}} With a helper looking like this isFormula: -> $('#ddlNewInputType').val() == 'formula' However, this doesn't work. Aside from when it first loads onto the page, it never hits isFormula, probably because Meteor doesn't consider any of the HTML elements as reactive so it never re-evaluates when the HTML element changes. What is a suitable way to get around this? Is it possible to make something reactive explicitly in Meteor? I was also considering putting the dropdown list value into a session variable but that just seems messy because I'm going to need to manage this session variable (remember to clear it when the modal box closes etc.)
type: AnsweredQuestion
upvote count: 2
type: Question

http://stackoverflow.com/comment/44200643
type: Comment
has text: Because it's possible to select mutliple images.
comment on: http://stackoverflow.com/a/27899122
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44226821
score: 1
type: Comment
type: QuestionComment
has text: Can i see your images controllers? Can you share your project with github or perhaps send me in my email? marcelo.franco.alves@gmail.com . If you send to my email, please send without the node modules .
comment on: http://stackoverflow.com/q/27913766

http://stackoverflow.com/q/27828145
upvote count: 2
score: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27828461
has answer: http://stackoverflow.com/a/27828355
type: Question
tagged with: javascript
has body: &lt;html&gt; &lt;head&gt; &lt;style&gt; .bttHider { display: block; disabled: true; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;input id="bttHider" class="bttHider" type="submit" onclick="showHidden(); showbttHidden(); this.style.display='none';" value="Add a new notice here."&gt; &lt;/body&gt; &lt;script&gt; int h = new Date(hours) if 5 &lt;= h &lt;= 7 { document.getElementById('btttHider').style.disabled="false"; } &lt;/script&gt; So I need the input.bttHider to only be available during 6 in the morning till 8 in the morning but I'm unsure how to implement that, any help to show me what is wrong with it would be greatly appreciated. Thanks in advance!
answer count: 2
has comment: http://stackoverflow.com/comment/44062242
has title: How do I make a button only available during a certain time of day in html?
favorite count: 0
has comment: http://stackoverflow.com/comment/44062520
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44062307
has comment: http://stackoverflow.com/comment/44062464
has comment: http://stackoverflow.com/comment/44062479

http://stackoverflow.com/comment/44232348
has text: "fnServerData": function (sSource, aoData, fnCallback) what are these parameters ?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27916950
type: AnswerComment

http://stackoverflow.com/q/27952808
tagged with: flash
tagged with: javascript
tagged with: jquery
has body: I'm trying to call for a jQuery function when my Flash Canvas animation ends. I can't seem to figure out what code I need to add on that last keyframe in order to do that. I found something like this but it's not working: this.stop(); ExternalInterface.call("javascript:start_website();"); Thanks in advance!
has answer: http://stackoverflow.com/a/32254797
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27962218
type: Question
has title: Call jQuery from inside Flash Canvas
answer count: 2
tagged with: canvas

http://stackoverflow.com/comment/44134854
has text: @epascarello Yes but the file window still opens.
comment on: http://stackoverflow.com/q/27866050
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27946837
score: 1
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
answer count: 0
has title: Socket.io: disconnect, reconnect events etc
upvote count: 1
tagged with: socket.io
type: Question
tagged with: javascript
has body: I am trying to get a handle on the various connection/disconnection events and how to use these to make sure that my application will always terminate gracefully. I understand that socket.io will automatically attempt to reconnect a specified number of times. It is my understanding that as the connection goes down and subsequently reconnects there will be a disconnection event fired server side. I do not care about the connection temporarily going down so long as it comes back up at some point. However if there is a more permanent disconnect, I do care about this and would need to update data such as connected users. I understand that on the client side you can get a reconnect_failed error object but I do not believe you can listen for this on the server. Is there any way to get notification on the server side that the connection is down and reconnection has failed? If so how does socket.io implement this? I could issue a timeout upon a disconnection event server side that removes users if there is no reconnection. I could also have the server ping all connected clients at certain intervals. Are these kinds of solutions the only way to completely deal with all kinds of possible disconnections?
downvote count: 0

http://stackoverflow.com/comment/44030079
comment on: http://stackoverflow.com/a/27810559
score: 0
type: AnswerComment
type: Comment
has text: Why does the code snippet evaluate in seconds, if it takes so long?

http://stackoverflow.com/q/27902539
has answer: http://stackoverflow.com/a/63162810
tagged with: asp.net
favorite count: 0
upvote count: 165
type: Question
has answer: http://stackoverflow.com/a/28607943
tagged with: google-api
has answer: http://stackoverflow.com/a/35900951
has answer: http://stackoverflow.com/a/38788678
has answer: http://stackoverflow.com/a/76699423
has comment: http://stackoverflow.com/comment/89592635
has answer: http://stackoverflow.com/a/48151775
has answer: http://stackoverflow.com/a/31331275
has answer: http://stackoverflow.com/a/42257276
has answer: http://stackoverflow.com/a/77983739
has answer: http://stackoverflow.com/a/70544440
has comment: http://stackoverflow.com/comment/116528820
has answer: http://stackoverflow.com/a/35418816
has answer: http://stackoverflow.com/a/28044629
has comment: http://stackoverflow.com/comment/89478005
has comment: http://stackoverflow.com/comment/44204568
score: 165
has answer: http://stackoverflow.com/a/48074564
answer count: 17
linked to: http://stackoverflow.com/q/27450562
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/53957050
has answer: http://stackoverflow.com/a/64111960
has answer: http://stackoverflow.com/a/29820236
has answer: http://stackoverflow.com/a/63776055
has title: How can I validate google reCAPTCHA v2 using javascript/jQuery?
has body: I have a simple contact form in aspx. I want to validate the reCaptcha (client-side) before submitting the form. Please help. Sample code: <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %> Test Form First Name* I want to validate the captcha on cmdSubmit click. Please help.
downvote count: 0
tagged with: recaptcha

http://stackoverflow.com/q/27840709
tagged with: jquery
has title: How to check that element length has changed before continuing function - Javascript
score: 0
has comment: http://stackoverflow.com/comment/44084943
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27840753
has body: Is there a way to pause a function to check the state of an element and only continue when the state has changed? Here's my function : JS download : function() { var loading = $('#stats-table &gt; div &gt; div.jtable-busy-message').html(); while (loading.length &gt; 0) { alert("Table still loading, please wait to download report"); loading = $('#stats-table &gt; div &gt; div.jtable-busy-message').html(); } // continue with the rest of the function here } What should I replace the illustrative while loop with in the above function in order to pause the function and check the .length of loading for a change before proceeding with the function. For information, the loading variable either has a length of 18 and 0 - so simply checking for this change in length. So until the length changes do not continue with the rest of the method body. UPDATE I've found a simple way of doing this, so no longer require any answers - thanks
has comment: http://stackoverflow.com/comment/44085054
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27841010
tagged with: javascript

http://stackoverflow.com/comment/44290154
score: 0
comment on: http://stackoverflow.com/q/27946563
type: QuestionComment
has text: you should not use unfiltered for loops on objects with inherited methods.
type: Comment

http://stackoverflow.com/a/27865273
has body: I think your issue is not one of Razor and instead JavaScript. It looks like you need quotes around @email because it is a string and JavaScript is complaining about the content without that because it is illegal. Send
type: Answer
upvote count: 4
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/27865192
has comment: http://stackoverflow.com/comment/44133221
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27865192

http://stackoverflow.com/a/27871908
type: Answer
has body: Inside the Ajax result, the this context is different. You need to setup a variable before your ajax request, or before your function to access it, like so : self: this, loginSuccess: function(e){ console.log("Success!"); gapi.client.load('plus', 'v1', function() { var request = gapi.client.plus.people.get( {'userId' : 'me'} ); request.execute(function(retr){ console.log("Data Loaded"); console.log(retr); self.myFunction(retr); }); }); }
answers question: http://stackoverflow.com/q/27871026
score: 0
has comment: http://stackoverflow.com/comment/44181508
has comment: http://stackoverflow.com/comment/44177234

http://stackoverflow.com/comment/44259850
type: Comment
comment on: http://stackoverflow.com/q/27931162
type: QuestionComment
score: 0
has text: Here's your sample as an object: http://jsfiddle.net/s7tdq469/1/

http://stackoverflow.com/a/29168189
has body: I ran into the same problem. Eventually I put the views in assets/javascripts/views This is my manifest (application.js): //= require angular/angular //= require angular-route/angular-route //= require angular-resource/angular-resource //= require angularapp //= require_tree views //= require_self Then I have this for the route configuration: myApp.config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/', { controller: 'GioController', templateUrl: '/angular-asset-bower/assets/views/view.html', reloadOnSearch: false }) .otherwise({ redirectTo : '/' }); }]) You can check out the complete example project here: https://github.com/gioper86/angular-asset-bower
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27909890

appcelerator-mobile
tags question: http://stackoverflow.com/q/27904518
type: Tag
tag name: appcelerator-mobile

http://stackoverflow.com/q/27926156
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44260751
tagged with: php
has body: I have been working on a project trying to write text to an image using php gd library. I have succeeded in generating the image and outputing it to the browser. What I want to know is... is there a way I could get the image to popup on the same page without loading and displaying the image in the php file that contains the code for creating and writing text to the image? Thanks in advance for your help. My code: &lt;?php //Set content type header('Content-type: image/jpeg'); // Create image from existing image $jpgImage = imagecreatefromjpeg('file.jpg'); // Allocate color for text $white = imagecolorallocate($jpgImage, 255, 255, 255); // Set Path to Font File $font = 'arialbd.ttf'; // Text to print to image $text = 'Testing text output'; // Print Text On Image imagettftext($jpgImage, 75, 0, 50, 400, $white, $font, $text); // Send Image to Browser imagejpeg($jpgImage); // Clear Memory imagedestroy($jpgImage); ?&gt; Can Bootstrap 3 be used to accomplish this task? Thank you
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/44252505
upvote count: 1
has comment: http://stackoverflow.com/comment/44253748
type: Question
has comment: http://stackoverflow.com/comment/44259546
has comment: http://stackoverflow.com/comment/44296744
linked to: http://stackoverflow.com/q/18220462
has comment: http://stackoverflow.com/comment/44262958
tagged with: javascript
tagged with: jquery
has title: Output a PHP GD image as a popup(modal) after it has been sent to the browser
has comment: http://stackoverflow.com/comment/44249700
has comment: http://stackoverflow.com/comment/44249692
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44296724

http://stackoverflow.com/comment/44286660
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27941789
has text: My [updated fiddle](http://jsfiddle.net/npw6m0su/7/) keeps reflows minimal. Hope it helps! And again, [templating frameworks](http://handlebarsjs.com/) are awesome!

cytoscape-web
type: Tag
tags question: http://stackoverflow.com/q/27928151
tag name: cytoscape-web

http://stackoverflow.com/q/27908707
score: 0
has comment: http://stackoverflow.com/comment/44316166
tagged with: http://stackoverflow.com/tag/html
has title: Submit Dynamically created HTML CheckBoxes to Database(MySQL)
has answer: http://stackoverflow.com/a/27908823
has body: Technologies: HTML, JS, PHP, MySQL I have some rows of data which are dynamically created. Now I want to update some rows which are checked by user for editing. It may be all rows OR some of them. Like this I have created ids of these rows like "checkbox_[Id of data in database]" Now I want to update data. how can I take checked Ids with $_POST to update?
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27908823
type: Question
has comment: http://stackoverflow.com/comment/44216862
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44286313
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27945484
has text: @Benjamin Trent At the moment I'm just going to have it go to a file and want the user to email it to me as an attachment

http://stackoverflow.com/a/27906169
type: Answer
has body: #Demo is not a form field, so when you submit it nothing will be passed to the server. Try this instead &lt;input id="demo" type="text" /&gt; Script &lt;script&gt; var x=document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.value = "Geolocation is not supported by this browser."; } } function showPosition(position) { x.value ="Latitude: " + position.coords.latitude + "&lt;br&gt;Longitude: " + position.coords.longitude; } getLocation(); &lt;/script&gt; UPDATE I figured there'd be more to this. Doesn't make sense to send those values as a combined string. Do this instead: &lt;input id="latitude" name="latitude" type="text" /&gt; &lt;input id="longitude" name="longitude" type="text" /&gt; Script &lt;script&gt; function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } } function showPosition(position) { document.getElementById("latitude").value = position.coords.latitude; document.getElementById("longitude").value = position.coords.longitude; } getLocation(); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/45080987
has comment: http://stackoverflow.com/comment/45052080
accepted answer of: http://stackoverflow.com/q/27906105
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27906105
has comment: http://stackoverflow.com/comment/44221438

http://stackoverflow.com/comment/44130722
comment on: http://stackoverflow.com/q/27864073
type: Comment
has text: Leave the localisation set to English, or perhaps there is some reason you want to use localisation?
score: 0
type: QuestionComment

http://stackoverflow.com/q/27899498
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44199041
favorite count: 0
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44198826
has answer: http://stackoverflow.com/a/27899537
accepted answer: http://stackoverflow.com/a/27899537
has body: I want to make a random images for each user who have no avatar. But the problem is random images just work for the first user. I'm using gambar1.png for first default images, then when page refresh it will turn into a different and random images. This is my view: &lt;img src="&lt;?php echo base_url()?&gt;image/gambar1.png" class="img-thumbnail" id="defatar"/&gt; user 1 &lt;img src="&lt;?php echo base_url()?&gt;image/gambar1.png" class="img-thumbnail" id="defatar"/&gt; user 2 This is the javascript: &lt;script type="text/javascript"&gt; var ErrorImages = new Array(); ErrorImages[0] = "&lt;?php echo base_url()?&gt;image/gambar1.png"; ErrorImages[1] = "&lt;?php echo base_url()?&gt;image/gambar2.png"; ErrorImages[2] = "&lt;?php echo base_url()?&gt;image/gambar3.png"; document.getElementById("defatar").src = ErrorImages[Math.floor(Math.random()*ErrorImages.length)]; &lt;/script&gt; The random images work for user 1 but not work for user 2. Any answer?
tagged with: php
answer count: 1
has title: Javascript - Random images foreach user
score: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/27841656
type: Question
tagged with: mobile
tagged with: jquery-mobile
tagged with: javascript
has title: How To maintain session in phoneGap
accepted answer: http://stackoverflow.com/a/27859548
answer count: 3
tagged with: phonegap
has body: I am unable to find any way how to handle this. I have developed one single page application in PhoneGap which is only login page. After login, I am redirecting it to web site. Now the thing is I have to maintain login status inside App. For Example if the user exit from application without logout then he should not get my login screen in next launch. It should directly go to the website. In android we can handle it using shared preferences that I know but I am totally new into PhoneGap. Also, when a user click on the logout Which is in the redirected website, My App's Login screen should appear instead of Website's Login Screen. I've googled it but cannot find anything Helpful
favorite count: 0
tagged with: cordova
possible better answer: http://stackoverflow.com/a/27841897
score: 6
upvote count: 7
has answer: http://stackoverflow.com/a/27841897
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27859548
has answer: http://stackoverflow.com/a/27853180

http://stackoverflow.com/q/27831276
upvote count: 2
has answer: http://stackoverflow.com/a/27831303
tagged with: css
accepted answer: http://stackoverflow.com/a/27831305
score: 2
type: AnsweredQuestion
has title: How can I use adjacent sibling selectors with "this" in JQuery?
has body: I have a list of various divs all with the same class. I am using the .each function to select individual ones on the user click (just as an example), and any actions after that naturally require this, so that it only selects the div in question. For example: $(".div").each(function(){ $(this).click(function(){ $(this).css("background","green"); }); }); But what if I wanted to make the next element in line turn green as well on the click? My first instinct would be to use adjacent sibling selectors but it appears that only works when using two absolute elements, i.e. $(".element1 + .element2"). I can't seem to get it to work with this. Here is a JSfiddle with a full example to play around with. How can I do this?
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27831305
tagged with: jquery-selectors
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/44068506
favorite count: 0
possible better answer: http://stackoverflow.com/a/27831303

http://stackoverflow.com/comment/95163177
type: AnswerComment
has text: I like your answer because it helped my fingers to code some better.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27868548

http://stackoverflow.com/q/27896611
downvote count: 0
favorite count: 0
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44269288
has comment: http://stackoverflow.com/comment/44194733
tagged with: node.js
tagged with: amd
tagged with: commonjs
answer count: 0
has body: I just wrote a module ( https://github.com/mercmobily/simpleDeclare ) and made it available as a Node module via NPM. It follows CommonJS. I would like to make it also available to people using Bower, and AMD-like loader, and a straight include using the browser. What's the current pattern to make this happen? Or, is it even possible? I remember seeing a few modules that did it, but cannot find them and am only finding outdated and not-so-definite information (but I suspect I am looking for the wrong thing).
has title: Make module available via AMD, bower, simple browser JS, and node
tagged with: javascript
type: UnansweredQuestion
score: 2

http://stackoverflow.com/comment/44152141
comment on: http://stackoverflow.com/q/27841400
has text: All changes are being done to the html page, Not the iframe.
score: 0
type: QuestionComment
type: Comment

knockout-sortable
tag name: knockout-sortable
type: Tag
tags question: http://stackoverflow.com/q/27954419

http://stackoverflow.com/comment/44229745
comment on: http://stackoverflow.com/q/27915329
score: 1
type: QuestionComment
has text: then it will not shown this update progress....Update Progress used when page take time for specific process which indicate to user that some process is running...
type: Comment

http://stackoverflow.com/q/27837158
has title: Unable to edit link on CKEditor
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44113233
has answer: http://stackoverflow.com/a/51534560
has answer: http://stackoverflow.com/a/64585809
has comment: http://stackoverflow.com/comment/44086308
has answer: http://stackoverflow.com/a/62653082
tagged with: hyperlink
has answer: http://stackoverflow.com/a/72255824
has comment: http://stackoverflow.com/comment/44274423
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/63779665
downvote count: 0
tagged with: javascript
tagged with: ckeditor
tagged with: jquery
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/44233375
has body: Just like the headline says, I am unable to edit links on CKEditor. I have a fresh installation and when I type in a text that I want to mark as a link, the link pop up opens with all the fields and buttons but they don't work - with exception of the Browse server button. They are not even in disabled color, they just don't work! Drop-down menus don't open and text areas/fields are not editable! I have tried to update with the latest jquery version, I tested without other plugins that also use javascript and would might get in conflict but it still does not work. Yes, I have also tested with a clean cache! The only way to edit a link is to do it on source mode. So, any suggestions on what the problem is? Here is the config.js: CKEDITOR.editorConfig = function( config ) { config.filebrowserBrowseUrl = 'kcfinder/browse.php?type=files'; config.filebrowserImageBrowseUrl = 'kcfinder/browse.php?type=images'; config.filebrowserFlashBrowseUrl = 'kcfinder/browse.php?type=flash'; config.filebrowserUploadUrl = 'kcfinder/upload.php?type=files'; config.filebrowserImageUploadUrl = 'kcfinder/upload.php?type=images'; config.filebrowserFlashUploadUrl = 'kcfinder/upload.php?type=flash'; // Define changes to default configuration here. // For the complete reference: // http://docs.ckeditor.com/#!/api/CKEDITOR.config // The toolbar groups arrangement, optimized for two toolbar rows. config.toolbarGroups = [ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, { name: 'links' }, { name: 'insert' }, { name: 'forms' }, { name: 'tools' }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'others' }, '/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, { name: 'styles' }, { name: 'colors' }, { name: 'about' } ]; // Remove some buttons, provided by the standard plugins, which we don't // need to have in…
answer count: 5
has comment: http://stackoverflow.com/comment/44232233
has comment: http://stackoverflow.com/comment/44080870
has comment: http://stackoverflow.com/comment/44080669

http://stackoverflow.com/comment/44163267
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27880722
has text: Making the URL absolute may not work when deployed to a web application that is not under the domain root.

http://stackoverflow.com/q/27859273
tagged with: javascript
has answer: http://stackoverflow.com/a/27859922
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27859922
downvote count: 1
type: Question
type: AnsweredQuestion
has title: How to show radio buttons from panel in javascript
score: -1
has body: i want to do, onclick of any radio button from panel1, show panel2 radio buttons and according to panel2 radio button selection display panel3 options. On window load event hide panel2 and panel3. only first event panel will displayed. I don't know where i am going wrong, please anybody can help me. window.onload=function(){ document.getElementById("right").style.display='none'; document.getElementById("right1").style.display='none'; } jQuery(function($) { $('a.panel').click(function() { var $target = $($(this).attr('href')), $other = $target.siblings('.active'); if (!$target.hasClass('active')) { $other.each(function(index, self) { var $this = $(this); $this.removeClass('active').animate({ left: $this.width() }, 500); }); $target.addClass('active').show().css({ left: -($target.width()) }).animate({ left: 0 }, 500); } }); }); function accordion() { if(document.getElementById("select1").checked) { document.getElementById('right').style.display='block'; document.getElementById('right1').style.display='none'; } } #left{ position: relative; float: left; margin: 0 5px 0 0; border: 1px solid black; width: 200px; background-color: rgb(252, 203, 139); height: 300px; overflow: hidden; } #right{ /*position: relative; float: left;*/ margin: 0 5px 0 0; border: 1px solid black; width: 146px; background-color: rgb(252, 203, 139); height: 290px; overflow: hidden; position: absolute; top: 104px; z-index: 1; right: 1055px; } #right1{ margin: 0 5px 0 0; border: 1px solid black; width: 146px; background-color: rgb(252, 203, 139); height: 290px; overflow: hidden; position: absolute; top: 215px; z-index: 1; right: 1000px; } div.panel { position: absolute; height: 100%; width: 100%; display: none; } Option 1 Option 2 Option 3 Que1 Que2 Que3 Que4 Que5 Que6 Link1 Link2 Link3 Link4 Link5 Link6 Link1 Link2 Link3 Link4 Link5 Link6 Link1 Link2 Link3 Link4 Link5 Link6
upvote count: 0
answer count: 1

http://stackoverflow.com/a/44296941
answers question: http://stackoverflow.com/q/27886677
score: 32
type: Answer
has body: You could also do it with a function chain. const type = base64Data.split(';')[0].split('/')[1];
has comment: http://stackoverflow.com/comment/140075646
has comment: http://stackoverflow.com/comment/140142135
upvote count: 36
has comment: http://stackoverflow.com/comment/140072653
downvote count: 4

http://stackoverflow.com/a/27814898
type: Answer
answers question: http://stackoverflow.com/q/27814421
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44041321
has comment: http://stackoverflow.com/comment/44040738
has comment: http://stackoverflow.com/comment/44041628
has comment: http://stackoverflow.com/comment/44041250
has body: Hi is this what you need ? http://jsfiddle.net/gkefk/51/ //Not draggable and centering for the sticky class if($(ui.helper).hasClass("sticky")){ console.log(); var image = new Kinetic.Image({ name: data, id: "image"+(imageCount++), x: $stageContainer.width() / 2 - ($(ui.helper).width() / 2), y: $stageContainer.height() / 2 - ($(ui.helper).height() / 2), image: theImage, draggable: true, // restrict to allow horizontal dragging only dragBoundFunc: function(pos) { return { x: pos.x, y: this.getAbsolutePosition().y } } }); }else{ //all other elements var image = new Kinetic.Image({ name: data, id: "image"+(imageCount++), x: x, y: y, image: theImage, draggable: true }); }
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27814421

http://stackoverflow.com/comment/44172980
type: Comment
comment on: http://stackoverflow.com/a/27885902
has text: Great! That simple line of code you gave solved my entire issue, thank you for that. I was re-sizing it when I was moving the mouse, which is why it was not causing the issue there.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27887960
tagged with: d3.js
score: 0
has answer: http://stackoverflow.com/a/27888786
answer count: 1
has body: I try to make pie chart with dimple library it works for all chart type like line, bubble and bar but when i try with pie chart I get the following error Error: Invalid value for &lt;path&gt; attribute d="MNaN,NaNA5,5 0 1,1 NaN,NaNL0,0Z" This is the code &lt;script type="text/javascript"&gt; var svg = dimple.newSvg("#chartContainer", 590, 400); var array1=[10,20,30,40,50]; var array2=[600,300,400,200,100]; var data = new Array(); for (var i = 0; i &lt; array1.length; ++i) { data.push({ x : array2[i], y: array1[i]}); } var myChart = new dimple.chart(svg, data); myChart.setBounds(60, 30, 510, 305) var x = myChart.addCategoryAxis("x", "x"); myChart.addMeasureAxis("y", "y"); myChart.addSeries(null, dimple.plot.pie); myChart.draw(); &lt;/script&gt; Can anyone help me please?
has title: Error: Invalid value for <path> attribute d="MNaN,NaNA5,5 0 1,1 NaN,NaNL0,0Z"
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: dimple.js

http://stackoverflow.com/q/27847473
score: 1
has answer: http://stackoverflow.com/a/27849661
upvote count: 1
type: Question
has body: I am using Bing map ajax control. In my code i have something as below - function getMap() { map = new Microsoft.Maps.Map(document.getElementById('mnMap'), { credentials: 'MyKey', mapTypeId: Microsoft.Maps.MapTypeId.road }); map.setView({ zoom: 4, center: new Microsoft.Maps.Location(defaultLat, defaultLan) }); Microsoft.Maps.loadModule('Microsoft.Maps.Directions', { callback: createDirectionsManager }); } function createDirectionsManager() { if (!directionsManager) { directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map); } directionsManager.resetDirections(); directionsManager.setRenderOptions({ itineraryContainer: document.getElementById('directionsPanel') }); directionsErrorEventObj = Microsoft.Maps.Events.addHandler(directionsManager, 'directionsError', displayRouteError ); directionsUpdatedEventObj = Microsoft.Maps.Events.addHandler(directionsManager, 'directionsUpdated', displayUpdatedRoute ); } function displayUpdatedRoute(status){ // update waypoint text inputs based on dragged markers var legs = directionsManager.getAllWaypoints(); // Do some validation } function displayRouteError(error){ // If the error is a viapoint error, display an error if (error.responseCode == Microsoft.Maps.Directions.RouteResponseCode.noSolution){ directionsManager.resetDirections(); }else if (error.responseCode == Microsoft.Maps.Directions.RouteResponseCode.dataSourceNotFound || error.responseCode == Microsoft.Maps.Directions.RouteResponseCode.tooFar){ directionsManager.resetDirections(); }else{ directionsManager.resetDirections(); } } function getDirections(submit, send) { directionsManager.resetDirections(); if (some test condition) { start = new Microsoft.Maps.Directions.Waypoint({ location: new Microsoft.Maps.Location(locInputs.first().attr("data-lat"), locInputs.first().attr("data-lng")) }); } else { start = new Microsoft.Maps.Directions.Waypoint({ address: locInputs.first().val() }); } directionsManager.addWaypoint(start); // waypoint values come from UI b…
tagged with: javascript
tagged with: bing-maps
accepted answer: http://stackoverflow.com/a/27849661
tagged with: driving-directions
answer count: 1
downvote count: 0
has title: Bing: directionsManger.getAllWaypoints() doesn't return latitude/longitude
has comment: http://stackoverflow.com/comment/44099005
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/a/27866134
has body: Use the Sorted Set data structure - leaderboards are a classic use case for it. Set the memeber's value to the player ID and the score as the player's score. You can then perform efficient ranges (the z[rev]rangebyscore commands) server-side and the results are already sorted. In most cases, this will be much faster than any client-side post processing because of the savings in network traffic.
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/44141901
upvote count: 1
answers question: http://stackoverflow.com/q/27865321
downvote count: 0
has comment: http://stackoverflow.com/comment/44139617

http://stackoverflow.com/q/27874055
answer count: 2
has answer: http://stackoverflow.com/a/27874411
tagged with: javascript
has comment: http://stackoverflow.com/comment/44150499
score: 0
favorite count: 0
tagged with: asp.net-mvc-4
has answer: http://stackoverflow.com/a/27874344
has comment: http://stackoverflow.com/comment/44151954
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44167435
upvote count: 1
downvote count: 1
has title: acess session in view (javascript) from the controller
tagged with: c#
has body: This is my controller code. I want to get values stored in session in view(javascript code) decimal.TryParse(permotion.PROMOTION_AMOUNT.ToString(), out promotionAmount); int.TryParse(permotion.PROMOTION_TYPE_ID.ToString(CultureInfo.InvariantCulture), out promotionTypeId); Session["PromotionAmount"] = promotionAmount; Session["TypeId"] = promotionTypeId; view code is: var amount='@Session["PromotionAmount"]'; var id='@Session["TypeId"]'; alert(amount) alert(id) but this java-script code is returning empty string. How I can retrieve session value in view? Thanks in advance.
type: Question

http://stackoverflow.com/q/27814621
has answer: http://stackoverflow.com/a/27814824
upvote count: 4
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27814697
has answer: http://stackoverflow.com/a/30847757
type: Question
has body: is there any indication from $http if the response brought from the cache? For example lets say I have made this two calls: $http.get({url, cache: true).then(function(response, ..., moreData) { alert(moreData.fromCache) }) //alerts false $http.get({url, cache: true).then(function(response, ..., moreData) { alert(moreData.fromCache) }) //alerts true as you can see the first call is really executing an ajax call so it is not from cache, the second one brings the data from cache so it alerting true
has answer: http://stackoverflow.com/a/27814697
possible better answer: http://stackoverflow.com/a/27814824
tagged with: javascript
score: 4
tagged with: caching
answer count: 3
has title: How can I know if the $http response is brought from cache - angularjs
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/44119463
has text: So you are saying that as long as I set the cookie it will apply to my entire website not just a specific webpage? So that I can check the 'global' cookie from any page in my website?
type: Comment
comment on: http://stackoverflow.com/a/27858304
type: AnswerComment
score: 0

bayesian-networks
type: Tag
tags question: http://stackoverflow.com/q/27830677
tag name: bayesian-networks

http://stackoverflow.com/comment/44195054
has text: Ohh! He also said the same thing. Enjoy if u got any help. If not find alternate bro.Why u want to make it complex when easy ways are out there to do it.
comment on: http://stackoverflow.com/a/27897262
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27862111
answer count: 2
has body: i want to create a simple webshop for doors and i want to have function where to custom door users can change the color or the texture. But the only way i imagine to do that is to create single .jpg files for all of the doors in all textures and all colors and the to change it. Is there any library or any way i can do the masking and texturing on web? the doors are like these : and the texture is like these: I have created separete base door, so if the user is changing the door types only the above layer appears with a special style and glass. but i am unable to crate texturized styling and texturized doors.
possible better answer: http://stackoverflow.com/a/27862261
tagged with: javascript
has comment: http://stackoverflow.com/comment/44126513
linked to: http://stackoverflow.com/q/3796025
has title: is it possible to put texture mask on image using any web language?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27862476
tagged with: css
favorite count: 0
downvote count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/44126788
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/27862476
score: 1
has answer: http://stackoverflow.com/a/27862261
tagged with: image
has comment: http://stackoverflow.com/comment/44126429
type: Question

http://stackoverflow.com/comment/44180025
score: 1
has text: And now you want somebody to code the whole app for you? Please hire a coder for that.
comment on: http://stackoverflow.com/q/27889508
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44023667
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27807183
has text: @AndreCalenta - please edit your question to put the actual type of string you're getting because now that you've disclosed that in your comments, it changes the ENTIRE question. Always include sample data for questions like this. It makes the question a lot clearer. All prior answers are worthless because you're code was completely wrong for parsing your data string.

http://stackoverflow.com/q/27927994
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: Fancybox 2.1.5 not scrolling with page (vertical centering)
has body: I'm updating my site and I'm having a problem where on my illustration page (a really tall page with about 600 images), the fancybox will not center vertically if you scroll down. So if you go down the page and click an image, the screen just dims a bit as the box appears off-screen. This behavior only seems to affect chrome (out of the 3 I tested chrome, firefox and ie), and I've seen questions similar to this with answers I couldn't apply to the code I have in place. Here's the problem page I have modified the code with my own theme, and wonder if I may have just fudged something. here's the script on the server for reference Thanks much!
has answer: http://stackoverflow.com/a/27928770
type: UnansweredQuestion
score: 0
tagged with: fancybox-2
type: Question
answer count: 1

http://stackoverflow.com/q/27824517
tagged with: css
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27825067
accepted answer: http://stackoverflow.com/a/27825067
tagged with: javascript
score: 0
has body: I'm attempting to build a simple slide out menu, I have it working fine using the menu button. {{filter.filter_type}} CSS .side-menu { left: -25%; position: absolute; transition: all 0.2s linear 0s; width: 25%; background: #000; } .side-menu.show_menu { left:0%; } When I press the menu-button div it works fine (i.e it adds the class), however I also want to be able to close the menu when an item inside it is picked, I have tried the above but nothing is happening. I thought originally it had to do with the fact that its calling another function too, but I even removed that and there's still the same issue. Am I misunderstanding how ng-click works?
has comment: http://stackoverflow.com/comment/44055322
answer count: 1
has title: ng-click change parent class
tagged with: angularjs

http://stackoverflow.com/comment/44307390
comment on: http://stackoverflow.com/q/27956266
score: 0
type: Comment
type: QuestionComment
has text: Ok, I see Roko. So if I *were* to use Javascript, what would be the lightest way to implement this?

http://stackoverflow.com/q/27902556
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27903111
tagged with: couchdb
favorite count: 0
type: AnsweredQuestion
score: 1
upvote count: 1
has title: How to query for an element in an array
has answer: http://stackoverflow.com/a/27903111
type: Question
tagged with: javascript
tagged with: mapreduce
has body: The following documents are stored in CouchDB { { "_id": "1", "_rev": "3-2882a4696d580cdef754a93c7e5e77e7", "comb": [ "4-5", "4-6", "5-6" ] }, { "_id": "2", "_rev": "2-1991a898a5457308e3a89253e695cef5", "comb": [ "4-5", "5-6" ] } } Below is the map function function(doc) { emit(doc.comb, null); } and http://localhost:5984/comb/_design/snp/_view/by_test?key="4-6" returns only {"total_rows":2,"offset":0,"rows":[ ]} How is it possible to find an element in an array?

http://stackoverflow.com/comment/44333401
type: Comment
type: QuestionComment
has text: the json was not correct and was missing commas. please create an answer for this so i can accept it.
comment on: http://stackoverflow.com/q/27954413
score: 0

http://stackoverflow.com/comment/44141762
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27869584
has text: That sort of works, but if you select maybe, and then change the answer to yes or no, the maybe stays open.

http://stackoverflow.com/q/27883044
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/27883354
has comment: http://stackoverflow.com/comment/44168127
has comment: http://stackoverflow.com/comment/44168573
has comment: http://stackoverflow.com/comment/44168031
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44169022
type: Question
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44169013
tagged with: javascript
has body: I have a JSON this way: "db" : { "x" : { "0" : "A", "1" : "B", "2" : "C", "3" : "D", "4" : "E", "5" : "F", "6" : "G", "7" : "H", "8" : "I", "9" : "J", "10" : "K", "11" : "L", "12" : "M", "13" : "N" } In the controller I have: $scope.object = currentObject.get(); $scope.x = $scope.object.db.x; (currentObject.get() is a function I made to take data from the DB, and in the DB there the JSON I've written before) And in the view: {{y}} I expected the result to be this: A B C etc. etc. Instead what I see is that: A K L M N B etc. etc. How to fix this with orderBy in ng-repeat?
has comment: http://stackoverflow.com/comment/44168068
has comment: http://stackoverflow.com/comment/44168061
has title: Angular - using orderBy in ng-repeat to order in increasing order
has comment: http://stackoverflow.com/comment/44167869
favorite count: 0
has comment: http://stackoverflow.com/comment/44168345
has comment: http://stackoverflow.com/comment/44168287

http://stackoverflow.com/a/27837374
answers question: http://stackoverflow.com/q/27837100
type: Answer
has body: Here is the working example where there can be multiple elements with same ID, and yet it will work fine: JSFIDDLE $(document).ready(function(){ $("body").on("click",".product-photo-thumb", function (e) { e.preventDefault(); alert($(this).children("img").attr("alt")); }); });
upvote count: 2
score: 2
downvote count: 0

http://stackoverflow.com/q/27832552
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/27832572
type: Question
has body: I am wondering why, when creating a new stream class in node, I need to use both call and util.inherits For instance, in the following code, which is used to create a readable stream, I have to use both: var Readable = require('stream').Readable; var util = require('util'); var MyStream = function (options) { Readable.call(this, options) } util.inherits(MyStream, Readable); //Hasn't this already inherited all methods from Readable via "call" var stream = new MyStream(); It seems to be that Readable.call is calling the constructor from Readable and therefore the util.inherits is unnecessary.
accepted answer: http://stackoverflow.com/a/27832572
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: inheritance
favorite count: 0
has title: Why use util.inherits and .call for inheritance in Node.js
tagged with: node.js

http://stackoverflow.com/a/27902015
accepted answer of: http://stackoverflow.com/q/27901929
has body: Yes, these hooks are called Custom Management Commands. You can easily create custom manage.py command and call gulp from it via python's built-in os or subprocess modules.
answers question: http://stackoverflow.com/q/27901929
score: 3
upvote count: 3
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/comment/56148947
type: AnswerComment
comment on: http://stackoverflow.com/a/27928475
has text: @vsync the word would be basic, not simple I guess. Most gulp pipe functions need to send data thru them this way.
type: Comment
score: 0

http://stackoverflow.com/comment/44274781
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27939055
type: AnswerComment
has text: And you can write webmthod in a page and create a function that in JS in which your ajax method will be called. You can reuse that function.

http://stackoverflow.com/q/27825220
tagged with: linux
tagged with: pm2
tagged with: command-line
type: UnansweredQuestion
has body: According to this question, pm2 should restart crashed applications. When my application crashes nothing happens and the process is missing from pm2 list. Do I have to somehow activate an 'auto restart option'? I am using: pm2 v0.12.3 node v0.11.14 Amazon Linux
upvote count: 1
has title: Restart node.js after crash in pm2
has answer: http://stackoverflow.com/a/42736147
tagged with: node.js
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44067361
linked to: http://stackoverflow.com/q/26135371
answer count: 2
has answer: http://stackoverflow.com/a/32173707
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/27906308
has body: I need something like a fill in the blanks sheet for children. When people click the ------ (dashes) it should turn into a textbox, and people can type it. after that when they move from that element after typing, it should turn into the text that they entered inside that text box. I really dono how to approach this problem. I tried the following code, but what happens is, i am unable to type inside the text box. The cursor is not appearing at all NSP Automation My Name is = __________ any pointers on how to achieve this ? Thanks,
type: Question
has answer: http://stackoverflow.com/a/27906711
tagged with: javascript
tagged with: jquery
has title: Javascript to dynamically add textbox , and again convert the text box to text
accepted answer: http://stackoverflow.com/a/27906711
possible better answer: http://stackoverflow.com/a/27906478
has answer: http://stackoverflow.com/a/27906478
downvote count: 0
has answer: http://stackoverflow.com/a/27906411
has comment: http://stackoverflow.com/comment/44212613
favorite count: 0
upvote count: 2
answer count: 5
has answer: http://stackoverflow.com/a/27906533
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27906627

http://stackoverflow.com/comment/98225363
type: AnswerComment
comment on: http://stackoverflow.com/a/27908068
type: Comment
has text: @MicahZoltu you're right. I'll edit my answer to fix it.
score: 0

http://stackoverflow.com/a/27957506
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: Use the core-media-query element to capture responsive changes: Use the flex attribute on your columns to get the 50-50 width. Also use the {{phoneScreen}} (set by the core-media-query) to determine if we should use the horizontal layout or not 50% 50% Example: http://plnkr.co/edit/WxUFCWFQVMeBgXSLI32M?p=preview
accepted answer of: http://stackoverflow.com/q/27954839
type: Answer
answers question: http://stackoverflow.com/q/27954839
score: 2

http://stackoverflow.com/comment/44017266
type: AnswerComment
comment on: http://stackoverflow.com/a/27804136
has text: Why would OP need this instead of a simple `try-catch`?
type: Comment
score: 0

http://stackoverflow.com/comment/44234989
has text: My gut feeling (which is why this is a comment rather than an answer) is that you won't be able to do this with a single regex
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27918439

http://stackoverflow.com/comment/44265737
has text: I think OP meant that the text itself would contain a link, not an anchor element.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27934028
type: AnswerComment

http://stackoverflow.com/q/27924152
has comment: http://stackoverflow.com/comment/44245143
has body: Actually i wants to upload a image file into server folder using jquery/javascript and without using any severside scripting. is it possible? pls guide me
has answer: http://stackoverflow.com/a/27924773
type: Question
has comment: http://stackoverflow.com/comment/44245331
downvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/44245228
has comment: http://stackoverflow.com/comment/44245392
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44245453
has title: Is it possible to upload a image into server folder without using any severside scripting language
score: -5

http://stackoverflow.com/q/27947044
has body: I have problems on my phone when toggling the slidebar with the menu button. The button calls the .toggle() function of jQuery. You can see it there: www.kwk.artfulsolutions.de (resize window to the mobile version). It's only happening one exactly 1 device of me: Oneplus One. and only in chrome. All other smartphones don't have problems. And it happens on every Oneplus One (asked other people). So I looked at the timeline of Google Chromes dev tools. this is what happens: as you can see it takes over 2 seconds. and this is quite annoying. even when I'm toggling the menu items in the side bar. so everytime the display attribute changes... how to fix this? JSFiddle: http://jsfiddle.net/wrmz99be/
answer count: 0
score: 0
type: Question
has comment: http://stackoverflow.com/comment/44289377
tagged with: javascript
has title: Jquery .toggle() needs about 2 seconds
has comment: http://stackoverflow.com/comment/44288966
has comment: http://stackoverflow.com/comment/44289719
tagged with: jquery
type: UnansweredQuestion
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/44057221
has text: Nope, they may be (and are) totally different. I need to know if they are an instance of the same React.createClass().
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27824548

http://stackoverflow.com/comment/44106322
score: 0
comment on: http://stackoverflow.com/q/27850817
type: QuestionComment
has text: Sorry, that doesn't seem to be enough to reproduce the problem. http://jsfiddle.net/6q5x7ru5/
type: Comment

http://stackoverflow.com/comment/44254305
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27928388
has text: The React tutorial is about this: http://facebook.github.io/react/docs/tutorial.html
type: Comment

http://stackoverflow.com/comment/44382107
comment on: http://stackoverflow.com/a/27995277
type: AnswerComment
has text: changing the order gotoDate and ChangeView got it working for me on my code
score: 0
type: Comment

http://stackoverflow.com/comment/44249434
score: 1
type: Comment
type: QuestionComment
has text: `input.files` is your array. shouldn't you check it's length rather than `input`?
comment on: http://stackoverflow.com/q/27926070

http://stackoverflow.com/a/27959875
has comment: http://stackoverflow.com/comment/44313962
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27958553
answers question: http://stackoverflow.com/q/27958553
has body: If you want the script code modules to act as code libraries without any static initializers then you can enforce it by declaring it in coding conventions If you want the static initializers and other side-effects not to appear until the run-time then you can postpone the script activation through delay loading the script when it is required for the first time If you want to have more fine-grained control over the scripting environment than you can implement a scripting host and interact with the script engines more directly (e.g. using the IActiveScriptParse interface will not probably trigger any unexpected side-effects). MSDN: Windows Script Interfaces ...To make implementation of the host as flexible as possible, an OLE Automation wrapper for Windows Script is provided. However, a host that uses this wrapper object to instantiate the scripting engine does not have the degree of control over the run-time name space, the persistence model, and so on, that it would if it used Windows Script directly. The Windows Script design isolates the interface elements required only in an authoring environment so that nonauthoring hosts (such as browsers and viewers) and script engines (for example, VBScript) can be kept lightweight...
has comment: http://stackoverflow.com/comment/44349384
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44122220
type: QuestionComment
has text: i get this problem now :( ''bower ENOGIT git is not installed or not in the Path '' ill google it now but if you know that will be helpful :)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27859658

http://stackoverflow.com/comment/44112144
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27854095
score: 0
has text: Did you see the section ["**Submitting Images to a Server**"](https://github.com/jhuckaby/webcamjs#submitting-images-to-a-server) in the documentation.

http://stackoverflow.com/comment/65263796
type: Comment
comment on: http://stackoverflow.com/a/30075650
type: AnswerComment
has text: @Siteogra, see [this jsFiddle](http://jsfiddle.net/d49c8jLL/175/) for an example.
score: 0

http://stackoverflow.com/q/27864091
has answer: http://stackoverflow.com/a/69813377
tagged with: javascript
has title: Memory leak with d3.js keyed join in event handler closure
possible better answer: http://stackoverflow.com/a/69813377
tagged with: memory-leaks
favorite count: 0
tagged with: d3.js
has answer: http://stackoverflow.com/a/30353584
has comment: http://stackoverflow.com/comment/44130889
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
answer count: 2
has body: It appears that event-handling closures can cause DOM nodes to be leaked if they refer to a d3.js selection that uses a keyed data join. Why does this happen? Is it an issue with d3.js or with the way it is being invoked? This example leaks HTMLLIElement objects when step is called repeatedly (clickHandler does not have to be executed): function getKeys(n) { // returns a random array of n unique Strings, e.g. ["Alpha", "Quebec", "Charlie"] } function step() { function clickHandler() { // removing this reference removes the leak // (note that the outer variable is pulled into closure scope regardless of whether this function is called). listItems; } var keys = getKeys(3); var listItems = d3.selectAll('li') .data(keys, function(d) { return d }); listItems.enter() .append('li') .text(function(d) { return '#' + d }) .on('click', clickHandler) listItems.exit() .remove() } JSBin DevTools-friendly version This pattern is reproducible with D3.js 3.5.3 and identifiable in Chrome 39. It appears that DOM nodes are leaked when two criteria are met: The selection has a key function A closure, which is used as an event handler for one of the nodes in the selection, has a reference to the outer scope selection. The closure does not have to be executed. Any of these steps prevent a memory leak: Not using a key function in the call to data Adding listItems = null at the end of step Avoiding a reference to the outer selection in the closure Adding listItems = null in the click handling closure. The latter point is especially interesting because it releases all of the leaked nodes, not just those in the current listItems selection. This implies that the selections are linked, which I did not expect. Inspecting a heap snapshot in Chrome DevTools shows that the leaked HTMLLIElement objects have two distinct listItems in their retainer hierarchy: Is this expected behaviour? If so, what causes it? Is this a memory leak in my code or in d3.js?
accepted answer: http://stackoverflow.com/a/30353584
downvote count: 0

http://stackoverflow.com/comment/44197566
score: 0
type: QuestionComment
type: Comment
has text: I like Hammer JS better, but thanks for the input.
comment on: http://stackoverflow.com/q/27898459

http://stackoverflow.com/comment/44073668
score: 0
type: Comment
has text: *window.func1* inherits a *constructor* property from *func1.prototype* which references *func1*. So in the first example, more *func1* instances can be created using `new func1.constructor()`. Unpleasant, but possible. It also means that the execution context of the IIFE that creates *window.func1* is held in a persistent closure, so uses more memory than perhaps it shoud (though probably an insignificant amount).
comment on: http://stackoverflow.com/a/27834090
type: AnswerComment

http://stackoverflow.com/comment/44062200
has text: sorry if it took me a while to explain, is a bit complicated. Anyway, is acceptable, sure, but could u help me with this please?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27826263
type: AnswerComment

http://stackoverflow.com/q/27868169
tagged with: css
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/27868243
downvote count: 1
type: Question
has title: How to remove three styles from HTML table while cloning a new one
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27868243
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have the following script which takes rows from an existing table in an ASP.net page and opens a new window with the table. One of the cell in the ASP.net table has a DIV inside which forces anything extra to be removed and shows only "...". When the user hover overs, it displays the entire text with JavaScript. Here is a sample of the table cell: Dr john; Dr. Mike; Dr. Kilt; Dr. Poland; Dr. James; Dr. Quint; Dr. Jose; Dr. Ashton; Dr. Giannis; Dr. Maroudis; Shows up like this: The above works fine when viewing on the computer, because I can just hover over and it will show the rest of the text. When printing (creating the dynamic table in the script above). How can I eliminate the following style: overflow: hidden; text-overflow: ellipsis; white-space: nowrap; from each TD in the copy process, so the cell just expands to display everyone?

http://stackoverflow.com/comment/92580020
has text: I think the more important thing than speed performance here is the **Memory** Leaks or overhead it may impose to create many new XMLHttpRequest object each time!
type: QuestionComment
comment on: http://stackoverflow.com/q/27888471
score: 0
type: Comment

http://stackoverflow.com/a/27867435
type: Answer
accepted answer of: http://stackoverflow.com/q/27867386
score: 3
upvote count: 3
has body: You're passing the string "Eve" to the function and not the object that the variable Eve points to. Remove the quotes.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27867386
has comment: http://stackoverflow.com/comment/44137407
has comment: http://stackoverflow.com/comment/44138428

http://stackoverflow.com/q/27889545
type: AnsweredQuestion
upvote count: 5
tagged with: eclipse
has title: How to display javascript console.log in eclipse console?
type: Question
score: 5
answer count: 3
possible better answer: http://stackoverflow.com/a/66180802
has answer: http://stackoverflow.com/a/66180802
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27889665
favorite count: 0
has answer: http://stackoverflow.com/a/72243023
has body: Title says it all. I am wondering if i can display javascript console.log in eclipse console rather than web browser's dev console?
has comment: http://stackoverflow.com/comment/44180174
has comment: http://stackoverflow.com/comment/44180122
has answer: http://stackoverflow.com/a/27889665

http://stackoverflow.com/q/27929504
has comment: http://stackoverflow.com/comment/44256222
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44256159
has comment: http://stackoverflow.com/comment/44256203
has comment: http://stackoverflow.com/comment/44256141
answer count: 2
upvote count: 7
has title: External JavaScript function undefined, but exists
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27929692
has answer: http://stackoverflow.com/a/27929692
has comment: http://stackoverflow.com/comment/44256510
favorite count: 0
has comment: http://stackoverflow.com/comment/44256126
accepted answer: http://stackoverflow.com/a/27929758
type: AnsweredQuestion
downvote count: 0
has body: I have 2 files, one HTML, one JavaScript. JavaScript File (contacts.js): function add_contact() { // Rest of Code here } HTML File: I have a button that when it's clicked, it calls the 'add_contact' function: Save changes When the JavaScript code is the head of the HTML file, the function works fine. However, now it's part of the external file, it returns the following error: Uncaught ReferenceError: add_contact is not defined I feel a bit lost over this one, so any help would be fantastic!
score: 7
has answer: http://stackoverflow.com/a/27929758

http://stackoverflow.com/q/27853969
upvote count: 1
tagged with: php
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to show html template in ckeditor using javascript/jquery?
has comment: http://stackoverflow.com/comment/44113169
tagged with: http://stackoverflow.com/tag/html
score: 1
has body: I am using window popup and selecting template from that window. Now I want to show selected html template in ckeditor in another window. I tried following code but is showing me html content in ckeditor instead of html template. function sendValue(selvalue){ $.getJSON("A2B_entity_mailtemplate.php", { id: ""+ selvalue, action: "load" }, function(data){ window.opener.CKEDITOR.instances.msg_mail.setData(unescape(data.messagetext)); window.opener.document.getElementById('from').value = data.fromemail; window.opener.document.getElementById('fromname').value = data.fromname; window.opener.document.getElementById('subject').value = data.subject; window.close(); }); } I have also tried following but it is also not working for me. if (window.opener.CKEDITOR.instances.msg_mail.mode == 'wysiwyg') { window.opener.CKEDITOR.instances.msg_mail.insertHtml(unescape(data.messagetext)); } else { window.opener.CKEDITOR.instances.msg_mail.setMode('wysiwyg', function() { window.opener.CKEDITOR.instances.msg_mail.insertHtml(unescape(data.messagetext)); window.opener.CKEDITOR.instances.msg_mail.setMode('source'); }); } So how can I get html template instead of html content in ckeditor? Any help/suggestion would be appreciated.
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27849882
tagged with: typescript
has answer: http://stackoverflow.com/a/27851854
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44105874
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27850581
upvote count: 3
has title: Declaring TypeScript member in prototype rather than adding to 'this'
has comment: http://stackoverflow.com/comment/44106931
has comment: http://stackoverflow.com/comment/44107007
has body: The following TypeScript: class A { member = "value"; } ...is compiled to: var A = (function () { function A() { this.member = "value"; } return A; })(); I want to achieve the following: var A = (function () { function A() { } A.prototype.member = "value"; return A; })(); The reason for this is that I believe that the latter construct could be more efficient because (1) the assignment this.member = "value" statement would not have to be executed every time a new instance is created, and (2) instance memory payload would be smaller. Disclaimer: I haven't bench marked the two constructs so I really don't know whether that is the case. So my question is: Is it possible to declare a "prototype member" using type script?. I'd also be happy if someone could explain why type script is designed this way?. (See §8.4.1 in the specification) I understand that it would be stupid to declare mutable members in this way, but declarations of immutable primitives, like string and number, should be fine to set on the prototype, right? A possible work around could be: class A { member: string; } A.prototype.member = "value"; However, that won't work for private members: class A { private member: string; } A.prototype.member = "value"; // error TS2107: 'A.member' is inaccessible.
has comment: http://stackoverflow.com/comment/44107260
favorite count: 0
accepted answer: http://stackoverflow.com/a/27851854
has comment: http://stackoverflow.com/comment/44105515
has answer: http://stackoverflow.com/a/27850581

http://stackoverflow.com/comment/44058293
type: QuestionComment
comment on: http://stackoverflow.com/q/27826148
score: 0
has text: Any reason why people are downvoting this? At lease be adult enough to explain to me why. I, like others posting on here are trying to learn. Thanks.
type: Comment

http://stackoverflow.com/q/27879908
has body: It's a long story. Please bear with me till the end. I have two parent divs #c1 and #c2 (there are actually 5, just for the sake of example). Both have some child divs. Each clild div has a delete div which on being clicked deletes that particular child div and the first child div from #c2 takes it's place (Just like a queue. Where a if person leaves, others behind him move forward). HTML looks like this: Now when 'a' or 'b' or 'c' is deleted then 'd', 'e' and 'f' move one place up. So now '#c1' has a,b and d and '#c2' has e and f. Here is my jquery code : $(".delete").click(function() { $(this).parent().remove(); }); $("#c1 .delete").click(function() { if ($("#c1>div").length<3) { $("#c2>div:nth-child(1)").appendTo("#c1"); } }); This works perfectly fine untill I try to delete the moved up 'd'. When I try to delete 'd' it deletes but the child divs are not moving up. Any help. Thanks for bearing with me all along.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27880006
accepted answer: http://stackoverflow.com/a/27880006
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
possible better answer: http://stackoverflow.com/a/27880058
has title: jQuery How to refresh appended div's characteristics?
has comment: http://stackoverflow.com/comment/44161431
has comment: http://stackoverflow.com/comment/44161439
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/27880058
answer count: 2

http://stackoverflow.com/comment/44309228
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27955925
has text: yeah, I need this for generating `json5` format instead of `json`

http://stackoverflow.com/comment/47108146
type: Comment
has text: this doesn't work for me. Uncaught TypeError: Cannot read property '_localZOrder' of undefined
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27921544

http://stackoverflow.com/q/27805737
downvote count: 0
linked to: http://stackoverflow.com/q/196684
tagged with: javascript
has answer: http://stackoverflow.com/a/27805846
has title: Get text value of selected option in Jquery
has comment: http://stackoverflow.com/comment/44020513
duplicate of: http://stackoverflow.com/q/196684
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44020575
upvote count: 2
has body: I have some custom Jquery which grabs the id's from a select list, and populates a secondary select list with those that are selected. I have this working well, however I need the secondary select list needs to display the text value of the selected option. Currently I just get the actual id. Can anybody assist please? JQUERY $('#myselect').change(function() { var row = $(".chosen-select").val(); $('#secondSelect').html(''); jQuery.each(row, function(i, val) { $('#secondSelect').append(' ' + val) + ' '; }); }); HTML First select list Vauxhall Volvo etc... Second select list Select Model should be populated here..
accepted answer: http://stackoverflow.com/a/27805846
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44020688
type: Question
has comment: http://stackoverflow.com/comment/44020917
has comment: http://stackoverflow.com/comment/44020604
tagged with: arrays

http://stackoverflow.com/comment/44306283
type: Comment
has text: Thanks for your help. I made a mistake while I was typing my code and the question. The problem still remains but it shows up fine on jsfiddle.. I updated the question.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27955376

http://stackoverflow.com/q/27942135
accepted answer: http://stackoverflow.com/a/27942235
upvote count: 0
duplicate of: http://stackoverflow.com/q/4060004
tagged with: javascript
has body: When a user enters their date of birth in a form as DDMMYYYY, how can I grab that and convert it into years to tell them their age?
type: AnsweredQuestion
score: -2
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27942235
downvote count: 2
answer count: 1
linked to: http://stackoverflow.com/q/4060004
has title: Javascript - Calculate user's age from user's form input

http://stackoverflow.com/comment/44054699
type: QuestionComment
comment on: http://stackoverflow.com/q/27824377
has text: See [this Stackoverflow question](http://stackoverflow.com/questions/6338217/get-a-css-value-with-javascript) for more information.
score: 0
type: Comment

http://stackoverflow.com/a/43026339
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27862073
type: Answer
has body: Here's a solution var audioformsg = new Audio(); audioformsg.src = 'http://www.podst.ru/pix/user_files/2/5564/Click_08.mp3'; audioformsg.autoplay = true; from code https://greasyfork.org/zh-CN/scripts/8149-sound-for-message/code

http://stackoverflow.com/a/27856938
accepted answer of: http://stackoverflow.com/q/27856799
type: Answer
answers question: http://stackoverflow.com/q/27856799
downvote count: 0
score: 3
has body: It is because option does not have a click event so you need to use the select's change event $(document).ready(function () { $("select").change(function () { $('#paypal').toggle(); // if you only have 2 options use toggle }); }); If you have more you can check the selected option's ID $(document).ready(function () { $("select").change(function () { this[this.options.selectedIndex].id === 'show' ? $('#paypal').show() : $('#paypal').hide(); }); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44117366
upvote count: 3

http://stackoverflow.com/comment/105744043
has text: you could look on the following GitHub link to get the solution with short lines of codes `https://gist.github.com/ahtcx/0cd94e62691f539160b32ecda18af3d6`
comment on: http://stackoverflow.com/q/27936772
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/a/32379006
score: 5
upvote count: 5
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27942209
has body: I upvoted @Naeem_Shaikh's answer which is basically an improvement on the standard angular directive. However, there is another problem with the standard angular draggable directive that I have been able to fix. The standard directive imposes draggability on the whole dialog. On the one hand, this is what we want. We want to drag the whole dialog. But this has unfortunate side effect that clicks in various edit fields in the dialog do not work: the default behavior is prevented! Somehow buttons have been coded in bootstrap to overcome this but not text edit fields. I'm guessing that the authors weren't considering my use case. But dialogs are more than just buttons! It's tricky since it is the whole dialog that needs to be dragged, but you only want drags initiated by clicks in the header "hotspot". In other words, the hotspot to initiate dragging is a subset of the area to be dragged. Naeem's fix enabled me to get it to work so that only clicks in the header initiated drags. Without his fix, the coordinate conversion was getting confused. function clickedWithinHeader(event) { var target = event.currentTarget; var hotspot = null; var hotspots = target.getElementsByClassName("modal-header"); if (hotspots.length &gt; 0) { hotspot = hotspots.item(0); } if (hotspot !== null) { var eY = event.clientY; var tOT = target.offsetTop; var y = eY - tOT; var hH = hotspot.offsetHeight; // since the header occupies the full width across the top // no need to check X. Note that this assumes the header // is on the top, which should be a safe assumption var within = (y &lt;= hH); return within; } else { return true; } } // Draggable directive from: http://docs.angularjs.org/guide/compiler // Modified so that only clicks in the dialog header trigger drag behavior. // Otherwise clicking on dialog widgets did not give them focus. angular.module('drag', []).directive('draggable', function($document) { "use strict"; return function(scope, element) { var startX = 0, startY = 0, x = 0, y =…

http://stackoverflow.com/comment/44248785
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27920101
score: 0
has text: See http://stackoverflow.com/questions/26905929/three-js-2xmeshes-using-same-vector-as-position/26916159#26916159

http://stackoverflow.com/comment/44318509
type: QuestionComment
type: Comment
has text: Cant you just compile into jsx every time? A grunt-task can do that automatically upon every code change.
comment on: http://stackoverflow.com/q/27961150
score: 0

http://stackoverflow.com/q/27849430
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44102886
has comment: http://stackoverflow.com/comment/44130858
type: Question
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44102942
has title: IE 11 prints blank page when using window.open (IE bug) -
tagged with: window.open
has comment: http://stackoverflow.com/comment/44131023
has body: Can someone please throw some light on this weird IE bug, Trying to print only selected section works fine across all browser but IE 11. IE open blank page I don't see any error either. Spent several hours on this researching and trying different work arounds. events:{ 'click td.delete-cell .glyphicon.glyphicon-remove': 'removeRow', 'click th.delete-cell .glyphicon.glyphicon-remove': 'removeAll', 'click .print-button': 'printClicked' }, printClicked: function() { var printHTML = $("&lt;div&gt;&lt;/div&gt;"), summaryTable, driverInfo, driverId; // If there is no Print Window open, or it was closed if ( !this.printWindow || !this.printWindow.window ) { this.printWindow = window.open('', this.options.device.attributes.displayName + " Parameters Report"); $(this.printWindow.document.head).append(this.getTemplate(this.PrintCSSTemplate)()); $(this.printWindow.document.body).addClass('PRINTMODE'); driverId = this.device.get('driverId') ? parseInt(this.device.get('driverId'), 10) : null; driverInfo = this.drivers.findWhere({ driverId: driverId }); printHTML.append( this.getTemplate(this.PrintSummaryDeviceOverviewTemplate)(_.extend({}, this.options.device.toJSON(), { driver: driverInfo.toJSON() } )) ); summaryTable = this.$('table').clone(); summaryTable.find('.delete-cell').remove(); summaryTable.appendTo(printHTML); printHTML.appendTo(this.printWindow.document.body); this.printWindow.print(); } },

http://stackoverflow.com/comment/67570208
has text: Please read [How to offer personal open-source libraries?](//meta.stackexchange.com/q/229085) before posting about your personal projects; do please disclose that this is your own project.
comment on: http://stackoverflow.com/a/40146163
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/50861955
type: QuestionComment
has text: I'm also having this problem. Did you manage to solve it?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27934320

http://stackoverflow.com/comment/44291845
comment on: http://stackoverflow.com/q/27947357
has text: @thomas it's too broad for what I'm doing...it would match in a lot of other instances than just "asdf:asdf" see https://www.regex101.com/r/bG7fW6/1
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44173540
type: AnswerComment
has text: Can you **please** explain your answer.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27886216

http://stackoverflow.com/q/27804014
has body: I am using PHP Laravel 4.0 on my application. Here is an example of one of my user address : At the end, in Location section, I place all of them next to each other as an address format. In addition, I want to use that address and integrate it with Google Maps. What I've tried ? The address is 410 Walker Street Lowell MA 01851 I use this site. http://www.gpsvisualizer.com/geocode to grab its location, I got this 42.635507, -71.328928 Then I include them in my HTML like this I got them from https://developers.google.com/maps/tutorials/fundamentals/adding-a-google-map Questions Since I've a lot of users on my application. It will be a hard for me to do it manually - one by one. I want to make it dynamically generate to all the addresses on all the pages in my application. Base on what I've tried, can someone help me or give me a little hint on this? Can you tell me what I missed ? What is the logics behind this ? Do I need to download a specific packages or plug-in for that ? HUGE thanks to everyone that involve on this post !!!
has title: How to integrate an address with Google Map dynamically ?
type: Question
answer count: 3
has answer: http://stackoverflow.com/a/27877061
tagged with: php
downvote count: 1
upvote count: 3
has answer: http://stackoverflow.com/a/27804496
tagged with: google-maps
score: 2
tagged with: javascript
type: UnansweredQuestion
tagged with: google-maps-api-3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27804094
favorite count: 0

http://stackoverflow.com/comment/44078956
type: Comment
score: 0
has text: Jonast92 I want to hide elements of div class.
comment on: http://stackoverflow.com/q/27837097
type: QuestionComment

http://stackoverflow.com/comment/44284212
has text: @for3st - and when you assign a string to a variable, and then assign that variable to another variable, you're passing the content of the first variable to the other variable, so it really is passing.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27944258
score: 0

http://stackoverflow.com/a/27821212
type: Answer
has comment: http://stackoverflow.com/comment/44115266
score: 30
downvote count: 0
has body: You need to transform the lon/lat coordinates to the correct projection (or coordinate system) using var olCoordinates = ol.proj.transform([lon, lat],"WGS84", "EPSG:900913") Now you can set center with olCorrdinates. Different projections has different code names. WGS84 is "normal" lon/lat and EPSG:900913 is the projection often used in web maps like google maps, openstreetmap and bing. I think OpenLayers 3 has built in support for transforming from WGS84/EPSG:4326 (lon/lat), but if you need to convert to or from other coordinate systems you can include the proj4js library. Openlayers will integrate with this lib and be able to do the transformations in the same way. Transform documentation http://openlayers.org/en/v3.1.1/apidoc/ol.proj.html Proj4 lib https://github.com/proj4js/proj4js Edit: In the example you are refering to, the center location is actually set with lon/lat. view: new ol.View({ center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'), zoom: 4 }) EPSG:4326 is actually the same as WGS84 and EPSG:3857 is the same as EPSG:900913. This is very confusing. I have been there myself. You just need to change the numbers 37.41 and 8.82 to your lon/lat coordinates. If you want to change the center location after initialization you will need to use setCenter(); map.getView().setCenter(ol.proj.transform([lon, lat], 'EPSG:4326', 'EPSG:3857'))
upvote count: 30
accepted answer of: http://stackoverflow.com/q/27820784
answers question: http://stackoverflow.com/q/27820784
has comment: http://stackoverflow.com/comment/44048144
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44048306

http://stackoverflow.com/q/27960256
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27960326
upvote count: 0
tagged with: javascript
tagged with: variables
has body: I'm getting really confused when it comes to javascript object variables. If I'm creating an object constructor, what the difference between using this. and using var? EG: var myObj = function(x){ this.thing = x; var otherThing = 20; var lastThing = "I wish I knew more about javascript objects"; } The other thing is when setting a this. variable you call it within the object using, in the case above: this['thing']; Is that right? Thanks in advance.
favorite count: 0
has title: Javascript objects and variables
possible better answer: http://stackoverflow.com/a/27960349
has answer: http://stackoverflow.com/a/27960349
tagged with: javascript-objects
downvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4968406
score: -1
has answer: http://stackoverflow.com/a/27960326

http://stackoverflow.com/a/27905153
score: -1
answers question: http://stackoverflow.com/q/27905060
has body: There is no difference. OnClick it's the same event. If you want to call different methods , with javascript you can manipulate what to do when OnClick it's raised.
downvote count: 1
has comment: http://stackoverflow.com/comment/95799968
upvote count: 0
type: Answer

http://stackoverflow.com/comment/44311063
type: Comment
comment on: http://stackoverflow.com/a/27957992
has text: I have test their examples, `inlineresources` doesn't work as expected *__*
type: AnswerComment
score: 0

http://stackoverflow.com/q/27862915
tagged with: jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27862995
has answer: http://stackoverflow.com/a/27863059
accepted answer: http://stackoverflow.com/a/27863059
tagged with: variables
tagged with: reset
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27862995
tagged with: loops
type: Question
has body: I've worked on an infinite loop, including variables, an array &amp; am now looking to include a reset function. During this script, a 'LoopNumber' variable is used to determine which number within the array will be printed to the contents of 'marqueetext' division. Because the loop number is given the integer of '1' during the start of the script, the variable 'marqueepicker' will be effected. Hence the script must be reset at 5 loops, rather than 6. &lt;script&gt; var StopLoop = false; var Loop = null; var LoopNumber = 0; var MarqueeArray = ["1", "2", "3", "4", "5", "6"]; var MarqueePicker = 0; Loop = function(){ LoopNumber = LoopNumber + 1; MarqueePicker = LoopNumber - 1; $(".marqueetext").text(MarqueeArray[MarqueePicker]); if(!StopLoop) window.setTimeout(Loop,1000); }; Loop(); &lt;/script&gt; For the sake of showcasing aspects of JS, this script needs to contain the included attributes. Previous workings on the reset function include if (LoopNumber == 6) { LoopNumber = 0 }; I have been unsuccessful at adding these to the script as the loop continues regardless of positioning and location within. I am aware that the code has not been indented and operators may not be entirely correct, however this script is a test module and therefore details and efficiency will be included after. http://jsfiddle.net/#&amp;togetherjs=drimOc2l61 If possible, could you provide any help &amp; guidance on this reset! Thanks in advance.
has title: Resetting Infinite Loop when it has been ran 5 times
has comment: http://stackoverflow.com/comment/44127865
tagged with: javascript

http://stackoverflow.com/comment/44295613
has text: @Xereoth, See my edit. There's a little more to it that I neglected.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27950193

http://stackoverflow.com/comment/44274005
score: 0
comment on: http://stackoverflow.com/a/27938309
type: Comment
has text: in my example, when the `add` function returns `this`, it actually returns it's parent: `calculator`. So basically, after being evaluated, the function has the `calculator` value: `calculator.add(1) === calculator`.
type: AnswerComment

http://stackoverflow.com/q/27884948
tagged with: toggle
tagged with: drupal
type: AnsweredQuestion
has title: (Drupal) How to only target elements within node with jQuery?
has body: I'm a beginner with jQuery and I have this HTML: Share I am trying to use jQuery to make it so when you click on the .a2a_dd link, it will toggle the #share-btns div visibility. Here is my code: (function($){ Drupal.behaviors.toggle = { attach: function() { $('.a2a_dd').click(function() { $('#share-btns').fadeToggle(); }); } }; })(jQuery); The problem is, I have a grid of teaser articles all on the same page that all have this HTML on them and when I click on the .a2a_dd link on any of the teasers it toggles the #share-btns div on only the first teaser on the page. Is there a way to get jQuery to recognize the node that was clicked on so it can toggle the div from that same node? Any help would be greatly appreciated.
type: Question
accepted answer: http://stackoverflow.com/a/27886804
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44171594
has comment: http://stackoverflow.com/comment/44179375
score: 0
has comment: http://stackoverflow.com/comment/44180944
has comment: http://stackoverflow.com/comment/44179309
has answer: http://stackoverflow.com/a/27886804

http://stackoverflow.com/comment/44298052
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27950293
type: Comment
has text: This is what I was forgetting. I was overthinking. Thank you!

http://stackoverflow.com/q/27896922
tagged with: javascript
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27896976
type: Question
has body: I want to Run a Function from .js file without import in in my page I use this code : var js =("../../../static/js/file.js"); js.hi(); and show this Error in console : Uncaught TypeError: undefined is not a function But I have a function with hi name !
has comment: http://stackoverflow.com/comment/127790907
has title: run a function from .js file without import it?
upvote count: 2
has comment: http://stackoverflow.com/comment/44195075
answer count: 1
downvote count: 1
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/950087
duplicate of: http://stackoverflow.com/q/950087

sorting
tags question: http://stackoverflow.com/q/27960722
tags question: http://stackoverflow.com/q/27889800
tags question: http://stackoverflow.com/q/27893126
tags question: http://stackoverflow.com/q/27836169
tags question: http://stackoverflow.com/q/27925872
tags question: http://stackoverflow.com/q/27921269
tags question: http://stackoverflow.com/q/27859421
tags question: http://stackoverflow.com/q/27872576
type: Tag
tags question: http://stackoverflow.com/q/27827481
tags question: http://stackoverflow.com/q/27857235
tags question: http://stackoverflow.com/q/27886720
tags question: http://stackoverflow.com/q/27936483
tags question: http://stackoverflow.com/q/27885164
tags question: http://stackoverflow.com/q/27810286
tag name: sorting
tags question: http://stackoverflow.com/q/27834820
tags question: http://stackoverflow.com/q/27942074
tags question: http://stackoverflow.com/q/27848278
tags question: http://stackoverflow.com/q/27843673
tags question: http://stackoverflow.com/q/27947570
tags question: http://stackoverflow.com/q/27897389

http://stackoverflow.com/q/27926021
tagged with: rickshaw
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/27926271
upvote count: 1
type: Question
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/27926217
tagged with: javascript
has title: Set variable in angular
favorite count: 0
tagged with: angularjs
has body: I want to use the rickshaw module to create a graph in my app. I followed the instruction in here and didnt succedd : http://ngyewch.github.io/angular-rickshaw/#/home this is my html : &lt;rickshaw rickshaw-options="options1" rickshaw-features="features" rickshaw-series="series1"&gt; &lt;/rickshaw&gt; this is my controller: app.controller('GraphsController', function ($scope ) { $scope.options1 = { renderer: 'area' }; $scope.series1 = [{ name: 'Series 1', color: 'steelblue', data: [{x: 0, y: 23}, {x: 1, y: 15}, {x: 2, y: 79}, {x: 3, y: 31}, {x: 4, y: 60}] }, { name: 'Series 2', color: 'lightblue', data: [{x: 0, y: 30}, {x: 1, y: 20}, {x: 2, y: 64}, {x: 3, y: 50}, {x: 4, y: 15}] }]; }); anyone knows what I'm doing wrong? Thank you!
has answer: http://stackoverflow.com/a/27926271
has answer: http://stackoverflow.com/a/27926217

http://stackoverflow.com/q/27836020
has title: How to access ajax response data as html with javascript or jquery?
tagged with: response
type: Question
linked to: http://stackoverflow.com/q/203198
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
duplicate of: http://stackoverflow.com/q/203198
has body: Imagine, there are two files test.php index.php In test.php there are only a html button with id click. In index.php there are also only a html button with id send. If I send an ajax request to test.php file from index.php then the button with id click from test.php should be inserted within a div in index.php. Now I want this button to hide p element when it is clicked within index.php. Note: onclick attribute should not come with #click button. How to do that? I am currently using android phone to ask this question. So I am not able to write the question with examples.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27836073
score: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27836073

http://stackoverflow.com/comment/44083085
comment on: http://stackoverflow.com/q/27839693
score: 0
has text: Why do you not use html `a`?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27930938
score: 5
accepted answer: http://stackoverflow.com/a/27931390
upvote count: 5
tagged with: javascript
answer count: 2
tagged with: single-page-application
downvote count: 0
favorite count: 0
tagged with: angularjs
has title: Expected response to contain an array but got an object
has comment: http://stackoverflow.com/comment/44259506
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44260414
possible better answer: http://stackoverflow.com/a/29122858
has answer: http://stackoverflow.com/a/27931390
has answer: http://stackoverflow.com/a/29122858
has body: So I'm new in Angular, and I've looked over various other solutions, but no one seemed to work for me. My app needs to take some data from mongodb database and show it to the client. The thing is I get Error: [$resource:badcfg] Error in resource configuration for action query. Expected response to contain an array but got an object Here is my SchoolCtrl.js on the client app.controller('SchoolsCtrl', function($scope, SchoolResource) { $scope.schools = SchoolResource.query(); }); Here is my ngResource app.factory('SchoolResource', function($resource) { var SchoolResource = $resource('/api/schools/:id', {id: '@id'}, { update: {method: 'PUT', isArray: false}}); return SchoolResource; }); This is my SchoolsController on the server var School = require('mongoose').model('School'); module.exports.getAllSchools = function(req, res, next) { School.find({}).exec(function(err, collection) { if(err) { console.log('Schools could not be loaded: ' + err); } res.send(collection); }) }; I tried adding IsArray: true, tried adding [] after 'SchoolResource' in the resource, tried changing routes, nothing worked. I wanted to see what actually is returned, that the query complained is not array, so I turned it to string and this was the result: function Resource(value) { shallowClearAndCopy(value || {}, this); } I have no idea why it returns a function. Can anyone help me?
type: Question
tagged with: mongodb

http://stackoverflow.com/comment/44021514
comment on: http://stackoverflow.com/q/27806252
type: QuestionComment
type: Comment
score: 0
has text: openJSONitems is an array, it doesn't have the appendTo method, you'll have to iterate over that array and append its elements to "#home-table-orders". Besides, you're creating a new array in each iteration.

http://stackoverflow.com/q/27896895
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27896938
has answer: http://stackoverflow.com/a/27896938
has answer: http://stackoverflow.com/a/27896932
type: Question
answer count: 2
has body: How can use the RegEx to replace a string if ONLY it has a tab or sequence of tabs and ignore otherwise. Example: str = "\t\t\t\t"; -> replace this string with nothing i.e. output of str = ""; str = "\t"; -> replace this string with nothing i.e. output of str = ""; str = "\t\tvar a = 10"; -> ignore replacing. Thanks!
tagged with: regex
has title: regex replace string with tabs only
score: 0
has comment: http://stackoverflow.com/comment/44194452
accepted answer: http://stackoverflow.com/a/27896932
has comment: http://stackoverflow.com/comment/44194157
tagged with: javascript
has comment: http://stackoverflow.com/comment/44194234

keydown
tags question: http://stackoverflow.com/q/27955924
tags question: http://stackoverflow.com/q/27927249
type: Tag
tag name: keydown

http://stackoverflow.com/comment/44089913
score: 0
type: Comment
type: QuestionComment
has text: @JLRishe It has to sort the boxes into columns depending on the column height, so it fills the shortest columns first. The fiddle shows this perfectly. This is why there are numbers on them.
comment on: http://stackoverflow.com/q/27842832

http://stackoverflow.com/comment/44075106
score: 0
comment on: http://stackoverflow.com/a/27835030
type: AnswerComment
type: Comment
has text: You need to only do this while making the count and not while generating the DOM.

http://stackoverflow.com/comment/44127425
score: 0
has text: I agree, however those elements would always be added after bootstrapping because belongs to a controller.
type: AnswerComment
comment on: http://stackoverflow.com/a/27850103
type: Comment

http://stackoverflow.com/comment/44130447
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27863378
has text: so how would you store the first second or third in a group?

http://stackoverflow.com/comment/44049086
has text: I have added your comment to the question
comment on: http://stackoverflow.com/q/27821510
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27822822
has comment: http://stackoverflow.com/comment/44051924
score: 0
has body: Use the debugger; statement: The debugger statement invokes any available debugging functionality, such as setting a breakpoint. If no debugging functionality is available, this statement has no effect. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger
type: Answer
has comment: http://stackoverflow.com/comment/44052209
answers question: http://stackoverflow.com/q/27822679
has comment: http://stackoverflow.com/comment/44052521
has comment: http://stackoverflow.com/comment/44052299

http://stackoverflow.com/comment/44200743
type: Comment
has text: are u getting the data successfully ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27900078

http://stackoverflow.com/q/27947540
has answer: http://stackoverflow.com/a/27947665
accepted answer: http://stackoverflow.com/a/27947665
type: Question
score: 0
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27947749
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27947749
tagged with: angularjs
has title: How do you increase/reduce the height of a paragraph element dynamically in AngularJS?
type: AnsweredQuestion
has body: I need to increase the height of a p element when I click a "Show More" button, which then should say "Show less" and then reduce the size of the p element when I click the button again. What is the best way to do this in Angular? This is the structure of my paragraph and button - Show More

http://stackoverflow.com/q/27904159
has title: Jquery ajax response not calling Success method
score: 0
has comment: http://stackoverflow.com/comment/44207550
answer count: 3
has comment: http://stackoverflow.com/comment/44207471
tagged with: jquery
has comment: http://stackoverflow.com/comment/44207729
has comment: http://stackoverflow.com/comment/44207612
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27904274
has answer: http://stackoverflow.com/a/27904468
has body: I am pretty much new to ajax and working on jquery ajax request. Ajax callback is not calling success method. Interaction is between cross-site domains. My AJAX request looks like $.ajax({ timeout: 20000, url: 'test.com', crossDomain: true, dataType: 'jsonp', success: function (data) { console.log('callback success'); this._cache = data; localStorage.token = data.access_token; } }); There are no errors in this call. This ajax request is not calling success function.Request is returning json data. it's just success method is not getting called. This ajax request is not calling success function. Get request is getting fired successfully. I can even trace the response in fiddler with 200 http response.For some reason success method is not getting called.
type: Question
has comment: http://stackoverflow.com/comment/44207746
has comment: http://stackoverflow.com/comment/44207595
has answer: http://stackoverflow.com/a/45125353
has comment: http://stackoverflow.com/comment/44207852
has comment: http://stackoverflow.com/comment/44208690
tagged with: javascript
has comment: http://stackoverflow.com/comment/44207448

http://stackoverflow.com/comment/44306742
score: 0
type: Comment
type: QuestionComment
has text: I am looking for a way to have a basic layout for my html files. Mostly so I can have the same with all the required script src's for javascript & jquery
comment on: http://stackoverflow.com/q/27955879

http://stackoverflow.com/comment/44139523
type: AnswerComment
score: 0
type: Comment
has text: Yes, no errors at all. However, the code works when I remove the and tags from the select box. This is the template I am using - http://metrodir.morrise.pl/
comment on: http://stackoverflow.com/a/27865628

http://stackoverflow.com/a/46155087
has comment: http://stackoverflow.com/comment/109003955
score: 19
answers question: http://stackoverflow.com/q/27928372
has body: Add this to webpack.config.js: devServer: { historyApiFallback: true }
downvote count: 1
has comment: http://stackoverflow.com/comment/127475666
type: Answer
upvote count: 20

http://stackoverflow.com/comment/44049229
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27821067
has text: Make the SVG an image if you want to handle the mouse outside it (i.e. in the parent document). Otherwise handle the mouse within the SVG document itself.

http://stackoverflow.com/comment/44184188
comment on: http://stackoverflow.com/q/27890794
score: 0
has text: For those looking on, this is definitely Select2 3.5.2, not the 4.0 beta.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44307179
type: Comment
comment on: http://stackoverflow.com/q/27954129
score: 0
type: QuestionComment
has text: I suppose you were downvoted because you got ahead of yourself and asked a question which really doesn't make any sense. elem.innerHTML is just a text string, not a DOM element. You can't style a text string. It's just characters. So it's a confusing question. (I didn't downvote it, I'm just speculating)

http://stackoverflow.com/q/27897592
answer count: 2
has comment: http://stackoverflow.com/comment/44205702
has answer: http://stackoverflow.com/a/27897670
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44212882
has comment: http://stackoverflow.com/comment/44195467
favorite count: 0
has answer: http://stackoverflow.com/a/27897705
type: UnansweredQuestion
tagged with: css
score: 2
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/44195565
type: Question
has title: Create a very low specificity css property
has comment: http://stackoverflow.com/comment/44195415
has body: I am trying to create a very low specificity css property using javascript. Just like !unimportant (which doesn't exists) I don't know whether this is possible or not. My reason to look for something like !unimportant is that I am writing a small javascript plugin. In which I want to add a default style to a element which should be later easily overriden by the user. But if I write: element.style.backgroundColor = "green"; The user will not be able to override the above style easily without using !important. So, I added a dynamic style tag by using the following code: var style = document.createElement('style'); // WebKit hack :( style.appendChild(document.createTextNode("")); document.head.appendChild(style); and then to the above code, I added a dynamic stylesheet using the following code: var element = document.getElementById('main'); // To use attribute names to apply the styles element.setAttribute('custom-el', '1'); var sheet = style.sheet; var properties = "background-color: green;"; var elName = "[custom-el]"; if (sheet.insertRule) { sheet.insertRule(elName + "{" + properties + "}", 0); } else if (sheet.addRule) { sheet.addRule(elName, properties, 0); } Now the background-color: green can be overriden by using the following code: div.main { background-color: red; } But as you can see in css, I used higher specificity to override background-color: green i.e div + .green. But I want the overriden to happen even when user writes the following css: .main{ /* Could be simple class name or id name or even tag name */ background-color: red; } Fiddle This might seems to be a small issue. but it is a big problem for me. Please help.
tagged with: javascript

http://stackoverflow.com/q/27956551
score: 0
has body: I have been developing a voting function for my Website, but am newer to using AngularJS's $resource and am looking to "update" an existing record with the vote I just recorded. The issue is that it is not updating and is not giving any error messages, merely stating in the console log that my REST call required CORS preflight, which leads me to believe it is at least hitting the backend. At this point in development, I believe I may be off on how to update a record with an ID, as in this case, I don't have a $routeparam to pass in for reference but am trying to update from an ng-repeat that has the voting functionality as part of it. On screen it works by incrementing up or down, but does not update the database so that when I refresh the page, the changes don't hold because they were never committed. Here is my HTML: Votes Title Category ID {{articlevote.articlevotes}} {{articlevote.articletitle}} {{articlevote.articlecategoryid}} Here is my controller (which is where the issue probably is, or in combination with my service): // Article Vote pfcControllers.controller('articleVotingCtrl', ['$scope', 'pfcArticles', function($scope, pfcArticles) { $scope.articlevotes = pfcArticles.query(); $scope.upVote = function(articlevote) { articlevote.articlevotes++; updateVote(articlevote.id, articlevote.articlevotes); }; $scope.downVote = function(articlevote) { articlevote.articlevotes--; updateVote(articlevote.id, articlevote.articlevotes); }; function updateVote(id, articlevotes) { pfcArticles.update({ articleID: id }), articlevotes; } }]); Here is my service: // All Articles pfcServices.factory('pfcArticles', ['$resource', function($resource) { return $resource('https://myrestcall.net/tables/articles', { articleID: '@id' }, { 'update': { method: 'PATCH' } }); }]); Here is sample JSON data: [ { "id": "66D5069C-DC67-46FC-8A51-1F15A94216D4", "articletitle": "artilce1", "articlecategoryid": 1, "articlesummary": "article 1 summary. ", "articlevotes": 1 }, { "id": "66D5069C-DC6…
answer count: 1
has title: AngularJS PUT on voting application to REST Service
tagged with: rest
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44326482
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/22465894
has comment: http://stackoverflow.com/comment/44311993
type: Question
has comment: http://stackoverflow.com/comment/44320116
tagged with: javascript
has answer: http://stackoverflow.com/a/27977644
accepted answer: http://stackoverflow.com/a/27977644

http://stackoverflow.com/comment/44170913
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27883941
type: Comment
has text: For rounding - use ROUND(a,b) function like in the example http://jsfiddle.net/agershun/f11ygovs/1/. For map... let me think. Probably, you need to use d3.js library. I will try to create a sample.

http://stackoverflow.com/a/27922597
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27899678
type: Answer
answers question: http://stackoverflow.com/q/27899678
has body: you can do that by removing a class name use the below code to do it as soon as the slider starts. $('.flexslider').flexslider({ start : function(){ $('.flex-control-paging').removeClass('flex-control-paging'); } }); NOTE: You may need to change some more css to make it look pretty
upvote count: 1

http://stackoverflow.com/a/27967113
upvote count: 4
has body: If you're using a JSON file then the code is going to be largely the same just replace d3.csv with d3.json. If the data is already loaded in the browser then you can remove this function and just run: var experiments = JSON.parse(json_object) //if json_object is still a string var ndx = crossfilter(experiments) and the rest of the code will be the same.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27963811
score: 4

http://stackoverflow.com/q/27915297
has title: not possible to include js in jsp
has comment: http://stackoverflow.com/comment/44229540
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44229542
downvote count: 1
has comment: http://stackoverflow.com/comment/44238594
type: Question
has body: I wrote a simple program for including js in jsp, but its not working please help.. Username Password Login /tr> Not a Member? Register Here In my JavaScript I wrote: (self1.js) function loginas(){ alert("hi............"); } I also tried But not working..please give me a solution??
answer count: 2
has answer: http://stackoverflow.com/a/27915497
upvote count: 0
tagged with: jsp
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44229756
has comment: http://stackoverflow.com/comment/44229829
possible better answer: http://stackoverflow.com/a/27915320
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27915320
favorite count: 0
accepted answer: http://stackoverflow.com/a/27915497

http://stackoverflow.com/q/27863657
has body: Hi i'm looking for a dropdown login/menu without the use of any bootstrap-like css or jQuery (due to school not allowing this..). It has to be relatively small and ideally it would come down when clicking or hovering above the login button on the nav bar. Much thanks in advance.
answer count: 1
has title: dropdown login menu using only html/css/javascript
tagged with: drop-down-menu
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27863895
has comment: http://stackoverflow.com/comment/44129502
tagged with: css
has comment: http://stackoverflow.com/comment/44129737
upvote count: 2
tagged with: authentication
type: Question
score: -2
tagged with: javascript
downvote count: 4

http://stackoverflow.com/comment/44301287
has text: Not uppercase, **bold**
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27953056
type: QuestionComment

http://stackoverflow.com/comment/44234526
comment on: http://stackoverflow.com/q/27918100
type: QuestionComment
type: Comment
has text: @gulty I have updated my question with code
score: 0

http://stackoverflow.com/comment/44149914
has text: @Quentin - You got me, I couldn't believe the alert worked, until I noticed you added another alert for the returned content.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27873951
type: QuestionComment

http://stackoverflow.com/a/27877101
type: Answer
answers question: http://stackoverflow.com/q/27876420
downvote count: 0
has comment: http://stackoverflow.com/comment/44156413
has comment: http://stackoverflow.com/comment/44155992
has comment: http://stackoverflow.com/comment/44156328
has comment: http://stackoverflow.com/comment/44156452
has comment: http://stackoverflow.com/comment/44155840
has comment: http://stackoverflow.com/comment/44155827
score: 5
type: AcceptedAnswer
has body: CryptoJS.PBKDF2 uses SHA1 by default. So as long as the same password, salt, keysize and iteration count is supplied, it will produce the same key. The problem is that in JavaScript you additionally hash the password with SHA1. Don't do that and pass the password directly into PBKDF2 in the same way you do this in Java. The second problem is that the ciphertext should be in the native format of CryptoJS when trying to decrypt. Since you get the base 64 encoded ciphertext from Java, you have to decode it as such. Uncomment the line: var encMsg = CryptoJS.enc.Base64.parse(encMsg64); and don't do encMsg64 = encMsg64.toString( CryptoJS.enc.Base64); since this will encode the already encoded ciphertext again. For the updated code, you cannot print your key and salt simply as a string and expect it to work in JavaScript. Those are byte[] for a reason. They contain unprintable characters which will be lost when you try to parse it in JavaScript. You have to encode all the byte[] values that you want to transport from Java to JavaScript as Base64 and then decode them in JavaScript.
upvote count: 5
accepted answer of: http://stackoverflow.com/q/27876420

http://stackoverflow.com/comment/44152483
score: 1
type: Comment
comment on: http://stackoverflow.com/q/27874984
type: QuestionComment
has text: @Mark: yes, you can, you just have to dig a little bit more into javascript OOP ;). It is not very basic, indeed, but you can actually look further and try to imagine in what way a class can be implemented in javascript.

http://stackoverflow.com/a/27842939
has comment: http://stackoverflow.com/comment/44108381
upvote count: 3
has comment: http://stackoverflow.com/comment/44110489
downvote count: 1
has comment: http://stackoverflow.com/comment/44125428
has comment: http://stackoverflow.com/comment/44111029
has comment: http://stackoverflow.com/comment/44111155
has comment: http://stackoverflow.com/comment/44109444
type: Answer
has comment: http://stackoverflow.com/comment/44109311
score: 2
answers question: http://stackoverflow.com/q/27838477
has comment: http://stackoverflow.com/comment/44109184
has comment: http://stackoverflow.com/comment/44125767
has comment: http://stackoverflow.com/comment/44108301
has comment: http://stackoverflow.com/comment/44108231
has comment: http://stackoverflow.com/comment/44111225
has body: Within a Javascript function it is a rather simple detection whether the function has been simply executed or being executed as an object instance constructor (using new keyword). Actually, that's impossible, one cannot know in JS whether an user function was called as a constructor. The this instanceof test is sufficient for the usual cases, but only checks whether the context does inherit from the class's prototype. How can we now detect within doSomething the same for SomeType function? You cannot for the same reason, and you cannot do the instanceof test without passing this as a parameter to your doSomething. Main problem: I'm writing a function that adopts/injects constructor parameters as constructed object instance members with the same name. I recommend not to do so via a function call inside the constructor. Instead, try to decorate the constructor function, so that you will have access to all the values that you need right away: Function.prototype.adoptArguments = function() { var init = this; var args = arguments.length ? arguments : init.toString().replace(comments, "").match(argumentsparser); if (!args || !args.length) return init; var constructor = function() { if (this instanceof constructor) { for (var i=0; i&lt;args.length; i++) this[args[i]] = arguments[i]; init.apply(this, arguments); } else { // throw new Error("must be invoked with new"); } }; return constructor; }; Then instead of function SomeType() { SomeType.adoptArguments(); } do var SomeType = function() { }.adoptArguments();
has comment: http://stackoverflow.com/comment/44108962
has comment: http://stackoverflow.com/comment/44110779
has comment: http://stackoverflow.com/comment/44110877

http://stackoverflow.com/comment/44075026
comment on: http://stackoverflow.com/q/27834909
type: QuestionComment
has text: @RutwickGangurde Your above code works fine for me. Here is a [DEMO](http://jsfiddle.net/LgL747ph/)
score: 0
type: Comment

http://stackoverflow.com/comment/44097072
comment on: http://stackoverflow.com/q/27846195
has text: I see, so you have **incomplete** url in `` and you want to change it at runtime according to which language is set!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44117911
type: AnswerComment
has text: @MattyBalaam - if you want to catch errors, a video has a `error` event that fires if something goes wrong, for instance that the browser can't play the file
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27857389

http://stackoverflow.com/q/27822702
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27822816
answer count: 1
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27822816
upvote count: 1
type: AnsweredQuestion
has body: I have an click event handler that dequeues a function if one is available. I made a loop to wait for the queue. I thought this would work but on one of my machines it results in a busy wait and freezes everything. I'm confused about why this is a problem. The goal is to wait for the queue to be non-empty. Can anyone help? Thanks function handleViewClick(event){ clickEvent = event; // make event details available to requestReport on body-foo Q var body = $("body"); while ( 0 == body.queue("foo").length ) setTimeout(function(){ handleViewClick(event); }, 1000); body.dequeue("foo"); // analyze and report on click. }
has title: javascript/jquery loop result in busy waiting

http://stackoverflow.com/q/27848004
has title: What the differences are between Google Tag Manager and Google Apps Script?
has body: While looking to process a few variables from a form, and send that data to a Google Drive Spreadsheet, I found that Google Apps Script, fits better for my purpose, it just catchs all the data in a regular html form, and sends that data to my Google Drive Spreadsheet, without depending on a special type of google form, and without matching var names, vith values. Am I missing something? Regards!
has answer: http://stackoverflow.com/a/27850994
score: 0
accepted answer: http://stackoverflow.com/a/27850994
type: AnsweredQuestion
tagged with: google-tag-manager
type: Question
tagged with: google-apps-script
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27961650
upvote count: 0
has comment: http://stackoverflow.com/comment/44316720
has comment: http://stackoverflow.com/comment/44316757
downvote count: 3
has body: I'm using the following code to swap an image's src value if the image doesn't load: $('.profile-pic').on('error', function() { $(this).prop('src', 'uploads/profile/default.png'); }); If there is a single element with an id of profile-pic, I can use the above code (swapping the selector) and it works fine. So why isn't this working for each of the .profile-pic elements on the page?
has comment: http://stackoverflow.com/comment/44316764
type: Question
has comment: http://stackoverflow.com/comment/44316912
tagged with: javascript
has answer: http://stackoverflow.com/a/27962283
answer count: 1
has comment: http://stackoverflow.com/comment/44316830
tagged with: jquery
favorite count: 0
has title: Jquery on image error not working for multiple elements
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/44316782

http://stackoverflow.com/a/27836073
accepted answer of: http://stackoverflow.com/q/27836020
answers question: http://stackoverflow.com/q/27836020
has comment: http://stackoverflow.com/comment/44076691
has comment: http://stackoverflow.com/comment/44077728
type: AcceptedAnswer
has body: $("#id").live("click",function() { alert("hai"); }) EDIT $("#id").on("click",function() { alert("hai"); }) OR $("#id").delegate("click",function() { alert("hai"); })
has comment: http://stackoverflow.com/comment/56508425
score: 0
type: Answer

http://stackoverflow.com/comment/44094868
has text: http://stackoverflow.com/questions/1635116/javascript-class-method-vs-class-prototype-method
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27845479
score: 0

http://stackoverflow.com/comment/44079078
has text: Thank you! As a comment, in protractor 1.2, CTRL key throws the following error (- Error: Not a modifier key) and SHIFT key works correctly. protractor.getInstance().actions().mouseMove(node).keyDown(protractor.Key.SHIFT).click().perform();
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27832799
type: AnswerComment

http://stackoverflow.com/q/27836785
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44078170
has answer: http://stackoverflow.com/a/27836880
has body: I need to add 2 classes to a div, one is a fixed string and another is from a variable. Here is a code example: var foo = myObject.foo; var bar = $('&lt;div&gt;&lt;/div&gt;').addClass("myClass" foo); Would this work? I can't check it yet because I am rewriting my whole JavaScript file and I am not done yet. If not would this work?: var myClass = "myClass"; var foo = myObject.foo; var bar = $('&lt;div&gt;&lt;/div&gt;').addClass(myClass foo); Thanks guys!
type: Question
has answer: http://stackoverflow.com/a/27836865
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27836865
has answer: http://stackoverflow.com/a/27836814
score: 0
answer count: 5
has answer: http://stackoverflow.com/a/27836831
has answer: http://stackoverflow.com/a/27836828
accepted answer: http://stackoverflow.com/a/27836814
has title: I need to add 2 classes to a div, one is a string and another is from a variable

http://stackoverflow.com/comment/44027251
has text: You need to escape the strings that come from your html form using "escapeURIComponent"
type: QuestionComment
comment on: http://stackoverflow.com/q/27808637
score: 0
type: Comment

http://stackoverflow.com/comment/44298459
has text: So even though I would be retrieving (via an http service) the actual results array one level above the directive, 2 way binding should still work without the need to use $apply or something like that, correct? I am not @ work right now and the problem is that the chunk I have the problem has a lot of custom dependencies. I would have to write something new ( might do tomorrow and update thje post). Oh and by the way thank you for the support.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27951384
type: Comment

http://stackoverflow.com/comment/44139903
has text: Not sure if that makes it simpler than pixel interpolation
comment on: http://stackoverflow.com/q/27868721
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27941460
favorite count: 0
score: 1
answer count: 4
accepted answer: http://stackoverflow.com/a/27943617
tagged with: angularjs
upvote count: 1
has answer: http://stackoverflow.com/a/27941850
tagged with: node.js
type: AnsweredQuestion
has body: I have following HTML my login code my login code and my Angular code is var app = angular.module("app", []); app.controller("MainController", ["$scope", function(t) { /* check session if exist or not if not show login*/ t.view='login'; }]),app.controller("SignInController", ["$scope","$http", function(t,$http) { t.signIn = function() { $http({ url: "/login/", data: { email: t.user.email,password:t.user.password }, method: 'POST', }).success(function (data) { console.log(data); //want to show project div t.$emit("view", "project"); }).error(function(err){ t.error = "Invalid Login"; }) }; }]),app.controller("ProjectController", ["$scope", function(t) { }]); Now my ng-swicth is not wokring on Success. EDIT : here is punker link http://plnkr.co/edit/I8EEFM8gdplUmNaZoYc6 when i click on login button, i want to show project switch. Any Suggestions Thanks
possible better answer: http://stackoverflow.com/a/27941850
has answer: http://stackoverflow.com/a/27942764
has answer: http://stackoverflow.com/a/27943548
has title: ng-switch in Angular with Parent Child Controller
type: Question
has answer: http://stackoverflow.com/a/27943617
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/44554860
score: 0
type: AnswerComment
type: Comment
has text: Ah, then they must've changed that, literally, within the last few days and I didn't get that 301 until now. You're right, it does that.
comment on: http://stackoverflow.com/a/28086867

http://stackoverflow.com/q/27873478
tagged with: url-rewriting
tagged with: google-drive-api
answer count: 0
type: UnansweredQuestion
tagged with: google-api
has body: I encounter the following error in console while trying to execute my code: POST https://content.googleapis.com/urlshortener/v1/url?alt=json&amp;key=AIzaSyB3BGJskI7cJUvnl7jzjiX4eh86K9sldgA 403 (Forbidden) I am using google URL Shortner API, and feel that the issue is derived from insufficient permission as shown by the error in details: { "error": { "errors": [ { "domain": "global", "reason": "insufficientPermissions", "message": "Insufficient Permission" } ], "code": 403, "message": "Insufficient Permission" } } Below is the part of the code that I think affects it: / The Browser API key obtained from the Google Developers Console. var developerKey = 'ID'; // The Client ID obtained from the Google Developers Console. var clientId = 'ID'; // Scope to use to access user's photos. var scope = ['https://www.googleapis.com/auth/drive']; var pickerApiLoaded = false; var oauthToken; // Use the API Loader script to load google.picker and gapi.auth. function onApiLoad() { gapi.load('auth', {'callback': onAuthApiLoad}); gapi.load('picker', {'callback': onPickerApiLoad}); } function onAuthApiLoad() { window.gapi.auth.authorize( { 'client_id': clientId, 'scope': scope, 'immediate': true }, handleAuthResult); } In particular, 'scope': scope, I have been struggling with this issue for a while and is looking for a soluton.
has comment: http://stackoverflow.com/comment/44149153
has comment: http://stackoverflow.com/comment/44149139
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: insufficient permission error due t scope

http://stackoverflow.com/comment/44032405
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27812291
score: 0
has text: so you want that bounce effect to come while showing and hiding the `wrap`?

http://stackoverflow.com/comment/44303697
score: 0
type: AnswerComment
type: Comment
has text: So this actually means that when the TodoList is 're-rendered' a TodoItem will not get 're-rendered' if its state doesn't change?
comment on: http://stackoverflow.com/a/27954171

http://stackoverflow.com/comment/44285040
type: Comment
comment on: http://stackoverflow.com/a/27940060
has text: In my case, I need to inject the data into all my controllers and routes, how can I do that with your suggestion?
score: 0
type: AnswerComment

http://stackoverflow.com/a/27865424
has comment: http://stackoverflow.com/comment/44134178
answers question: http://stackoverflow.com/q/27864532
type: Answer
accepted answer of: http://stackoverflow.com/q/27864532
has body: Alex, I would try to load this function with $(window).load(functiion() { //your code here var wtf = $('#chat'); var height = wtf[0].scrollHeight; wtf.scrollTop(height); } The difference between that and document.ready is document.ready fires when the document is loaded which is before the whole page loads in some instances. It will be a slightly slower load time if you do this but your script should at least work consistently. I have faced similar troubles. Give it a try and let me know how it works for you.
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/27883317
type: AcceptedAnswer
has body: MAY HELP USING API PUSHSTATE ?. https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27882135
answers question: http://stackoverflow.com/q/27882135

http://stackoverflow.com/comment/44178190
score: 0
comment on: http://stackoverflow.com/a/27888545
type: Comment
has text: after I saw your comment I tested on Chrome,IE and Opera, worked fine on all 3, I don't have FF to test it on. Sure there is other ways to do it if needed. The fact that it's jumping straight to the section in FF suggests that jquery isn't loading for some reason...
type: AnswerComment

http://stackoverflow.com/a/27867508
has comment: http://stackoverflow.com/comment/44137476
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27867463
has body: Cloning an elements means there will be two identical elements (having the same class aswell) afterwards. Each time you click the button, all elements having the .parent class are cloned and appended to the #content Regarding the animation: The appended elements are not known to the DOM, so the .on('click') is not working. Try to put a wrapper around your .parent elements and then use the following syntax: HTML Header paragraph content Add JS $('.wrapper').on('click', '.parent .header', function(){ [...] });
downvote count: 0
type: Answer

http://stackoverflow.com/q/27849391
tagged with: angularjs
upvote count: 2
downvote count: 1
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/27849652
accepted answer: http://stackoverflow.com/a/27849652
has title: How to recursively render JSON tree as HTML using AngularJS?
has body: Suppose I have the following JSON structure in my javascript as a variable named myTree: [ {"name": "A", "children": [ {"name": "C", "children": []}, {"name": "D", "children": []}, ] }, {"name": "B", "children": []} ] I would like to use AngularJS to render it as the following HTML. How can I do it? FYI, the tree can have arbitrary depth. I have shown only a very simple example here. A C D B
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44174036
has text: well a small mod to `re.lastIndex = match.index+1;` fixes this *"issue"*.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27886420
type: AnswerComment

http://stackoverflow.com/q/27887951
downvote count: 0
tagged with: javascript
has body: I am trying to find a suitable way to identify individual shapes on my canvas. I am creating a seat booking tool that allows the user to position rectangles on a grid that will hold seat location information somehow (seat number to start with). At the moment I have a shape function : function Shape(x, y, w, h, fill) { this.x = x || 0; this.y = y || 0; this.w = w || 1; this.h = h || 1; this.fill = fill || '#AAAAAA'; } And a prototype to give the context Shape.prototype.draw = function(ctx) { ctx.fillStyle = this.fill; ctx.fillRect(this.x, this.y, this.w, this.h); } For now, as I am purely in testing and trying to learn how to do this, I have set up a doubleclick event listener to run the following canvas.addEventListener('dblclick', function(e) { var mouse = myState.getMouse(e); for(var i=0; i &lt;= 180; i += 20){ for(var j = 0; j &lt;= 225; j += 25){ myState.addShape(new Shape(mouse.x + i, mouse.y + j, 15, 20, 'rgba(0,255,0,.6)')); }} }, true); My thinking behind this is as follows. Since a typical seating plan can contain hundreds if not thousands of seats, I will give the option to enter in the rows and columns of a block of seats and have the user delete the ones they don't need (also no real idea how to do that either) but for now I manually input rows and columns. My question is, how do I assign each new shape created an id of sorts? someway to make each shape store a unique number to identify it's position? Cheers in advance for any help. I should mention I've looked at using pre existing libraries but can't seem to install them correctly (always just used links in the header).
tagged with: http://stackoverflow.com/tag/html
has title: Keeping track of shapes on a canvas
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27888020
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: canvas
accepted answer: http://stackoverflow.com/a/27888020

http://stackoverflow.com/comment/44278878
comment on: http://stackoverflow.com/a/27933223
type: AnswerComment
score: 0
type: Comment
has text: Thanks for the edit. What does this .sort() do and why is it .sort()[0]?

http://stackoverflow.com/comment/44289075
type: Comment
type: QuestionComment
has text: maybe if you try the [ng-style](https://docs.angularjs.org/api/ng/directive/ngStyle) and [ng-class](https://docs.angularjs.org/api/ng/directive/ngClass) directives instead of `style` and `class` attributes?
score: 1
comment on: http://stackoverflow.com/q/27946907

dayofweek
type: Tag
tags question: http://stackoverflow.com/q/27883478
tag name: dayofweek

http://stackoverflow.com/q/27844598
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27844954
upvote count: 0
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44093366
favorite count: 0
tagged with: ajax
has title: Access Client Side Variable on Server Side without using hidden field
type: Question
has comment: http://stackoverflow.com/comment/44116760
score: -2
has comment: http://stackoverflow.com/comment/44095634
downvote count: 2
has body: I'm trying to store value in client side and access it in server side without using hidden field because of security issues. I tried using label but I wasn't able to access the value on server side. I could use web methods but I don't want to postback the page and I cannot use viewstate because its is encrypted and using session is not a good option.
linked to: http://stackoverflow.com/q/17810063
answer count: 1
tagged with: c#

http://stackoverflow.com/q/27899364
type: Question
has body: I have used this chart library but I don't know how can load data into it. I have never load data from mysql to chart. So I don't know what is best practice ... So I have in MySQL table Orders rows like: id | price | kind | orderdate ----------------------------- 1 | 35 | 2 | 2013-01-01 2 | 30 | 1 | 2013-01-01 3 | 25 | 3 | 2013-01-01 4 | 15 | 2 | 2013-01-01 Further c3js loading data in format like: columns: [ ['x', '2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05'], ['kind1', 30, 200, 100, 400, 150], ['kind2', 30, 200, 100, 400, 150], ['kind3', 30, 200, 100, 400, 150], ] So I have created dates array like below ['x', '2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05'] and I need for every this date, number of rows where example kind=1. But I don't know how MySQL query must looks like... Do I need query for each date in my dates array? Or Is there better way ? Thanks for any help!
tagged with: javascript
has title: Load data into chart through sequelizejs from mysql database
has answer: http://stackoverflow.com/a/28440015
score: 0
answer count: 1
tagged with: c3.js
tagged with: sequelize.js
type: UnansweredQuestion
tagged with: mysql

http://stackoverflow.com/comment/44983851
has text: @MishaPrasolov the answer in the link provided by user3681587 works for me also where you set this.addMenu('topbar',true, ['user']); in menus.client.services.js then override it for the specific pages in your Menus.addMenuItem statement
type: QuestionComment
comment on: http://stackoverflow.com/q/27891852
score: 0
type: Comment

http://stackoverflow.com/a/27931594
has comment: http://stackoverflow.com/comment/44261051
score: 14
upvote count: 15
type: AcceptedAnswer
type: Answer
has body: var strtDt = new Date("2007-07-01"); var endDt = new Date("1942-07-01"); var flag = 0; // false if (endDt &lt;= strtDt){ flag = 1; // true alert("true"); } It works check out the plunker
has comment: http://stackoverflow.com/comment/44261024
accepted answer of: http://stackoverflow.com/q/27931432
answers question: http://stackoverflow.com/q/27931432
downvote count: 1

http://stackoverflow.com/q/27947984
has body: I want to play a video after another video so I use this code To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video This works fine in chrome but when i play this in firefox the 2nd video (video2.mp4) dose not play, as firefox dose not support mp4 format. So is there any process to set the second video in mp4, webm and ogg file format so that most of browsers can play the video.
tagged with: video
type: Question
has answer: http://stackoverflow.com/a/28012977
answer count: 1
tagged with: javascript
has title: Playing videos one after another in html5 video player
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44291047
linked to: http://stackoverflow.com/q/5703203
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/44291070
downvote count: 1

http://stackoverflow.com/comment/44302238
has text: Just read through your edited answer, thanks for pointing out the problem, I'll try to apply that to the solution above. Thanks for taking the time to explain it to me.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27952402
score: 1

http://stackoverflow.com/comment/44073268
type: Comment
comment on: http://stackoverflow.com/q/27830277
has text: Can you run the query in the mongo shell and post an explain? I am suspicious of RoboMongo but I also don't know much about it.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44073980
has text: possible duplicate of [AngularJS- Login and Authentication in each route and controller](http://stackoverflow.com/questions/20969835/angularjs-login-and-authentication-in-each-route-and-controller)
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27834242

http://stackoverflow.com/comment/44070225
type: Comment
has text: You copied all those values to change one? What is `$.fn.fsvs`? Weird way to call it, that is not the normal jQuery pattern.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27832191

http://stackoverflow.com/q/27910121
tagged with: javascript
has comment: http://stackoverflow.com/comment/44226001
has comment: http://stackoverflow.com/comment/44236996
has title: Execute JavaScript on Form Submit
score: 0
has comment: http://stackoverflow.com/comment/44243884
answer count: 1
type: UnansweredQuestion
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/27928086
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/44243835
has body: I have a form displayed on a layer (I'm using ChicoUI as UI Framework), everything is managed through Google Apps Script. Everything went fine (The submit sends data to a google spreadsheet), but I need the following: When the submit button is pressed I need to change the layer content through a simple js line. to display the classic "Thank you message" with a close button. As far as I saw, everything leads to return something in the gs script, for instance in the doGet() method. It´s posible to execute a framework method instead of returning something? Remember that I have no issues with JS, but with Google Apps Script. Thanks a lot in advance!

http://stackoverflow.com/a/27870468
has comment: http://stackoverflow.com/comment/49579138
score: 24
type: Answer
answers question: http://stackoverflow.com/q/27861435
has comment: http://stackoverflow.com/comment/49600561
has comment: http://stackoverflow.com/comment/49630899
accepted answer of: http://stackoverflow.com/q/27861435
upvote count: 24
type: AcceptedAnswer
has body: I think different aspects of bootstrap's carousel plugin give the effects you mention. Active items have display: block while not active items have display: none This can be solved by giving all items display: block and then setting the position to absolute with top: 0 and left: 0, resulting in the items overlapping. Setting opacity: 0; makes them invisible by default. Less: .carousel-inner &gt; .item { opacity: 0; top: 0; left: 0; width: 100%; display: block; position: absolute; } One problem of the position: absolute is that the container does not get a height. The preceding can be solved by setting the position of the first item to relative (it is add the right position already). In Less code, it is as follows: .carousel-inner &gt; .item { :first-of-type { position:relative; } } Bootstrap uses translate3ds to change the position of the item in the space. You won't need these transformations, so reset them. Leveraging Less, code shown below: .carousel-inner &gt; .item { transform: translate3d(0,0,0) !important; } The CSS transitions are triggered by adding and removing CSS classes with jQuery. The time between these class changes has been hardcoded in the carousel plugin code (Carousel.TRANSITION_DURATION = 600). So, after 600 ms, one item becomes active (having the .active class). That is the reason for the unexpected behavior if your css transition-duration is greater than 0.6 seconds. The CSS class changes are as follows: The active item has class .active -> .active.left -> none The next item has no class -> .next.left -> .active So the .active.left and .next.left are important (or .prev.right and .active.right when you slide backwards). Because all images are already stacked, you can use the z-index property to make an image in the stack visible, because we can change the opacity at the same time. You can use the following Less code to fade in the next slide: .carousel-inner { &gt; .next.left { transition: opacity 0.6s ease-in-out; opacity: 1; z-index:2; } &gt…
downvote count: 0

http://stackoverflow.com/comment/44093514
comment on: http://stackoverflow.com/a/27844277
type: Comment
has text: @MatteoTassinari: I wonder if you've just happened to overflow the variable so the browser stopped the loop. I don't think this *actually* works for the reason you think it does.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27806302
score: 0
has body: I try to cancel changes made to a ng-repeat item by re-affecting a copy of it that I made just before editing it, the original object is affected but nothing change in the view. It's just plain weird, and I haven't figure out why! http://jsfiddle.net/leseulsteve/a16j16mk/8/ &lt;div ng-controller="MyCtrl"&gt; &lt;ul ng-repeat="item in list"&gt; &lt;li ng-click="edit(item)"&gt;{{item.description}}&lt;/li&gt; &lt;/ul&gt; {{originalDescription}} &lt;/div&gt; -- function MyCtrl($scope, $timeout) { $scope.list = [{ description: 'I love bacon' }, { description: "J'aime le bacon" }]; $scope.edit = function (item) { var originalItem = angular.copy(item); item.description = 'aaa'; /// update the view $timeout(function () { item = originalItem; // doesn't update the view :(( $scope.originalDescription = item.description; // Show the original description. }, 1000); } }
has comment: http://stackoverflow.com/comment/44022274
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
type: Question
has title: reflect change made by object affectation to scope
has comment: http://stackoverflow.com/comment/44022124
tagged with: javascript
has comment: http://stackoverflow.com/comment/44021856

http://stackoverflow.com/a/27823241
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27823187
has body: The code for triggering ajaxSuccess/ajaxComplete are written in the end of $.ajax(), $.get(), $.post(), etc. The above events are related to jQuery and the $.ajax(), $.get(), $.post() functions are jQuery functions. The XHR is native JavaScript and is no way related to jQuery.

http://stackoverflow.com/a/32173707
has body: I've had poor results trying to use PM2 as the sole means by which to monitor my Node.js applications. In the end the approach I took was to use to Monit to monitor the application process and use pm2 within the monit configuration script to startOrRestart or stop the process. For example, in a monitrc file: check process node_app matching /home/webapps/node_app/app.js start program = "/bin/bash -lc 'cd /home/webapps/node_app &amp;&amp; PM2_HOME=/home/webapps/.pm2 /usr/bin/pm2 startOrRestart processes.json'" stop program = "/bin/bash -lc 'cd /home/webapps/node_app &amp;&amp; PM2_HOME=/home/webapps/.pm2 /usr/bin/pm2 stop processes.json'" Not only does this allow you to "watch the watcher" it helps as a work-around for the persistent PM2 fails to restart applications after a reboot bug.
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27825220
score: 2

http://stackoverflow.com/comment/44099012
score: 0
has text: Why not using `$(#responseCode).val(respData.responseCode)` ?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27847533

http://stackoverflow.com/comment/44159333
type: Comment
comment on: http://stackoverflow.com/a/27878827
type: AnswerComment
has text: I've changed .bind(). And you solution works great too. Thanks :D
score: 0

http://stackoverflow.com/comment/44088247
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27842083
has text: What jQuery version are you using? I played around with your code a bit and noticed that the calendar displayed by default when using 1.7.2 (not with 1.9.1 for example): [**JsFiddle**](http://jsfiddle.net/gfn6mrdn/)
score: 0

http://stackoverflow.com/q/27817698
answer count: 1
favorite count: 0
score: 6
has answer: http://stackoverflow.com/a/27817794
upvote count: 6
type: AnsweredQuestion
has title: How to add image in Highcharts Title and subtitle
tagged with: image
type: Question
tagged with: highcharts
downvote count: 0
accepted answer: http://stackoverflow.com/a/27817794
tagged with: javascript
tagged with: title
has body: I'm trying to add images in chart title using Highcharts.The image doesn't show up.There's no script error as well.I doubt whether highcharts support images in title or not.Any help would be appreciated.Thank you in advance. Here's the fiddle for reference: http://jsfiddle.net/LHSey/123/ chart.setTitle({ text: "Testing" + " " + "../images/appendImage.png " }, { text: "This is a test" });

http://stackoverflow.com/a/27887448
has body: Try it: var dateUnits = { miliseconds: 0, seconds: 1, minutes: 2, hours: 3, days: 4, month: 5, years: 6 }; function dateDiff(date1,date2,unitRetur) { var unit = des.dateUnits.miliseconds; if (arguments.length &lt; 2) { return null; } if (arguments.length = 3) { unit = arguments[2]; } var dif = date2 - date1; switch (unit){ case des.dateUnits.seconds: //86400000 dif = Math.round(dif/1000); break; case des.dateUnits.minutes: dif = Math.round(((dif / 1000)/60)); break; case des.dateUnits.hours: dif = Math.round((((dif / 1000) / 60) / 60)); break; case des.dateUnits.days: dif = Math.round((((dif / 1000) / 60) / 60)/24); break; case des.dateUnits.month: dif = Math.round((((((dif / 1000) / 60) / 60) / 24)) / 30); break; case des.dateUnits.years: dif = Math.round((((((dif / 1000) / 60) / 60) / 24))/360); break; } return dif; } var mois = (date1[2] - 1); var d1 = new Date(date1[1], mois, date1[3]); var dif = dateDiff(d1, new Date(), dateUnits.hours);
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27887297
downvote count: 0

http://stackoverflow.com/a/27957331
has body: You could possibly try RegExp with given page name itself without any hidden field: var url = window.location.pathname; if(url.match('index.html')) { //to do } else if(url.match('about.html')) { //to do } else { //to do }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27956897
score: 1
upvote count: 1

http://stackoverflow.com/comment/44277519
has text: no, beacause i want one query and use the result to list the last messages, and also display the topic feed without another request.
score: 0
comment on: http://stackoverflow.com/q/27940750
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27849474
upvote count: 1
has comment: http://stackoverflow.com/comment/44104356
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27829534
has body: Setting up an event aggregator Making an event aggregator in Backbone is trivial, just extend the events object, window.vent = _.extend({}, Backbone.Events); We attach the event aggregator, vent, to the global scope so that anyone can listen in. If you're using Marionette you can use the built-in aggregator in Backbone.Wreqr the built-in Marionette messaging system (Note: Wreqr will be switched out with a new messaging API, Radio, starting with Marionette v.3, but I have it from a good source that the update manager should migrate all Wreqr instances to Radio). Createing an event aggregator is a matter of calling, window.vent = new Backbone.Wreqr.EventAggregator(); Now to help your problem, we'll use the event aggregator to set up a pubsub system, where your item's view will subscribe to an event that will help them to properly react to a scroll. The view that manages the scroll will be publishing this event. Note: Backbone.Wreqrcan also be equipped to use Channels if you want to create independent messaging pipelines. Check out the docs. Subscribing So let's set up the subscriptions. In the item's view do initialize: function () { this.listenTo(vent, "dropdown:before:scroll", function() { this.isScrolling = true; } this.listenTo(vent, "dropdown:end:scroll", function() { this.isScrolling = false; } } Publishing The events we just subscribed to will be published right before and after the scrollTop call, by triggering the event on vent. So you'd rewrite the maxlimit checker like this, if (currItem &gt; maxItem) { vent.trigger("dropdown:before:scroll"); someElement.scrollTop(); vent.trigger("dropdown:end:scroll"); } The items listening to these events will know that you're scrolling since trigger events are synchronous and will fire in the correct order. Preventing the highlight Finally, now that you're publishing the scrollTop event and your items are listening for it, you make sure that the item that encounters a mouseenter knows when not to highlight. onMouseEnter:…
has comment: http://stackoverflow.com/comment/44107025
type: Answer
answers question: http://stackoverflow.com/q/27829534
has comment: http://stackoverflow.com/comment/44107380

http://stackoverflow.com/a/27835798
answers question: http://stackoverflow.com/q/27835488
downvote count: 0
type: Answer
upvote count: 1
has body: else { echo" Resend Your detail "; echo" "; } This Is right Answer problem solved
score: 1

http://stackoverflow.com/comment/44293756
type: Comment
type: QuestionComment
has text: I just logged into my stripe account and see what you mean. However, their approach doesn't look like a typical route change which would be handled with iron-router, but instead I **suspect** they are just updating the browser's address bar manually. I would suggest getting the modal to work first before thinking about updating the browser's address bar. I'll see if I can find anything on the other part.
comment on: http://stackoverflow.com/q/27911701
score: 0

jsjac
tags question: http://stackoverflow.com/q/27878477
type: Tag
tag name: jsjac

http://stackoverflow.com/comment/44299535
has text: Sure thing - added to the original post.
score: 0
comment on: http://stackoverflow.com/q/27951102
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44034134
type: AnswerComment
has text: Ok, trigger this event. $('#Comments').change();
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27813477

http://stackoverflow.com/q/27848492
linked to: http://stackoverflow.com/q/19380738
answer count: 1
duplicate of: http://stackoverflow.com/q/19380738
upvote count: 1
has answer: http://stackoverflow.com/a/27850998
tagged with: mongodb
has body: I have a query that get user posts and I wish to show only the posts of the Country selected by visitor. So far I'm trying to do something like this: var country = req.query.country || req.session.country || { $ne: '' }; Posts.find({}) .populate('_creator') .where('_creator.country').equals(country) .exec(function(err, posts) { console.log(posts); }); Unfortunately it doesn't work. How can I have a query similar to this? EDIT: This is the Posts Schema: var postsSchema = new mongoose.Schema({ _creator: { type: mongoose.Schema.Types.ObjectId, ref: 'User' }, text: { type: String, default: '' }, created_at: Date });
has comment: http://stackoverflow.com/comment/44106142
downvote count: 0
tagged with: mongoose
tagged with: javascript
has title: Mongoose using where after populate
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27850998
score: 1
favorite count: 0
type: Question

http://stackoverflow.com/q/27845161
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has title: How to add a list of node's name with tooltip in sankey
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27859987
tagged with: javascript
tagged with: jquery
tagged with: sankey-diagram
answer count: 1
downvote count: 0
has body: I have made a sankey diagram with rChars package in R. But I want to add a function, when we move to a link or a target node, it will show all the names of source node in a tooltip (or a new box at the right top of the graph). For example, it will show "ddd.fr, pramana.fr" when we move to the node "target1". I'm new in d3.js and know little about svg attribute. I have tried to do something with "link.append("title").text" or "node.append("title").text". But what I have done seem to be no use, because the function(d) always return one data but not an array. Here is my code, hope someone can help, thanks !
accepted answer: http://stackoverflow.com/a/27859987

http://stackoverflow.com/comment/115145240
type: AnswerComment
comment on: http://stackoverflow.com/a/27947425
type: Comment
has text: It's important to include a second (error) function in the arguments to `then` because if the element doesn't exist at all, this will result in an error that causes the spec to fail.
score: 0

http://stackoverflow.com/q/27930702
has answer: http://stackoverflow.com/a/30440399
has comment: http://stackoverflow.com/comment/44259095
type: AnsweredQuestion
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/27931117
score: 51
has title: Ionic framework $state.go('app.home'); is adding back button on page where I want to go (how to remove it)?
has answer: http://stackoverflow.com/a/30674598
tagged with: ionic-framework
type: Question
possible better answer: http://stackoverflow.com/a/27931117
has answer: http://stackoverflow.com/a/27931176
has body: I have app with sidebar menu. I am on second page and I am calling controller function which redirect me to first page using: $state.go('app.home'); Problem is that on this page is now displayed back button next sidebar menu icon, see image below: Could somebody tell me how to deny to add back button into pages which has assigned sidebar menu? Thanks for any help. app.js is with router config is following: angular.module('Test', ['ionic', 'config', 'Test', 'LocalStorageModule']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if(window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); } if(window.StatusBar) { // org.apache.cordova.statusbar required StatusBar.styleDefault(); } }); }) .config(function($stateProvider, $urlRouterProvider, localStorageServiceProvider) { localStorageServiceProvider .setPrefix('max_relax'); $stateProvider .state('app', { url: '/app', abstract: true, templateUrl: 'templates/menu.html', controller: 'AppCtrl' }) .state('app.home', { url: '/home', views: { 'menuContent' :{ templateUrl: 'templates/home.html', controller: 'HomeCtrl' } } }) .state('app.saved', { url: '/saved', views: { 'menuContent' :{ templateUrl: 'templates/saved.html', controller: 'SavedCtrl' } } }) .state('app.settings', { url: '/settings', views: { 'menuContent' :{ templateUrl: 'templates/settings.html', controller: 'SettingsCtrl' } } }); // if none of the above states are matched, use this as the fallback $urlRouterProvider.otherwise('/app/home'); }); Edit: Added menu template: Back Menu Home Saved Settings
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/28889338
has answer: http://stackoverflow.com/a/29579184
tagged with: angularjs
upvote count: 52
favorite count: 0
accepted answer: http://stackoverflow.com/a/27931176
has comment: http://stackoverflow.com/comment/44259295
downvote count: 1

http://stackoverflow.com/comment/44239739
score: 0
type: AnswerComment
type: Comment
has text: Sorry about that. Anyway I have tried your solution, and i'm stuck when i trying to modify the getChildren function, [link]() here's my query result, the 1st parent would be the stype_id, 2nd parent is the symptom_id, then the last child is ailment_id. And how do i can do in a multiple-selection way, say knowing the next child will have the same parent, add only additional unique options?
comment on: http://stackoverflow.com/a/27906637

http://stackoverflow.com/comment/44313171
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27954806
has text: @Xan I'm making some tests to see if the "chrome_urls_overrides" field behaves like so... because I've seen it in the OP's extension. Thanks for the suggestion, I also believe that too.

http://stackoverflow.com/comment/44334865
type: Comment
comment on: http://stackoverflow.com/a/27896028
has text: This doesn't work. I already had code like that, and still, I get the error `loading OggS failed.`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44190429
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27894670
has text: Oddly it's returning "0". Could it be that I have to set up a special function to trigger once the image has fully loaded? edit: yep, that was the problem.
score: 0

data-binding
tags question: http://stackoverflow.com/q/27882773
tags question: http://stackoverflow.com/q/27939385
type: Tag
tags question: http://stackoverflow.com/q/27861842
tags question: http://stackoverflow.com/q/27924745
tags question: http://stackoverflow.com/q/27910441
tags question: http://stackoverflow.com/q/27817379
tags question: http://stackoverflow.com/q/27816497
tag name: data-binding

http://stackoverflow.com/a/27806848
has comment: http://stackoverflow.com/comment/44023374
answers question: http://stackoverflow.com/q/27806689
has comment: http://stackoverflow.com/comment/44023319
type: Answer
has comment: http://stackoverflow.com/comment/44023634
score: 0
has comment: http://stackoverflow.com/comment/44024091
has body: $("#iframe").append setIframe(gon.user_appointments_url + "/" + calEvent.id + "/edit", 630) setIframe = (srcAttribute, height) -&gt; ifrm = document.createElement("IFRAME") ifrm.setAttribute "src", srcAttribute ifrm.style.width = 100 + "%" ifrm.style.height = height + "px" ifrm.onload = setContent return ifrm setHeaderBgColor = (header_div_class) -&gt; $("#iframe").contents().find("#appointments-form-header").addClass header_div_class setContent() -&gt; setHeaderBgColor(getDivClassFromStatus(jsEvent.status)) Should do the trick.
has comment: http://stackoverflow.com/comment/44023613

http://stackoverflow.com/comment/44423699
type: AnswerComment
has text: @shaileshshekhawat Very simple. The outer iterates the "documents" from the `.find()` query. The "inner" iterates the "array members", hence "Invitation". It's an array in the document still and not flattened out like you were doing processing `$unwind`. It's logical and a lot faster than processing from the aggregate source. That's what I said right at the beginning.
comment on: http://stackoverflow.com/a/27961171
score: 0
type: Comment

http://stackoverflow.com/comment/44301977
type: Comment
comment on: http://stackoverflow.com/a/27953019
score: 0
type: AnswerComment
has text: These example are fully disconnected like each example is independent, no routing, navigation i mean end to end flow implementation in those docs

http://stackoverflow.com/comment/44087830
has text: I'm currently trying to understand your issue, i mean debug it. It looks like you should handle exception will typing and use `styleTag.html( $this.val() );`
comment on: http://stackoverflow.com/q/27841400
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27871653
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Text field won't focus unless window is in focus
linked to: http://stackoverflow.com/q/6563859
has comment: http://stackoverflow.com/comment/44235567
has body: I have a Greasemonkey script that automates inputting user info. But before the form can be submitted, the fields have to be in focus (I think they use AngularJS to verify that a valid name/email has been entered). So in my code I do: document.getElementById('name').value = "Name here"; //Enter name in field document.getElementById('name').focus(); //Focus on the field This works fine but only when the window is active. If the window is not active, it will enter the name but the field will not come to focus (so it cannot be submitted). Is there any modification that can be done to fix this? Edit: It is hard for me to provide an example because the code has to be run from a window that is not active but here is the code for the input field. &lt;input id="namefield[name]" name="name" ng-model="nameField.form.name" ng-pattern="nameRegex()" placeholder="John Doe" required="" style="width: 246px" type="text" class="ng-valid-pattern ng-dirty ng-valid ng-valid-required"&gt;
score: 1
has answer: http://stackoverflow.com/a/27918794
tagged with: forms
upvote count: 1
type: Question
tagged with: greasemonkey
tagged with: javascript

http://stackoverflow.com/comment/44197070
comment on: http://stackoverflow.com/q/27893300
has text: If you are waiting for the compose button to appear, why don't you poll for that button instead of `document.readyState` ? There is no guaranteed relation between readyState and that button...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27891017
type: UnansweredQuestion
tagged with: ip-address
has title: Ip Address Message in Console
type: Question
has body: I have the following code that I use to retrieve my ip address However I get the following message in the console: Resource interpreted as Script but transferred with MIME type text/html I figure it is because I am making a reference to a js file, however this is a web page that contains html code. How can I get rid of this message?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44182858
score: 0
has comment: http://stackoverflow.com/comment/44182924
answer count: 0

http://stackoverflow.com/comment/44293350
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27948812
has text: Instead of `$(selectvalue).val()` , try: `$('body').find(selectvalue).val()`
score: 0

http://stackoverflow.com/comment/44307581
comment on: http://stackoverflow.com/q/27950115
has text: Your program is working perfectly for me, printing 99 then 8675309 to the console log in Chrome. I copied your c++ code above into "squish.cc" and then ran: emcc squish.cc -s EXPORTED_FUNCTIONS="['_gsr','_main']"
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27831807
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44069524
has comment: http://stackoverflow.com/comment/44070200
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Web Page: Certain image appears when I run locally, but disappears when displayed on the internet
has comment: http://stackoverflow.com/comment/44069546
has body: I'm making a simple web game, and I'm using a number of different sprites. When I run it in my browser locally, all the images appear like they should. However, when I ftp my project to the server and access it through the internet, two specific sprites out of the dozen others fail to appear. I don't understand why this happens, or why it's those two images. In my script, all my path names for the sources are relative to my index.html, so I can't see why that would be the problem. Does anyone have any idea what might be causing this to happen? EDIT: Here's some of my code for those specific images var ImageSources = [ "jseco_tiles/fish_tiles/crab.png", "jseco_tiles/Sturgeon/Sturgeon.png", ] var fishImage = new Image(); fishImage.src = ImgSources[0]; fishImage.addEventListener('load', drawTile); var sturgeonImage = new Image(); sturgeonImage.src = ImgSources[1]; sturgeonImage.addEventListener('load', drawTile); I actually had a bunch of images created this way (that array is much bigger), which I know isn't a good idea, but regardless it all worked locally.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27846863

http://stackoverflow.com/comment/44104990
has text: I don't have access to anything but 2 files for the components .. the main html file and the plugin file. No access to backend or main system files .. so a dependency system cannot be done (or I would)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27850349

http://stackoverflow.com/q/27856319
has answer: http://stackoverflow.com/a/27856805
type: Question
answer count: 1
downvote count: 0
tagged with: jax-rs
favorite count: 0
has body: I am sending some arguments from javascript to jaxrs but all i get at jaxrs is null. Here is my code: @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.TEXT_PLAIN) public String sending(@QueryParam("var1") String var1, @QueryParam("var2") String var2) { System.out.println(var1+var2); return var1 + var2; } And my Javascript: xmlhttp.open("POST","link",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send("var1=stack&amp;var2=flow");
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: web-services
has title: HTTP post in jaxrs
tagged with: javascript

http://stackoverflow.com/a/77385157
upvote count: 0
type: Answer
score: -2
downvote count: 2
has body: the easy way use you can use dangerouslySetInnerHTML
answers question: http://stackoverflow.com/q/27934238

http://stackoverflow.com/comment/44273850
score: 1
type: AnswerComment
has text: We seem to not agree about the good habitness, to me there is no difference between checking value+type and checking value+checking value again. Just in case.
type: Comment
comment on: http://stackoverflow.com/a/27938574

http://stackoverflow.com/q/27847395
favorite count: 0
has comment: http://stackoverflow.com/comment/44101985
has title: Chart not showing and error Uncaught ReferenceError: $ is not defined
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44101049
upvote count: 1
linked to: http://stackoverflow.com/q/2075337
has comment: http://stackoverflow.com/comment/44101905
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/44101442
type: Question
has comment: http://stackoverflow.com/comment/44101187
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44101938
has comment: http://stackoverflow.com/comment/44101773
has comment: http://stackoverflow.com/comment/44101622
has comment: http://stackoverflow.com/comment/44101317
has comment: http://stackoverflow.com/comment/44100805
has body: I have a program that will show the percentage in high charts when you input the value in the textbox. here is my code Number of Arson: Number of Homicide: Number of Physical Injuries: Number of Carnapping: Number of Ethical Law Violation: then i save it as chart.html but when i run it using google chrome the chart is not showing and i get the error of Uncaught ReferenceError: $ is not defined whats wrong with my code?
has comment: http://stackoverflow.com/comment/44100360
duplicate of: http://stackoverflow.com/q/2075337
has comment: http://stackoverflow.com/comment/44100899

http://stackoverflow.com/a/27860493
has comment: http://stackoverflow.com/comment/44125392
has comment: http://stackoverflow.com/comment/44125111
upvote count: 3
has comment: http://stackoverflow.com/comment/44124699
has comment: http://stackoverflow.com/comment/44124666
has comment: http://stackoverflow.com/comment/44124598
score: 3
has comment: http://stackoverflow.com/comment/44125559
has body: Following the instructions found in the docs: In your DepartmentType form class, set the EmployeeType collection's allow_delete attribute to true: $builder ->add('name') ->add('employees','collection', array( 'type' => new EmployeeType(), 'prototype' => true, 'allow_add' => true, 'allow_delete' => true,//add this 'by_reference' =>false ) ); Next, add the delete button (either through the builder in your EmployeeType form (->add('delete', 'button')), or manually (using JS in the tempalte). Then attach an event listener to the form. Assuming you've added the delete button like so: //EmployeeType: $builder->add('delete', 'button', ['attr' => ['class' => 'delete-employee']]); If you're adding the buttons using JS in the view, then this code should do the trick: $('#department-form-selector').children('employee-form-selector').each(function(i) { $(this).append(' Delete '); }); When the buttons have been added (or are about to be added), attach a listener using jQ. The buttons needn't be in the DOM at this stage, because we're using event delegation, instead of direct binding: $('#department-form-selector').on('click', '.delete-employee', function() { $(this).closest('form').delete();//remove element //optionally submit department form via AJAX call to persist the delete return false;//stop event }); Now, to handle the form (assuming the entities are set up properly): //in the controller that handles the form: if ($form->isValid()) { //1 => we need to query for the data in the DB, so we know what to delete $current = $service->getCurrentDepartmentWithEmployees(); //get the current employees, that need to be updated $oldEmployees = new ArrayCollection(); foreach ($current->getEmployees() as $employee) $oldEmployees->add($employee); //2 => get the form data $department = $form->getData(); //3 => check if one or more eployees were deleted foreach ($oldEmployees as $employee) { if (!$department->getEmployees()->contains($employee)) {//employee was removed, update entity/entit…
has comment: http://stackoverflow.com/comment/44124487
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44124713
answers question: http://stackoverflow.com/q/27858594
has comment: http://stackoverflow.com/comment/44125441
type: Answer
accepted answer of: http://stackoverflow.com/q/27858594

http://stackoverflow.com/q/27879027
has comment: http://stackoverflow.com/comment/44159678
type: Question
linked to: http://stackoverflow.com/q/27867867
has answer: http://stackoverflow.com/a/27879737
accepted answer: http://stackoverflow.com/a/27879737
has comment: http://stackoverflow.com/comment/44159772
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to detect jquery is loaded when loading it dynamicly
answer count: 2
possible better answer: http://stackoverflow.com/a/27879829
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44160580
has body: I'm trying to load jquery to page if it's not loaded. I'll run some code right after loading it. With below code, i am trying to catch it when jquery is loaded. My code loads jquery correctly but not raising onreadystatechange event. if(typeof jQuery=='undefined') { var headTag = document.getElementsByTagName("head")[0]; var jqTag = document.createElement('script'); jqTag.type = 'text/javascript'; jqTag.src = 'http://localhost:8001/jquery-min.js'; headTag.appendChild(jqTag); jqTag.onreadystatechange= function () { if (this.readyState == 'complete') { this.loadWidget(containerId); } }; } else { this.loadWidget(containerId); } How can i catch it when jquery is loaded?
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/44160999
has answer: http://stackoverflow.com/a/27879829

http://stackoverflow.com/comment/53837108
has text: Really, field privacy in many languages *is* pseudo privacy. Take Java - you can always get the values of an object's 'private' fields using reflection. The privacy in this sense is really just a design pattern - it gives the consumer an easily understandable, tooling/compiler enforceable, interface on what methods should not ever be called. Preceding methods with an underscore is a perfectly sensible implementation of such an interface, even if it's just a convention rather than in the language spec.
comment on: http://stackoverflow.com/a/27853642
type: AnswerComment
score: 78
type: Comment

http://stackoverflow.com/q/27824859
has comment: http://stackoverflow.com/comment/44055598
possible better answer: http://stackoverflow.com/a/27825255
linked to: http://stackoverflow.com/q/2964140
tagged with: javascript
tagged with: express
accepted answer: http://stackoverflow.com/a/27825285
answer count: 2
upvote count: 21
has body: Node.js is a javascript environment Express is a framework What is a software framework? for Node.js? Why and when is it useful to use Express framework over Node.js standalone? What I mean is that, is this framework just a set of ready functions and modules that makes it easier to write codes from scratch? I'm asking this because I found lots of tutorials and guides on NodeJS with Express, but just a few on standalone NodeJs.
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27825285
has answer: http://stackoverflow.com/a/27825255
tagged with: node.js
type: AnsweredQuestion
type: Question
score: 20
has title: When should I use express.js over a standalone node.js

http://stackoverflow.com/q/27893431
has comment: http://stackoverflow.com/comment/44188276
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/44188357
downvote count: 0
has title: Passport Node.js CORS error
has comment: http://stackoverflow.com/comment/44188332
type: Question
upvote count: 2
has body: I've tried a million ways to get passport to work with my application to no avail. Every attempted login to every provider (Facebook, Google, Twitter, Microsoft) has resulted in an error like this one: XMLHttpRequest cannot load https://www.google.com/accounts/o8/ud?openid.mode=checkid_setup&amp;openid.ns=h…2F%2Ftest.sl%2Fauth%2Fgoogle%2Freturn&amp;openid.realm=http%3A%2F%2Ftest.sl%2F. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://test.sl' is therefore not allowed access. My application isn't that complicated, here's a summary of my server code. var express = require('express'); var ppGoogle = require('passport-google-oauth').OAuth2Strategy; var app = express(); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); app.use(express.static(__dirname + '/public')); //There's more config app.listen(7230); app.get('/auth/google', passport.authenticate('google')); app.get('/auth/google/return', passport.authenticate('google', { successRedirect: '/main', failureRedirect: '/login' })); passport.use(new ppGoogle({ clientID: '', clientSecret: '', callbackURL: 'http://test.sl/auth/google/return' }, function (accessToken, refreshToken, profile, done) { console.log('done'); })); Anyone know the solution? This thing is driving me crazy.
tagged with: cors
tagged with: javascript
has comment: http://stackoverflow.com/comment/44188324
tagged with: passport.js
tagged with: express
has answer: http://stackoverflow.com/a/27893706
accepted answer: http://stackoverflow.com/a/27893706
answer count: 1
has comment: http://stackoverflow.com/comment/44188183
has comment: http://stackoverflow.com/comment/44188166
favorite count: 0

http://stackoverflow.com/q/27923561
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: stream
type: Question
tagged with: javascript
has title: writing pdf from javascript/cordova
upvote count: 1
has answer: http://stackoverflow.com/a/27932967
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
has body: In our mobile application (cordova+html4) we have a requirement to display the PDF from a stream. We have a service which returns pdf stream. We would like to store that stream to a temp folder location of the mobile and display the PDF. The below sample java sample java code does the exact thing what I need. But how can I achive this functionality on java script? I mean reading a binary stream in java script. String fileURL = "https://1/////4/xyz"; String saveDir = "D:/Works"; try { URL url = new URL(fileURL); HttpURLConnection httpConn = (HttpURLConnection) url .openConnection(); httpConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); httpConn.setRequestProperty("TOKEN", "ghZtxnPfpJ63FgdT/59V+5zFTKHRdwm6rIfGJC+0B5W5CJ9pG33od7l+/L6S8R56"); int responseCode = httpConn.getResponseCode(); System.out.println("Reseponse Code = " + responseCode); if (responseCode == HttpURLConnection.HTTP_OK) { String fileName = ""; String disposition = httpConn .getHeaderField("Content-Disposition"); String contentType = httpConn.getContentType(); int contentLength = httpConn.getContentLength(); if (disposition != null) { // extracts file name from header field int index = disposition.indexOf("filename="); if (index &gt; 0) { fileName = disposition.substring(index + 10, disposition.length() - 1); } } else { // extracts file name from URL fileName = fileURL.substring(fileURL.lastIndexOf("/") + 1, fileURL.length()); } System.out.println("Content-Type = " + contentType); System.out.println("Content-Disposition = " + disposition); System.out.println("Content-Length = " + contentLength); System.out.println("fileName = " + fileName); // opens input stream from the HTTP connection InputStream inputStream = httpConn.getInputStream(); String saveFilePath = saveDir + File.separator + fileName; // opens an output stream to save into file FileOutputStream outputStream = new FileOutputStream( saveFilePath); int bytesRead = -1; byte[] buffer = new byte[BUFFER_SIZE]; while ((…

http://stackoverflow.com/comment/44059185
has text: @indubitablee http://jsfiddle.net/y1y4ee76/1/ please have a look at mine, if you click the anchors, works fine, but when clicking back OPEN FORUM, it works alternate.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27826263

http://stackoverflow.com/a/27877379
has body: Declare a new function which will handle the ajax request and the success response: function ajaxLoadImage(url, showElementContainer) { $("#loadimg").show(); jQuery.ajax({ 'url': url, cache: true, success: function(response){ if(showElementContainer) { $("#elementcontainer").show(); } $(".homefeed").html(response); $("#loadimg").hide(); }, }); return false; } And then when you bind click event, just do: $("#poto").click(function (e) { ajaxLoadImage("photos.php", true); });
type: Answer
has comment: http://stackoverflow.com/comment/44156398
accepted answer of: http://stackoverflow.com/q/27877288
score: 0
answers question: http://stackoverflow.com/q/27877288
type: AcceptedAnswer

http://stackoverflow.com/a/27957190
type: Answer
has body: The variable is visible only in the function and it is possible to access it only within the function, you can use global variable and then edot it insode the function.
answers question: http://stackoverflow.com/q/27957134
score: 0

http://stackoverflow.com/a/27850306
type: Answer
answers question: http://stackoverflow.com/q/27850191
has body: The easy way will be to use a cookies. Or local starage. Just add a backround color property to a cookie with the button click and have other pages read from it... Just make sure the cookie is readable by all pages that need it (path=/ for intire site). Here is some info on how to use them: http://www.quirksmode.org/js/cookies.html Good luck!
score: 0

http://stackoverflow.com/comment/44309698
score: 0
type: AnswerComment
type: Comment
has text: If one of the answers helped you, please consider accepting it. http://stackoverflow.com/help/accepted-answer
comment on: http://stackoverflow.com/a/27929485

http://stackoverflow.com/comment/44277702
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27940720
has text: Thanks, it will be offset().left
type: Comment

function-parameter
type: Tag
tags question: http://stackoverflow.com/q/27963214
tag name: function-parameter

http://stackoverflow.com/a/27867922
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44138252
downvote count: 0
score: 1
has body: This should work: {{category.Name}}
accepted answer of: http://stackoverflow.com/q/27867523
answers question: http://stackoverflow.com/q/27867523

http://stackoverflow.com/q/27955417
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to export many html table as a single excel file and each html table in a new sheet. how to export html table and append as a sheet in existing excel using javascript or jquery and how to rename the sheet ?
has answer: http://stackoverflow.com/a/27955464
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44305812
linked to: http://stackoverflow.com/q/22317951
type: Question
accepted answer: http://stackoverflow.com/a/27955464
answer count: 1
has title: how to export html table and append as a sheet in existing excel using javascript or jquery
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/27871073
has comment: http://stackoverflow.com/comment/44144970
accepted answer of: http://stackoverflow.com/q/27870671
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44145689
has comment: http://stackoverflow.com/comment/44144919
score: 2
upvote count: 2
has body: Change this line: table.rows[a].cells[4].innerHTML = parseInt(table.rows[a].cells[4].innerHTML) - sell; to this line: this.parentNode.parentNode.cells[4].innerHTML = parseInt(this.parentNode.parentNode.cells[4].innerHTML) - sell; To do it like you're trying, you would have to use a closure. This way, when you click a button, it adjusts the value of the button's parent's (td) parent (tr) cell 4.
answers question: http://stackoverflow.com/q/27870671

http://stackoverflow.com/q/27919493
type: Question
tagged with: javascript
tagged with: jquery
has body: Detect when user changes cookies manually or by some cookie editor 1. Without page reloading 2. Without setting intervals And fire an event or function Like Facebook, when you changes your some specific cookie values
score: 0
type: UnansweredQuestion
has title: Detect when cookies are changed manually by user
answer count: 0
has comment: http://stackoverflow.com/comment/44236638
has comment: http://stackoverflow.com/comment/44237124
tagged with: cookies

http://stackoverflow.com/comment/44313350
has text: you can copy html source code of the page from your browser also.
score: 0
comment on: http://stackoverflow.com/q/27946607
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27807990
tagged with: javascript
tagged with: jquery
has title: Moving option value on top of dropdown list using jQuery
score: 0
answer count: 2
has body: I have this code: function SelectReferralFromQueryString() { var queryStringName = GetParameterValues('Referral'); if (queryStringName != undefined || queryStringName != null) { queryStringName = decodeURIComponent(queryStringName); var exists = false; $('#refDropDown option').each(function () { if (this.value == queryStringName) { exists = true; var option = $(this); $(this).remove(); $('#refDropDown option').prepend(option); return false; } }); if (exists == true){ DropDownReferral.value = queryStringName; $("#refDropDown").prop("disabled", true); } } } function GetParameterValues(param) { var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < url.length; i++) { var urlparam = url[i].split('='); if (urlparam[0] == param) { return urlparam[1]; } else return false; } } And this HTML: Please Select Al Steve So, the logic is: If 'Referral' which is a query string, gets passed, then I am checking the value in my select option and moving it on top and disabling the dropdown. NOT WORKING! See the picture below. If the dropdown doesnt have the query string value then disable the dropdown and store it in the hidden field. (WORKING!) What I am missing here? If I am passing ?Referral=Albert, then it should show me 'Al' on top. If I am passing ?Referral=Steve, then is show 'Steve' on top and disable the dropdown.
has comment: http://stackoverflow.com/comment/44025086
has answer: http://stackoverflow.com/a/27808130
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44025144
type: Question
has answer: http://stackoverflow.com/a/27808159
accepted answer: http://stackoverflow.com/a/27808159
possible better answer: http://stackoverflow.com/a/27808130

http://stackoverflow.com/comment/44289723
score: 1
has text: @Nova_virus: Of course it's `undefined`. You don't assign a value to it until the `change` event is executed. Also, don't use `document.write`.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27946972

youtube-javascript-api
type: Tag
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/27843735

jetty-9
tag name: jetty-9
type: Tag
tags question: http://stackoverflow.com/q/27857102

http://stackoverflow.com/comment/72072150
has text: @FreddySidauruk, no, only 1.10 and newer.
comment on: http://stackoverflow.com/a/30075650
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27850866
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/27863640
downvote count: 0
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27863640
tagged with: javascript
tagged with: jquery
tagged with: zurb-reveal
upvote count: 3
has body: I thank you for your time viewing this newbish jubmled up question/post and ask for your most kindest regards while I attempt to get help! I am trying to set up an reveal modal to drop down with some angular.js linking in the controller for data and am having trouble! Keep in mind the code is not complete, but here is what I am attempting to do: &lt;div class="row"&gt; &lt;div class="small-12 columns"&gt; &lt;div class="row"&gt; &lt;div class="small-6 columns"&gt;&lt;h1&gt;Full Course Search&lt;/h1&gt; &lt;div&gt; &lt;label&gt;Filter:&lt;/label&gt; &lt;input type="text" ng-model="searchTxt" placeholder="Enter a class here"&gt; &lt;hr&gt;&lt;/div&gt; &lt;/div&gt; &lt;!-- &lt;h1&gt;Test {{searchTxt}}!&lt;/h1&gt;--&gt; &lt;/div&gt; &lt;table ng-controller="oflClassCtrl"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Course Title(Apex/Isis)&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr ng-repeat = "c in classes | filter:searchTxt"&gt; &lt;td&gt;&lt;td&gt;&lt;a href="#" data-reveal-id="myModal" ng-click="setClass($index)"&gt;{{c.class}}&lt;/a&gt;&lt;/td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="myModal" class="reveal-modal" data-reveal&gt; &lt;div class="accordion accorborder" ng-controller="oflClassCtrl" data-accordion&gt; &lt;div class="accordion-navigation"&gt; &lt;h3&gt;{{c.class}} &lt;/h3&gt; &lt;div id="p1" class="content"&gt; &lt;div class="row"&gt; &lt;div class="small-6 columns"&gt; &lt;h6&gt;Code:&lt;/h6&gt;{{c.code}} &lt;h6&gt;Offerings:&lt;/h6&gt;{{c.offerings}} &lt;/div&gt; &lt;div class="small-6 columns"&gt; &lt;h6&gt;Course Materials:&lt;/h6&gt; &lt;ul&gt; &lt;li&gt; &lt;a href="{{c.syl}}"&gt;Syllabus&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="{{c.cc}}"&gt;Course Contract&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="{{c.wb}}"&gt;White Board&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt; {{c.para}} &lt;/p&gt; &lt;!-- Panels--&gt; &lt;dl class="tabs" data-tab&gt; &lt;dd class=…
has title: angular.js and zurb foundation reveal modal
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29005847
has answer: http://stackoverflow.com/a/29005847

http://stackoverflow.com/a/27889277
has comment: http://stackoverflow.com/comment/44190191
type: Answer
has comment: http://stackoverflow.com/comment/44180350
downvote count: 1
answers question: http://stackoverflow.com/q/27883475
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/44180158
has body: The property you are looking for is onreadystatechange not onreadystatechanged. There is no d on the end.

http://stackoverflow.com/q/27936785
has answer: http://stackoverflow.com/a/27936855
downvote count: 1
possible better answer: http://stackoverflow.com/a/27936855
has body: I have a span that I have positioned on top of a select tag, when you click on the select tag the menu opens to select a value, but when you click on the span positioned on top of the select tag nothing happens. Is there an jquery way to use on click that will open the select tag menu? Contact Feedback Help
accepted answer: http://stackoverflow.com/a/27937122
has title: Jquery / Javascript onclick event to html open select tag
has answer: http://stackoverflow.com/a/27936801
upvote count: 4
answer count: 4
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
score: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27937122
has answer: http://stackoverflow.com/a/27936832
favorite count: 0
type: Question

http://stackoverflow.com/q/27934320
tagged with: javascript
score: 13
has comment: http://stackoverflow.com/comment/44295493
has comment: http://stackoverflow.com/comment/44266898
answer count: 1
downvote count: 0
tagged with: gulp
favorite count: 0
has body: I have an issue with usemin and am not sure if it is a bug. My application structure is simple: - root |- gulpfile.js |- app | |- index.html | |- about.html | |- contact.html | |- js | |- a.js | |- b.js | |- c.js | |- d.js | |- e.js | |- dist Each of my html files has a usemin block in it to include all of the scripts for example: When I run the following task: gulp.task('usemin'. function() { gulp.src('app/*.html') .pipe(usemin({ assetDir: 'app/**/' })) .pipe(dest('dist/')) }); only the first html file will copy to the new directory, the js in this case is concatenated as expected. When I change the gulp.src to gulp.src(['index.html','about.html','contact.html']) I get a diffrent issue, all the html files copy over but only the first one in alphabetical order runs the usemin block replacing the 5 scripts with the new script. Any insights would be great, I have extensively read through the gulp documentation and the gulp-usemin documentation and can't find any reasons why this should be happening. The example on the NPM website for the first of my two cases is even given as an example, not sure whats going on here? Maybe something to do with where I am running the gulpfile from? Is this even possible? Cheers. EDIT: Not sure what was happening here but I created a totally new project and built/ installed the npm plugins and scripts from scratch and everything worked. Not a great solution but it saved me some time.
has comment: http://stackoverflow.com/comment/44266297
type: UnansweredQuestion
has title: Can gulp-usemin accept multiple files?
tagged with: yeoman
upvote count: 13
tagged with: node.js
has comment: http://stackoverflow.com/comment/44266606
has comment: http://stackoverflow.com/comment/44266927
has comment: http://stackoverflow.com/comment/50861955
has answer: http://stackoverflow.com/a/31607562
type: Question
has comment: http://stackoverflow.com/comment/50895568

http://stackoverflow.com/a/27866341
upvote count: 6
score: 6
has body: Use the collection that you've already found with querySelectorAll to get the values of the value and name attributes : var person = {} var cars = document.querySelectorAll(".so") for (i = 0; i &lt; cars.length; i++) { person[cars[i].name] = cars[i].value } console.log(person) JSFiddle
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27866292
type: Answer
accepted answer of: http://stackoverflow.com/q/27866292

http://stackoverflow.com/q/27957766
has answer: http://stackoverflow.com/a/33690480
answer count: 15
type: AnsweredQuestion
upvote count: 258
has body: I have successfully done code to display a PDF file in the browser instead of the "Open/Save" dialog. Now, I'm stuck trying to display a Word document in the browser. I want to display a Word document in Firefox, IE7+, Chrome etc. Can any one help? I am always getting the "Open/Save" dialog while displaying the Word doc in browser. I want to implement this functionality using JavaScript.
has answer: http://stackoverflow.com/a/46315848
has answer: http://stackoverflow.com/a/63731238
has answer: http://stackoverflow.com/a/76166274
has answer: http://stackoverflow.com/a/75943674
type: Question
has comment: http://stackoverflow.com/comment/44309719
tagged with: browser
linked to: http://stackoverflow.com/q/5671988
has title: How do I render a Word document (.doc, .docx) in the browser using JavaScript?
linked to: http://stackoverflow.com/q/5538584
tagged with: javascript
has answer: http://stackoverflow.com/a/63828863
score: 256
has comment: http://stackoverflow.com/comment/106357040
has answer: http://stackoverflow.com/a/63810508
has answer: http://stackoverflow.com/a/47221623
has answer: http://stackoverflow.com/a/70280780
has answer: http://stackoverflow.com/a/78461450
tagged with: ms-word
favorite count: 0
has answer: http://stackoverflow.com/a/27958186
possible better answer: http://stackoverflow.com/a/42857508
downvote count: 2
has answer: http://stackoverflow.com/a/42857508
has answer: http://stackoverflow.com/a/46340844
has answer: http://stackoverflow.com/a/54316865
linked to: http://stackoverflow.com/q/9418850
accepted answer: http://stackoverflow.com/a/27958186
has answer: http://stackoverflow.com/a/75954275

http://stackoverflow.com/comment/44076954
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27836010
has text: The JS file is massive - but the problem I am having with stems to calling the wiseguys function - it doesnt trigger anything - and all the scripts are held within this - $.wiseguys = function()

http://stackoverflow.com/comment/44131894
comment on: http://stackoverflow.com/a/27864647
type: AnswerComment
score: 0
type: Comment
has text: @JMM: Yeah, I had that before, but esprima is parsing the my case correctly. I actually don't know what's correct. I guess wrapping everything in parenthesis is safer (updated).

http://stackoverflow.com/comment/44084080
type: QuestionComment
comment on: http://stackoverflow.com/q/27840135
has text: I think a *logic* issue lies around that part
score: 0
type: Comment

http://stackoverflow.com/comment/44059914
comment on: http://stackoverflow.com/q/27826877
type: Comment
type: QuestionComment
score: 1
has text: that's simple, just disable it so user can't do anything with it. Provide full details of your issue within the question, this is an X-Y problem

http://stackoverflow.com/comment/44237256
comment on: http://stackoverflow.com/a/27919481
has text: But in that case you'll have to remove the href attribute also. That'll make your anchor tags appear like text.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27951409
upvote count: 1
has comment: http://stackoverflow.com/comment/44301411
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27951204
type: Answer
has body: You can use simply create and add date objects: var fullDayDate = new Date(yourUnixTimestampValue); var timeString = '9:00 AM'; // you time component var partialDate = new Date('1 January 1970, ' + timeString); // set to specific time on first day of Unix epoch var finalDate = fullDayDate + partialDate;

http://stackoverflow.com/comment/44130768
score: 0
has text: I had done one out but was running into issues and was going off the original code trying to get it going in jsfiddle, but I think I may have found the solution, I wasnt using `readAsDataURL`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27861662

http://stackoverflow.com/comment/44118374
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27857740
has text: you have to submit the new order back to the server, or each time the user changes the order, submit the change to the server using ajax.

http://stackoverflow.com/a/27892265
answers question: http://stackoverflow.com/q/27892182
type: Answer
downvote count: 0
score: 1
has body: I would propose you to store JavaScript objects only. I don't think it takes much time to render your HTML nodes. But nodes themselves are rather heavy objects. Storing HTML string doesn't make sense at all as browser still has to parse it to DOM nodes. So it'll be equal to storing JS objects. Also it's much harder to manage DOM nodes in sense of memory management. It's very easy to forget to detach events handlers to to null-ify references to nodes. So, IMHO, it's easier to clean up DOM nodes completely and utilize them than manage all cases.
accepted answer of: http://stackoverflow.com/q/27892182
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/27959074
accepted answer: http://stackoverflow.com/a/27959352
has comment: http://stackoverflow.com/comment/44312413
score: 0
answer count: 1
tagged with: web
tagged with: razor
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27959352
has title: call external js function within razor
type: Question
has body: I have this code: Html.RequiresJs("~/Scripts/site/scripts.app.js", 5); @{ if (String.IsNullOrEmpty(stringQueryElement) &amp;&amp; !upcoming.Any()) { &lt;script type="text/javascript"&gt; X(); &lt;/script&gt; } } Inside scripts.app.js file I have a function X() which I want to call out when my if statement is true. How I call it? Because the syntax I have now does not work. Did some debugging and I can see that IF statement works correctly. The only question is how do I call my function that is stored in scripts.app.js. Thanks for help in advance.
has comment: http://stackoverflow.com/comment/44312186
tagged with: javascript

http://stackoverflow.com/a/27942587
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44280879
answers question: http://stackoverflow.com/q/27941628
has comment: http://stackoverflow.com/comment/44281113
has body: You must change paths by adding a slash in the begining. When you access www.yourdomain.com/path1/ The server search files in www.yourdomain.com/path1/css/bootstrap.min.css &lt;link href="/css/bootstrap.min.css" type="text/css" rel="stylesheet"&gt; &lt;link href="/css/bootstrap-theme.min.css" type="text/css" rel="stylesheet"&gt; &lt;link href="/css/Normalize.css" type="text/css" rel="stylesheet"&gt; &lt;link href="/css/Fixer.css" type="text/css" rel="stylesheet"&gt;
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44280778
accepted answer of: http://stackoverflow.com/q/27941628
type: Answer

http://stackoverflow.com/q/27931432
has title: How to check for one date is less than or equal another date in Javascript
has comment: http://stackoverflow.com/comment/44260441
tagged with: date
has comment: http://stackoverflow.com/comment/44260401
has answer: http://stackoverflow.com/a/27931594
score: 12
type: Question
possible better answer: http://stackoverflow.com/a/27931540
has comment: http://stackoverflow.com/comment/44260356
answer count: 2
has comment: http://stackoverflow.com/comment/44260302
has body: I am having a difficult time checking if one date is less than or equal to another. Here is my code, var bftStartDt = input1[0]; //This is a string with value "01-Jul-2007" var bftEndDt = input1[4]; //This is a string with value "01-Jul-1942" var strtDt = new Date(bftStartDt); var endDt = new Date(bftEndDt); var flag = 0; // false if (endDt &lt;= strtDt){ flag = 1; // true } It never enters the if statement when it should ? What am I missing here. Thanks
has comment: http://stackoverflow.com/comment/44260447
tagged with: javascript
duplicate of: http://stackoverflow.com/q/2587345
has answer: http://stackoverflow.com/a/27931540
favorite count: 0
has comment: http://stackoverflow.com/comment/44260485
has comment: http://stackoverflow.com/comment/44260595
downvote count: 2
has comment: http://stackoverflow.com/comment/44260467
linked to: http://stackoverflow.com/q/2587345
accepted answer: http://stackoverflow.com/a/27931594
type: AnsweredQuestion
upvote count: 14

http://stackoverflow.com/comment/44312858
has text: Tried `selectstart event`, annoying selection is still appearing in Chrome 39. With `document.body.style.pointerEvents='none';` my page doesn't react on any mouse events at all. Thank you anyway. It seems that `::selection` works nice, but I need to find a way to disable it to allow selection in some cases.
type: Comment
comment on: http://stackoverflow.com/a/27954700
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44198472
has text: @JLRishe: I am working on an old IE application to make it compatible with firefox . That particular application sends `innerHTML` content of a form to a modal popup plugin after setting the form field values,which is what not working in firefox.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27899035
score: 0

http://stackoverflow.com/a/28622123
has body: I personally wouldn't use SaveCPU.js just because there is no documentation on github. There are actually two issues posted on its GitHub repository so don't bother using the plugin. If you need to reduce the CPU load you should just refactor your code.
score: 0
answers question: http://stackoverflow.com/q/27880158
type: Answer

http://stackoverflow.com/comment/44212364
comment on: http://stackoverflow.com/q/27906557
type: Comment
has text: actually the code [works](http://jsfiddle.net/wdoL3auq/v) with a correct setup.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44214743
type: Comment
comment on: http://stackoverflow.com/a/27907187
has text: I'll use it to send an email. I tried to paste it on another text editors, Word, Excel, Outlook, sublime text, brackets
type: AnswerComment
score: 0

http://stackoverflow.com/q/27812475
has comment: http://stackoverflow.com/comment/44032929
has title: Uncaught TypeError: undefined is not a function knockout js
type: AnsweredQuestion
has body: Iam trying to add certain data to an array, like so: Here is my code:- Create.html Field Name: Display Name: Add fields Field Name Field Display Name Table.js var ViewModel = function () { var self = this; self.fields = ko.observableArray(); self.fieldName = ko.observable(); self.fieldDisplayName = ko.observable(); self.isRangeError = ko.observable(false); var Field = function (fieldName, fieldDisplayName) { this.fieldName = fieldName; this.fieldDisplayName = fieldDisplayName; this.remove = function () { self.fields.remove(this); } } self.addFields = function () { var tr = self.fields(); for (var i = 0; i < tr.length; i++) { if (self.fieldName == tr[i].fieldName && self.fieldDisplayName == tr[i].fieldDisplayName) { self.isFieldError(true); return; } } self.isFieldError(false); self.fields.push(new Field(self.fieldName(), self.fieldDisplayName())); } I get a Error like this:- Uncaught TypeError: undefined is not a functionTableChart.js:41 self.addFieldsknockout-3.2.0.debug.js:3713 (anonymous function)jquery-1.10.2.js:5109 jQuery.event.dispatchjquery-1.10.2.js:4780 elemData.handle How do I solve this? I am quite new to knockout and javascript. Any help is appreciated.
has answer: http://stackoverflow.com/a/27812954
tagged with: knockout.js
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44033205
score: 0
accepted answer: http://stackoverflow.com/a/27812954
has comment: http://stackoverflow.com/comment/44032899
has comment: http://stackoverflow.com/comment/44032902
has comment: http://stackoverflow.com/comment/44032451

http://stackoverflow.com/comment/44065749
has text: it's shorthand for the $(document).on('ready', function());
comment on: http://stackoverflow.com/q/27829847
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44236602
has text: Try this: email: { type: String, required: true, index: { unique: true } }
comment on: http://stackoverflow.com/q/27919383
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44263631
score: 0
comment on: http://stackoverflow.com/q/27932756
type: QuestionComment
type: Comment
has text: That code is valid with older versions of angular, but since 1.3 you need to declare the module (see other responses). However try replacing the angular loaded by, let's say, 1.1.5 instead of 1.3.7 and it works.

http://stackoverflow.com/comment/44534150
has text: I've already have the API key, I also already activate the API, see [here](https://dl.dropboxusercontent.com/u/56134944/qouta.JPG)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27877911

http://stackoverflow.com/a/27956704
score: 0
has comment: http://stackoverflow.com/comment/44308209
type: Answer
has body: Try moving your initial call to reset() after the definition of the function. //runs the reset function on load reset(); //randomly resets the cards function reset(){ cards = shuffle(cards); $(".card").each(function() { $(this).addClass(cards[counter]); counter += 1 }); }; TO //randomly resets the cards function reset(){ cards = shuffle(cards); $(".card").each(function() { $(this).addClass(cards[counter]); counter += 1 }); }; //runs the reset function on load reset();
answers question: http://stackoverflow.com/q/27956600

http://stackoverflow.com/comment/44170111
type: Comment
has text: If so, just replace your `i += 30` to `i += 28` for monthly :D
type: AnswerComment
comment on: http://stackoverflow.com/a/27883816
score: 0

http://stackoverflow.com/comment/44024887
comment on: http://stackoverflow.com/q/27805246
has text: Not sure what you mean with `I then added event handler`. Isn't it logical that the event needs to be defined before it's triggered? I also don't see any events defined on the parent view (OrderView) so how can this listen to events? Perhaps I'm misunderstanding your question.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29630423
downvote count: 0
upvote count: 2
has body: This was driving me nuts until I discovered that it is a known bug with angular-batarang. See: https://github.com/angular/angularjs-batarang/issues/211. (Please star the issue if it is still not fixed when you read this.) With batarang installed and enabled, only the first declared ng-blur or ng-focus will fire. E.g. if you have, &lt;input ng-blur='onBlur()' ng-focus='onFocus()'&gt; you will get the blur event but not the focus event. If you have, &lt;input ng-focus='onFocus()' ng-blur='onBlur()'&gt; you will get the focus event but not the blur event. If you are hitting this problem, until it is fixed the workaround is just to disable batarang when you are working with these events using the "Enable" checkbox shown here:
type: Answer
answers question: http://stackoverflow.com/q/27804949
score: 2

http://stackoverflow.com/comment/44078655
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27837097
has text: @IMRUP Edit your question and add the code there. Also, provide the HTML.

http://stackoverflow.com/q/27892976
answer count: 1
has body: I've been playing with Polymer for a few days and I want to do a menu, that will appear/disappear after clicking on the menu button. The problem is that I can't figure out why my code doesn't work. Here it is: Title Project Management System and the Javascript When I click on the menu button an error will appear: Uncaught TypeError: Cannot read property 'teardown' of undefined I've done everything as it was on demo page, I've been searching for the correct solution or some answers but nothing... does any one have an idea? Thanks
has title: Polymer core-transition doesn't work
tagged with: polymer
tagged with: javascript
type: UnansweredQuestion
tagged with: web-component
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27894806
type: Question
score: 0

http://stackoverflow.com/comment/44221652
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27910945
has text: You've suggested two ways. Both would work, with some caveats. Are you looking for feedback on which is better? Are you looking for alternative suggestions?
type: Comment

http://stackoverflow.com/q/27933955
type: Question
score: 0
answer count: 1
tagged with: arrays
has title: Assign array values in each loop
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27934051
accepted answer: http://stackoverflow.com/a/27934051
has comment: http://stackoverflow.com/comment/44265551
has comment: http://stackoverflow.com/comment/44265623
type: AnsweredQuestion
has body: I'm trying to loop through input fields with an each loop, add other form data to an array and then add that input value to the form data already in the array. It seems to be basically working but every time I set the input it sets that value in all the entries with that name in the array. Any ideas about where my logic is going sideways? $(this).next('tr').children('td').each(function () { input = $(this).children('input'); units[i] = unit; units[i]['barcode'] = input.val(); i++; }); Output object: Object {0: Object, 1: Object} 0: Object barcode: "789" qty: "3" size: 15 status: "received" 1: Object barcode: "789" qty: "3" size: 15 status: "received" The input.val() is different on each iteration of the each loop, it just assigns the last value to all barcode entries.
has comment: http://stackoverflow.com/comment/44265589
tagged with: each

http://stackoverflow.com/comment/70351144
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/33217851
has text: Nice answer, should I update mine to include your information and correct the anti-pattern missconcept?
score: 0

http://stackoverflow.com/a/27925312
has comment: http://stackoverflow.com/comment/44249083
score: 0
answers question: http://stackoverflow.com/q/27924961
has comment: http://stackoverflow.com/comment/44249289
has comment: http://stackoverflow.com/comment/44251059
has comment: http://stackoverflow.com/comment/44248286
type: Answer
has body: So as most comments point toward you using localStorage, here we go: to store a value localStorage.setItem(key, value); // i.e. localStorage.setItem("name", "bob" ); To get the value back you'd do localStorage.getItem(key) // i.e. localStorage.getItem('name'); so: &lt;input id="male" type="radio" name="sex" value="male"&gt;Male &lt;input id="female" type="radio" name="sex" value="female"&gt;Female if(document.getElementById('male').checked){ localStorage.setItem('sex', 'male'); } if(document.getElementById('female').checked){ localStorage.setItem('sex', 'female'); } // getting the value if(localStorage.getItem('sex')){ // if localStorage.getItem('sex') == male, set the male checkbox // female if not }
has comment: http://stackoverflow.com/comment/44249186
has comment: http://stackoverflow.com/comment/44249888

http://stackoverflow.com/a/35548557
downvote count: 0
type: Answer
score: 3
upvote count: 3
has body: For me this worked connection.transaction.body.children[1].bodytext exports.hook_data = function (next, connection) { connection.transaction.parse_body = true; this.loginfo("connection.transaction.parse_body"); next(); } exports.hook_data_post = function (next, connection) { this.loginfo("connection.transaction.body.bodytext"); this.loginfo(connection.transaction.body.children[1].bodytext); next(); }
answers question: http://stackoverflow.com/q/27897112

http://stackoverflow.com/q/27820704
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27821437
type: Question
has answer: http://stackoverflow.com/a/27820733
accepted answer: http://stackoverflow.com/a/27820733
tagged with: ssl
tagged with: javascript
score: 0
answer count: 2
tagged with: cors
tagged with: ajax
possible better answer: http://stackoverflow.com/a/27821437
has body: Is it possible to use javascript to consume data from a webservice that is CORS disabled, only returns XML data (no option for json/jsonp) and over HTTPS? I do not have control of this webservice to make changes. At best, if I run the following ajax I'll see an xml response getting sent back (using Chrome's developer tools) however my success function isn't being hit and I'll end up with an exception 'Unexpected syntax &lt;' because it's anticipating a json padded response. If I change dataType to just 'xml' I will get an error "Access-Control-Allow-Origin" not found in header response. Which is what I'd except since they have not enabled CORS. $.ajax({ url: 'https://' + myURL + querystring, username: usr, password: pwd, dataType:'jsonp text xml', type: 'GET', success: function (data) { console.log( "success" ); }, cache: false, contentType: false, processData: false });
has title: Ajax calls to a CORS disabled service
tagged with: http://stackoverflow.com/tag/xml

http://stackoverflow.com/comment/44213922
type: Comment
comment on: http://stackoverflow.com/a/27907187
has text: @JLRishe In the browser modal window saying "Copied to clipboard: ..." on the first screen.
type: AnswerComment
score: 0

http://stackoverflow.com/a/27859987
has comment: http://stackoverflow.com/comment/44182389
answers question: http://stackoverflow.com/q/27845161
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44178996
has body: In your function that is supposed to retrieve names of other nodes that are "source" (or"target", implementation would be the same) to the current node, you can do something like this: function(d,i){ d.sourceLinks.forEach(function(srcLnk){ // find the name of the other end of the link }); d.targetLinks.forEach(function(tgtLnk){ // find the name of the other end of the link }); } In other words, use d.sourceLinks and d.targetLinks. And you gradually add names one by one, and display wherever you find suitable (tooltip, separate box, etc.). In turn, each link has property source and target, and you can use something like srcLnk.source.name to obtain the name of one of the nodes that is a "source" for the current node. I am writing this by hearth, so double check everything, some properties may have differeent name than I said. Hope this helps. UPDATE: jsfiddle Key code: .append("title") .text(function (d) { var titleText = d.name + " - " + format(d.value) + " total" + "\n" + "\n"; var sourcesText = ""; d.targetLinks.forEach(function(dstLnk){ sourcesText += "from " + dstLnk.source.name + " - " + format(dstLnk.value) + "\n"; }); return titleText + sourcesText; });
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44181099
has comment: http://stackoverflow.com/comment/44178717
accepted answer of: http://stackoverflow.com/q/27845161

http://stackoverflow.com/q/27842571
accepted answer: http://stackoverflow.com/a/27843188
tagged with: provider
tagged with: javascript
type: Question
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has body: Sorry to ask something like this, but i m already spend couple of days to solve this one. But i m really need help. I am already read Understanding Dependency Injection and also other stack question use $http inside custom provider in app config use the $injector on run block also not work in my code. Perhaps someone here can help me, i am also worried how annotate the injection on my provider for minification. My code in Here
has answer: http://stackoverflow.com/a/27843188
linked to: http://stackoverflow.com/q/17497006
score: 1
upvote count: 1
has title: Injecting service which define by module.provider
type: AnsweredQuestion
tagged with: dependency-injection

http://stackoverflow.com/a/27854535
has body: function templete_render(html, cover_photo){ return html + "&lt;div style='background : url(http://graph.facebook.com/" + cover_photo + "/picture?type=normal) background-size: cover;'&gt;"; } // end of templete_render use :- html = templete_render(html, this.cover_photo); Thanks :)
score: 0
has comment: http://stackoverflow.com/comment/44113245
has comment: http://stackoverflow.com/comment/44113175
has comment: http://stackoverflow.com/comment/44112810
answers question: http://stackoverflow.com/q/27854471
type: Answer

http://stackoverflow.com/q/27857131
duplicate of: http://stackoverflow.com/q/446892
type: Question
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/27857177
has answer: http://stackoverflow.com/a/27857211
tagged with: javascript
has body: I have a div with two function attached, one is click and other one is hover function. In javascript is there any way to find which events attached with that element. If we attach function to some element then where it store in dom. can we find it by using developer tool Edit: How the browser / DOM knows that which event is register with which element test script document.getElementById('test').addEventListener('click',function(){},false) document.getElementById('test').addEventListener('hover',function(){},false)
has comment: http://stackoverflow.com/comment/44117473
has comment: http://stackoverflow.com/comment/44117325
favorite count: 0
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/446892
score: -1
has title: In which object events are stored
has comment: http://stackoverflow.com/comment/44117336

http://stackoverflow.com/a/27866973
has comment: http://stackoverflow.com/comment/44136795
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27866904
has comment: http://stackoverflow.com/comment/44136859
answers question: http://stackoverflow.com/q/27866904
type: AcceptedAnswer
has body: Checkout this plnkr first you are not calling as method. And second you are not returning from method. Change your html to following Name Score Difference {{user.name}} {{user.score}} {{maxScore(users)}}
type: Answer
upvote count: 1

http://stackoverflow.com/a/27814897
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44113527
answers question: http://stackoverflow.com/q/27813464
has comment: http://stackoverflow.com/comment/44059808
type: Answer
has comment: http://stackoverflow.com/comment/44070286
has comment: http://stackoverflow.com/comment/44066739
has comment: http://stackoverflow.com/comment/44066616
has comment: http://stackoverflow.com/comment/44066386
upvote count: 1
has comment: http://stackoverflow.com/comment/44066514
has body: As Tobias correctly pointed out, your form submission event is allowed to continue which results in a page refresh and a "reset" of all plain JavaScript data. Furthermore, you are not capturing your values (notedOverallHours and courseNumberTotal) on form submission (after the user has entered an amount), but rather when your page initializes (before the user has input anything). So, to go about fixing this, first a tiny modification to your HTML: ... ... Notice that I deleted the onsubmit attribute from your form. We can capture that with an event in JavaScript itself. Next attach an event listener to your form which prevents it from submitting and calls your createInput() function: document.getElementById("initialForm").addEventListener('submit', function (e) { e.preventDefault(); createInput(); }); This will attach an eventListener that listens to the submit event on your initialForm element. The first parameter is the type of event you want to listen for (submit in this case), the second is the callback you want to have fired. The callback function always gets the event passed in (the e argument). By calling preventDefault on this event we can stop it from bubbling up and actually causing a page refresh. Next we call the createInput() function which, after some modifications, looks like this: function createInput() { var notedOverallHours = document.getElementById("overallHours").value * 60; var courseNumberTotal = document.getElementById("courseAmount").value; var newForm = document.getElementById("hourForm"); document.getElementById("initialForm").style.display = "none"; document.getElementById("hourForm").style.display = "block"; // Add our elements for (i = 1; i <= courseNumberTotal; i++) { var child = document.createElement('li'); child.innerHTML = " Course #" + (i) + " " + " "; newForm.appendChild(child); } // Add our button var button = document.createElement('li'); button.innerHTML = " "; newForm.appendChild(button); } As you can see, I capture the noted…
score: 1
has comment: http://stackoverflow.com/comment/44055357
accepted answer of: http://stackoverflow.com/q/27813464

http://stackoverflow.com/a/27840291
upvote count: 2
type: Answer
score: 2
has body: You can do it with a custom function as second parameter: var txt = "Over 60's"; txt = txt.replace(/ |'/g, function(match){ if (match === " "){ return "-"; } return ""; }); txt // Over-60s see String.prototype.replace
answers question: http://stackoverflow.com/q/27840073
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27840073
has comment: http://stackoverflow.com/comment/44085309

http://stackoverflow.com/comment/44161332
score: 0
type: Comment
type: QuestionComment
has text: my application is huge like 25 AMD and non libs and many js scripts (over 100) .how can I reproduce this in jsfiddle? I will try to find something more to show here
comment on: http://stackoverflow.com/q/27859459

http://stackoverflow.com/comment/44201493
has text: check the keys then is it same as you posted in the question.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27896914
type: Comment

http://stackoverflow.com/a/27935070
has body: Think out of the box: We can CSS3 rotate an element with transform to i.e: 720° ... it will make 2 clockwise turns. (OK, in our UI it can only do max a 359 turn but let's follow the math) If we than animate it to 810°... it just means that it'll do a 90° clockwise move! So all we need to do is always increase a degree variable to insanity! HEY! If at some point you want to keep track of the current normalized 0-360 degree... you can always retrieve that value doing ourCurrentInsanelyHighDegree % 360 = UIdegrees Here's a jsBin demo and this is all the JS you need. function getCSSRotation( $el ) { var matrix = $el.css('transform'), v = matrix.split('(')[1].split(')')[0].split(','), rds = Math.atan2(v[1], v[0]); return rds*180/Math.PI <<0; // Degrees } var $EL = $("#graph1"), w = $EL.width(), r = w/2, // Radius x = parseInt($EL.css("left"), 10), y = parseInt($EL.css("top"), 10), d = getCSSRotation( $EL ); // Initial degree (ONLY ONCE!) $EL.on("click", function(e){ var mx = e.clientX-x-r, // Click coord X my = e.clientY-y-r, // Click coord Y rds = Math.atan2(-my, -mx), // Radians md = (rds*180/Math.PI<<0) + 180; // Mouse Degrees d += (360-md); // always increment to insanity!! $(this).css({transform:"rotate("+ d +"deg)"}); }); #graph1 { position:absolute; top:10px; left:30px; width:200px; height:200px; background:url(//placehold.it/200x200&text=IMAGE); transition:transform 2s ease; transform:rotate(30deg); transform-origin:50% 50%; border-radius:50%; } #marker { position: absolute; top:110px; left:230px; border-top:1px solid black; } Wherever you click, it rotates to here
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27933728
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27933728
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/44278585
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27941185
has text: How about this. I did not test it though.

http://stackoverflow.com/comment/44267726
has text: I don't have enough knowledge to fully understand what you are trying to say but i'll give it a shot. Please lead me to a solution for my problem here. Thank you so much.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27913549
type: Comment

http://stackoverflow.com/q/27873277
tagged with: http://stackoverflow.com/tag/xml
has answer: http://stackoverflow.com/a/27885347
upvote count: 2
answer count: 1
tagged with: polymer
tagged with: javascript
type: UnansweredQuestion
has body: I am trying to use Polymer core-ajax element to extract data out of an online API. Checking via developer tool the API request get successful with code 200 and expected XML response is returned. But the response object is null stopping me to proceed. This is my core element, <core-ajax id="ajax" auto url="https://localhost:8443/GetEmployees" method='POST' headers='{"X-Token":"4517612052875154027"}' handleAs='xml' contentType="application/xml" response= "{{resp}}" on-core-complete="{{success}}" on-core-error="{{errorF}}" body='<?xml version="1.0" encoding="UTF-8" standalone="no"?> < '> </core-ajax> The XML returned in in following format <?xml version="1.0" encoding="UTF-8"?> <Code>OK ISH001 Omid OR KORDESTANI Mr ISH002 Gary GR PARANTE Mr When I debug event or detail objects in success method does not carry the return XML or resp object. The element parameter for nodeList function also returns "No Employees...." message. Can someone please let me know where I have messed up. I have tried otherthings but none has succeeded so far. EDIT: When I save the response XML in a server file and made a GET request to it the page shows, [Object Element] [Object Element] [Object Element] via the template. Its the exact same response XML. I am confused!!!!!!!! Thanks in advance, Ish
has title: Polymer core-ajax xml response element is null
has comment: http://stackoverflow.com/comment/44656499
tagged with: web-component
score: 2
downvote count: 0
favorite count: 0
tagged with: ajax
type: Question

webdriver-io
type: Tag
tag name: webdriver-io
tags question: http://stackoverflow.com/q/27893474

http://stackoverflow.com/comment/44047697
has text: I have to verify with javascript because i have to get the data that is in the format yyyy-mm-dd hh:mm:ss and set it to dd/mm/yyyy hh:mm:ss Lamak.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27820721

http://stackoverflow.com/q/27905978
has comment: http://stackoverflow.com/comment/44211857
has comment: http://stackoverflow.com/comment/44212606
has answer: http://stackoverflow.com/a/27906003
type: Question
has comment: http://stackoverflow.com/comment/44211972
has comment: http://stackoverflow.com/comment/44211166
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44212665
has title: setAttribute("checked", "checked") only works one time
linked to: http://stackoverflow.com/q/27679690
has comment: http://stackoverflow.com/comment/44212710
has comment: http://stackoverflow.com/comment/44212688
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44211227
has body: I am facing one issue HTML &lt;input id="cb" type="checkbox" name="Employment_Staus" value="E" /&gt; &lt;input type="button" value="Check" id="id" /&gt; JQUERY $('#id').click(function(){ $('input[type="checkbox"]')[0].setAttribute("checked", "checked"); }); First time when I click on check button, it works!(it check the check-box ), then I manually uncheck the check box! When I press check button again after uncheck manually , it not work! I don't want to use attr or prop etc etc !! Example http://jsfiddle.net/wL6qr0hp/4/
favorite count: 0
has comment: http://stackoverflow.com/comment/44211188
has comment: http://stackoverflow.com/comment/44211980
score: -4
has comment: http://stackoverflow.com/comment/44212290
downvote count: 4
has comment: http://stackoverflow.com/comment/44211940
accepted answer: http://stackoverflow.com/a/27906003
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/44211668

http://stackoverflow.com/comment/44224493
comment on: http://stackoverflow.com/a/27912478
score: 0
type: AnswerComment
has text: Are we talking about the same? Check my update above... Does your RAM cache still make sense?
type: Comment

http://stackoverflow.com/comment/44277608
type: Comment
score: 0
has text: i'm not, but i hoped that there was a simplier solution
type: QuestionComment
comment on: http://stackoverflow.com/q/27940750

http://stackoverflow.com/comment/44287660
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27945969
has text: First of all, removing `script` tags won't prevent them from running.

http://stackoverflow.com/comment/44063246
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27828611
has text: you're assigning to a style, so you have to conform to CSS rules. `... = width_of_pic + 'px';`. no units = invalid assignment.
type: Comment

http://stackoverflow.com/q/27915207
tagged with: jquery
has comment: http://stackoverflow.com/comment/44229412
has title: Use anchors in "Select" drop down list
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27915314
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44229493
has body: Alright, so I have a currently functioning drop down list that displays a hidden div of content on the same page when that items is selected from the dropdown. The problem is I need to be able to have this same code as an anchor or something that will allow me to call up that particular section either when referencing that page from another page or by simply navigating back to the page after having moved forward in the content. Here is the script: &lt;script type="text/javascript"&gt;` jQuery(function($) { $('.box').hide(); $('#option1').show(); $('#category_select').change(function () { $('.box').hide(); $('#'+$(this).val()).show(); }); }); &lt;/script&gt; And my page content: &lt;div id="mental_lever_collection"&gt; &lt;div class="menu"&gt;&lt;span class="title"&gt;Choose a Mental Lever Collection&lt;/span&gt; &lt;select id="category_select" class="select"&gt; &lt;option value="#option1"&gt;Mental Levers &amp;amp; Leveraged Thinking&lt;/option&gt; &lt;option value="#option2"&gt;Zero Aggression Basics&lt;/option&gt; &lt;/select&gt;&lt;/div&gt; &lt;div id="option1" class="box"&gt; Some Content &lt;/div&gt; &lt;div id="option2" class="box"&gt; Some Content &lt;/div&gt; &lt;/div&gt; If you have any ideas on how to tweak this to get the desired effect it would be greatly appreciated.
has answer: http://stackoverflow.com/a/27915312
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44389488
tagged with: user-interface
tagged with: javascript
tagged with: drop-down-menu

http://stackoverflow.com/comment/44176440
score: 0
has text: @Quentin i think i need a callback or something
comment on: http://stackoverflow.com/q/27887720
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44055223
comment on: http://stackoverflow.com/a/27824408
score: 0
type: Comment
has text: But how should i do when i want to edit this value
type: AnswerComment

http://stackoverflow.com/comment/44285369
has text: In my example would that be the location to return a score - in the `callback()`? I'm returning 1000.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27931454

http://stackoverflow.com/a/27870735
answers question: http://stackoverflow.com/q/27870651
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: Use the value attributes of options to contain red or black. The display text will be the number, but the select element val() comes from the value of the selected option. HTML (shortened for the example): 103 105 107 111 113 115 104 106 http://jsfiddle.net/25mneof2/1/ $('select').change(function(){ $('#output').val($(this).val()); });

http://stackoverflow.com/comment/44188724
comment on: http://stackoverflow.com/a/27852951
score: 0
type: AnswerComment
has text: Updated my answer. I don't have a working example, but I included several pieces of the puzzle I think you'll need.
type: Comment

http://stackoverflow.com/comment/44315228
has text: You have a typo - `obj.push = new Obj(i)` overwrites the Array's method, instead of calling it
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27960757

http://stackoverflow.com/comment/44185149
score: 0
comment on: http://stackoverflow.com/q/27892018
type: Comment
type: QuestionComment
has text: Databases are not made to hold files, you're asking it too much. They should store relevant info for you to find them and handle them, but the files should be on your server, it's what it's made for ! :)

http://stackoverflow.com/comment/44168342
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27883296
has text: What do you mean by "works"? What happens when it doesn't work? (Are you having problems structuring asynchronous code or something? Note that the comma after the `}` on the fourth last line will break the code in some browsers.)

http://stackoverflow.com/comment/44123530
type: Comment
has text: Hey, thanks for the answer. At the moment this is what I'm doing, however this is fairly inefficient as the entire page is being requested, which is substantially larger than the div i need. I think i'm going to create a separate file for the div and include it on the page, and then make an XMLHTTPRequest to the div's file.
comment on: http://stackoverflow.com/a/27844209
score: 0
type: AnswerComment

http://stackoverflow.com/q/27822401
type: Question
score: 1
upvote count: 1
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: how to convert high charts code to nvd3.js
answer count: 0
tagged with: nvd3.js
type: UnansweredQuestion
tagged with: php
has body: Here is my High Chart code for showing live Bitcoin Charts. I really am a noob at PHP, JavaScript etc, so i really need help in converting this code to nvd3.js PHP Code: <?php // Set the JSON header header("Content-type: text/json"); function getPrice($url){ $decode = file_get_contents($url); return json_decode($decode, true); } $btce = getPrice('https://btc-e.com/api/2/btc_usd/ticker'); $btcePrice = round($btce["ticker"]["last"], 2); // The x value is the current JavaScript time, which is the Unix time multiplied // by 1000. $x = time() * 1000; // The y value is a random number // Create a PHP array and echo it as JSON $ret = array($x, $btcePrice); echo json_encode($ret); ?> HTML and Javascript Code: any help in explaining how to convert this code to work with nvd3.js would be greatly appreciated Thanks!

http://stackoverflow.com/comment/44347929
has text: I marked this as the answer because it does address the original question. However, I discovered a better way to manipulate the video playback in netflix is to reference the videoPlayer object itself. For example: `var vp = netflix.cadmium.objects.videoPlayer(); vp.seek(60500);` You also get functions for pausing, volume, getting position and duration, etc. using this object.
type: Comment
comment on: http://stackoverflow.com/a/27931990
score: 3
type: AnswerComment

http://stackoverflow.com/q/27869279
score: 0
accepted answer: http://stackoverflow.com/a/27873485
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44142530
has comment: http://stackoverflow.com/comment/44142213
has answer: http://stackoverflow.com/a/27873485
has body: I can access it fine using meteor mongo but I need access to it on the server... How do I do that? I've tried: Meteor.system.js.save() db.system.js.save() System.js.save()
tagged with: meteor
tagged with: node.js
linked to: http://stackoverflow.com/q/18520567
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10211076
has comment: http://stackoverflow.com/comment/44145115
has title: How do I access mongos db.system.js in meteor?
type: Question
tagged with: mongodb

http://stackoverflow.com/a/37417103
score: 0
type: Answer
has body: There's also EQCSS, which is a plugin that extends CSS to include Element Queries, Scoped CSS (style scoping) and introduced some special new selectors like $parent that lets you select the parent element of something. It works in all browsers, IE8 and up. It feels like writing CSS from the future! Check it out! http://elementqueries.com There are examples on the site, as well as a ton of demos of things built with it at the bottom of the page.
answers question: http://stackoverflow.com/q/27808694

http://stackoverflow.com/comment/103362578
comment on: http://stackoverflow.com/a/47446965
type: Comment
score: 0
has text: @th3morg Ah yes I see now. I missed that it also allows you to fill in the response status code as 200. So basically you are mapping status 403 to status 200... Looks fine... except that maybe if you get 403 as a result due to some other reason you won't be able to see it because of this.
type: AnswerComment

http://stackoverflow.com/q/27933674
linked to: http://stackoverflow.com/q/1732348
has body: I know this question is extremely similar to one that has been asked before but it's not exactly the same and should not be treat as such (please mods/admins). I'm currently using the Linkify() function that I found in a piece of code posted on here in another thread, however it does not contain a Regular Expression for Images. It only covers http, https and mailto but does not cover a link that may contain an image. Basically what I'm asking, is there a regular expression that I can add to that function (there are already 3 patterns so one of images would be replacedPattern4) that would check for an image link only? For example if in the text it finds a link like http://www.example.com/images/logo.jpg then it converts it to an image tag but obviously with the src="" containing that url. Reason I'm asking is for a chat project I'm working on I want to convert text links that are pointing to images to actual images just like Facebook does on the timeline. Here is what I'm using and have added to the Linkify function as a fourth RegEx pattern: replacePattern4 = /(\b(http):\/\/.(?:jpg|png|gif))&lt;/ replacedText = replacedText.replace(replacePattern4, '&lt;img src="$1" height="100" width="100" /&gt;'); However this isn't working at all! Any ideas anyone?? Any help here would be great, please bare in mind the code the Linkify already uses. Thanks!
has comment: http://stackoverflow.com/comment/44265770
tagged with: regex
has comment: http://stackoverflow.com/comment/44265009
has comment: http://stackoverflow.com/comment/44265727
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44265106
has answer: http://stackoverflow.com/a/27934028
downvote count: 1
has title: RegEx to replace text url link with image tag
type: Question
tagged with: hyperlink
score: -1
has comment: http://stackoverflow.com/comment/44265249
has comment: http://stackoverflow.com/comment/44265033
upvote count: 0
accepted answer: http://stackoverflow.com/a/27934028
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28607943
downvote count: 15
upvote count: 79
has comment: http://stackoverflow.com/comment/52455627
has comment: http://stackoverflow.com/comment/65915921
score: 64
has comment: http://stackoverflow.com/comment/56241662
has comment: http://stackoverflow.com/comment/47719013
has body: Use this to validate google captcha with simple javascript. This code at the html body: &lt;div class="g-recaptcha" id="rcaptcha" style="margin-left: 90px;" data-sitekey="my_key"&gt;&lt;/div&gt; &lt;span id="captcha" style="margin-left:100px;color:red" /&gt; This code put at head section on call get_action(this) method form button: function get_action(form) { var v = grecaptcha.getResponse(); if(v.length == 0) { document.getElementById('captcha').innerHTML="You can't leave Captcha Code empty"; return false; } else { document.getElementById('captcha').innerHTML="Captcha completed"; return true; } }
type: Answer
has comment: http://stackoverflow.com/comment/71071369
answers question: http://stackoverflow.com/q/27902539
has comment: http://stackoverflow.com/comment/71071195
has comment: http://stackoverflow.com/comment/66270501
has comment: http://stackoverflow.com/comment/53300881
has comment: http://stackoverflow.com/comment/45520476

http://stackoverflow.com/a/27880128
score: 1
has comment: http://stackoverflow.com/comment/44162119
has comment: http://stackoverflow.com/comment/44163648
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44162950
has comment: http://stackoverflow.com/comment/44163330
accepted answer of: http://stackoverflow.com/q/27879287
type: Answer
upvote count: 1
has body: opacity on body tag will change whole page style. You probably want to change only background image or color. 1. color You need rgb format for color 0,0,0, and just add alpha to make it rgba. document.body.style.backgroundColor = "rgba(0,0,0,.1);" 2. image You need pseudo element to change opacity without affecting body tag. body { position: relative; } body:after { content: ""; background: url(image.jpg); opacity: 0.1; top: 0; left: 0; bottom: 0; right: 0; position: absolute; z-index: -1; } Here is fiddle UPDATE If you just need an overlay when your image is enlarged, than you should use overlay element, like every lightbox plugin. Style overlay CSS body { position: relative; } #overlay { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0,0,0,.7); //choose opacity z-index: -1; // set z-index smaller than image and text } JS if () { //Create element and append it to body. var page = document.body; var overlay = document.createElement('div'); overlay.id = "overlay"; page.appendChild(overlay); } else { //Remove element var overlay = document.getElementById("overlay"); overlay.parentNode.removeChild(overlay); }
answers question: http://stackoverflow.com/q/27879287

http://stackoverflow.com/a/27926168
score: 0
has body: Do it other way. Set right to true by default and set it to false if either correct checkbox is not checked or wrong checkbox is checked.
type: Answer
answers question: http://stackoverflow.com/q/27926100

http://stackoverflow.com/a/27832575
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44098893
type: Answer
answers question: http://stackoverflow.com/q/27832466
score: 0
accepted answer of: http://stackoverflow.com/q/27832466
has comment: http://stackoverflow.com/comment/44071684
has body: Make a global var, set it in second function and then use it in third function. var value_of_project; // first function $('body').on('click', '.projectmonitoring', function () { SetMonitoring(project); }); // second function function SetMonitoring(project) { //set value of project here value_of_project = "some value"; } // third function $('#save').click(function () { //do something using value_of_project });

http://stackoverflow.com/q/27886677
has answer: http://stackoverflow.com/a/64974550
tagged with: javascript
has answer: http://stackoverflow.com/a/69570564
score: 66
favorite count: 0
answer count: 9
has answer: http://stackoverflow.com/a/40708540
has answer: http://stackoverflow.com/a/58200444
has answer: http://stackoverflow.com/a/51789597
type: AnsweredQuestion
has title: Determine image format from base64 data
tagged with: file-extension
has comment: http://stackoverflow.com/comment/44174829
possible better answer: http://stackoverflow.com/a/50111377
has answer: http://stackoverflow.com/a/27887492
has comment: http://stackoverflow.com/comment/44174920
accepted answer: http://stackoverflow.com/a/27887492
has comment: http://stackoverflow.com/comment/44175938
type: Question
has answer: http://stackoverflow.com/a/50111377
tagged with: base64
upvote count: 67
has answer: http://stackoverflow.com/a/44296941
tagged with: image
has body: I have a base64 encoded image returned from a service and it looks like this: [binary].... etc How can I determine the image format from this data?
downvote count: 1
has answer: http://stackoverflow.com/a/79425146

http://stackoverflow.com/a/27857140
accepted answer of: http://stackoverflow.com/q/27856177
answers question: http://stackoverflow.com/q/27856177
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44122989
has comment: http://stackoverflow.com/comment/44176615
has comment: http://stackoverflow.com/comment/44150198
has body: I tried to write this as a comment, but since i am new here so i dont have the required reputation. If you have written the code exactly as you posted in your question, I think your ajax request is not even being fired because you are calling $('.delete').click(... whereas in your code you have put id of link as 'delete' not class! Add class delete in delete button and everything should work fine.. :) Update: or you can call $('#delete').click(... instead! Update 2: There are several problems with your code (i'll comment the problems at the changes) Controller Function: function delete() // you arent supplying any arguments in url of ajax call { $id_post = $this-&gt;input-&gt;post('id_post'); // get the post data $hapus=$this-&gt;home_model-&gt;delete($id_post); if($hapus){ echo true; } else { echo false; } } Javascript: $(document).ready(function(){ $(".delete").click(function(e){ e.preventDefault(); $.ajax({ type: "POST", url: "&lt;?php echo base_url()?&gt;delete", cache: false, data: {id_post:$(this).attr("id")}, // since, you need to delete post of particular id success: function(reaksi) { if (reaksi){ alert("Success"); } else { alert("ERROR"); } } }); }); });
type: Answer

http://stackoverflow.com/comment/44305812
has text: Check: http://stackoverflow.com/questions/22317951/export-html-table-data-to-excel-using-javascript-jquery-is-not-working-properl
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27955417

http://stackoverflow.com/comment/44262641
type: Comment
comment on: http://stackoverflow.com/a/27932215
has text: Great, thanks. I think the msg variable was a red herring but the promises work. However, if I wanted to save how would I do it? I tried adding save code before response.success but it doesnt work?
type: AnswerComment
score: 0

http://stackoverflow.com/q/27903247
tagged with: jquery
has title: Bind all the li except the last one
favorite count: 0
has comment: http://stackoverflow.com/comment/44205677
has answer: http://stackoverflow.com/a/27903268
linked to: http://stackoverflow.com/q/18278082
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27903279
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27903269
has body: I want to bind all the li except the last one using jQuery. , is it possible to do that in one line,I've tried to Google it without any success. $('#elementName li').on('click', someFunction); $('#elementName li:last-child').off('click'); ?
accepted answer: http://stackoverflow.com/a/27903268
upvote count: 5
has answer: http://stackoverflow.com/a/27903274
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/27903269

http://stackoverflow.com/a/27830476
downvote count: 0
has comment: http://stackoverflow.com/comment/44067167
has body: You need to build the HTML elements in a string first and add them to the div as a last step. Fixed scenario 1: function addfeilds1() { var totalfeilds = document.getElementById("numberoffeilds").value; var i; var htmlString = ""; htmlString += '&lt;form action= "issue.html" method = "POST"&gt;'; for(i=0;i&lt;totalfeilds;i++) { htmlString += '&lt;input type = "text"&gt;'; } htmlString += '&lt;input type = "submit" value="submit" name="submit"&gt;'; document.getElementById("div4").innerHTML = htmlString; } This prevents the form tag from being closed before it's populated with inputs. Fixing scenario 2: function forloop() { var htmlString = ""; for(i=1 ;i&lt;totalfeilds;i++) { htmlString += '&lt;input type = "text"&gt;'; } return htmlString; // now forloop returns a string that can be added to the element. It no longers returns undefined. } Actually scenario 2 was fixing scenario 1, but you didn't include a return in your function. If you expect a function to create some text and concat that into a string you need your function to return a string. Third example (advanced) function addfeilds1() { var totalFields = parseInt(document.getElementById("numberoffeilds").value); //parse integer from value if (isNaN(totalFields) || totalFields &lt; 1) { //check if the input is valid, if not alert. alert("Value is not a valid number or lower than 1."); } var container = document.getElementById("div4"); //create the form var form = document.createElement("form"); form.setAttribute("action", "issue.html"); form.setAttribute("method", "POST"); for(var i=0; i&lt;totalFields; ++i) { var node = document.createElement("input"); node.setAttribute("name", "field[]"); //this sends a array to the request page containing all input field values. form.appendChild(node); //add the fields to the form. } //create the submit button. var button = document.createElement("input"); button.setAttribute("type", "submit"); button.setAttribute("value", "submit"); button.setAttribute("name", "submit"); …
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44067362
type: Answer
accepted answer of: http://stackoverflow.com/q/27830160
has comment: http://stackoverflow.com/comment/44067381
has comment: http://stackoverflow.com/comment/44066971
score: 2
answers question: http://stackoverflow.com/q/27830160

http://stackoverflow.com/q/27839516
has comment: http://stackoverflow.com/comment/44082716
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
score: -1
has body: I am making a javascript in which ha a need that I need the word which is inside two brackets. for example [Green]- Amazon I need to extract the word Green from it , I can not use indexOf() as it can have other colors in the brackets as [red], [blue] etc. I am not able to figure out how to get the characters exactly between the two brackets. can someone help me ?
has comment: http://stackoverflow.com/comment/44082805
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27841838
tagged with: regex
has title: How to filter the string starting from a particular character and upto a character in javaScript
downvote count: 1

http://stackoverflow.com/q/27941959
favorite count: 0
has body: I have developed a music sequencer in javascript; something like this: http://stepseq.michd.me/ I have implemented loop using setInterval function in following way: var Sequencer = { ... // every step sequencer ... next: function(callback) { // restart from begin if arrive to last sequecer step if(Sequencer.current==Sequencer.steps.length) Sequencer.current = 0; // play all sounds in array step contains if(Sequencer.steps[Sequencer.current].length&gt;0) { var set = Sequencer.steps[Sequencer.current]; for(var i=0;i&lt;set.length;i++){ set[i].play(); } } callback(Sequencer.current); Sequencer.current++; }, loop: function(callback) { Sequencer.interval = $interval(function(){ Sequencer.next(callback); }, Sequencer.time); } } ... Code below works but i think that there is a better way to implement loop; infact sometimes steps goes out of time. Sequencer.time (time passed to setInterval function) is a time in millisecs (this value is the conversion of a bpm value; for example it can be 125), Someone can suggest me a better solution? N.B.: this is a web application angularjs based (for this reason in code above a use $interval insteed of setInterval), but i think that this point is insignificant.
tagged with: angularjs
tagged with: html5-audio
upvote count: 2
tagged with: web-applications
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27942059
tagged with: performance
has comment: http://stackoverflow.com/comment/44279809
type: Question
score: 2
downvote count: 0
has title: Timing in javascript sequencer
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27942059
answer count: 1

http://stackoverflow.com/comment/44293684
score: 0
type: Comment
has text: When is it null? Always or only when called directly? You may need to use context.Request.ServerVariables["HTTP_REFERER"] instead.
comment on: http://stackoverflow.com/a/27949115
type: AnswerComment

object
tags question: http://stackoverflow.com/q/27887561
tag name: object
tags question: http://stackoverflow.com/q/27877705
tags question: http://stackoverflow.com/q/27861349
tags question: http://stackoverflow.com/q/27938988
tags question: http://stackoverflow.com/q/27875808
tags question: http://stackoverflow.com/q/27887720
tags question: http://stackoverflow.com/q/27856540
tags question: http://stackoverflow.com/q/27840274
tags question: http://stackoverflow.com/q/27848564
tags question: http://stackoverflow.com/q/27883740
tags question: http://stackoverflow.com/q/27885674
tags question: http://stackoverflow.com/q/27849880
tags question: http://stackoverflow.com/q/27920105
tags question: http://stackoverflow.com/q/27831999
tags question: http://stackoverflow.com/q/27846389
tags question: http://stackoverflow.com/q/27878174
tags question: http://stackoverflow.com/q/27946173
tags question: http://stackoverflow.com/q/27914359
tags question: http://stackoverflow.com/q/27930749
tags question: http://stackoverflow.com/q/27816010
tags question: http://stackoverflow.com/q/27812529
tags question: http://stackoverflow.com/q/27962824
tags question: http://stackoverflow.com/q/27867658
tags question: http://stackoverflow.com/q/27943215
tags question: http://stackoverflow.com/q/27900939
tags question: http://stackoverflow.com/q/27836853
tags question: http://stackoverflow.com/q/27923280
tags question: http://stackoverflow.com/q/27865755
tags question: http://stackoverflow.com/q/27882879
tags question: http://stackoverflow.com/q/27874984
tags question: http://stackoverflow.com/q/27953215
tags question: http://stackoverflow.com/q/27845479
tags question: http://stackoverflow.com/q/27894391
tags question: http://stackoverflow.com/q/27850252
tags question: http://stackoverflow.com/q/27960262
tags question: http://stackoverflow.com/q/27928973
type: Tag
tags question: http://stackoverflow.com/q/27881568
tags question: http://stackoverflow.com/q/27893675

http://stackoverflow.com/a/27844865
has comment: http://stackoverflow.com/comment/44094118
has body: I would add a data- attribute to each link, referencing either the number of the li you wish to toggle or (better) an ID of that element. $('a.alive').click(function() { var elnum = $(this).data('elnum'); $('ul#menu-toc li').removeClass('menu-toc-current') .eq(elnum).toggleClass('menu-toc-current'); }); .menu-toc-current { color: red; } Cat Dog Bird Show me Cats Show me Dogs Show me Birds http://api.jquery.com/data Using IDs instead of numbers is advantageous, however, because it makes it easier to rearrange the list: $('a.alive').click(function() { var elid = $(this).data('elid'); $('ul#menu-toc li').removeClass('menu-toc-current') .filter('#'+elid).toggleClass('menu-toc-current'); }); .menu-toc-current { color: red; } Cat Dog Bird Show me Cats Show me Dogs Show me Birds Now, if you want to move "Cat" after "Dog" later on, you don't need to change the data-elid attribute like you would data-elnum.
has comment: http://stackoverflow.com/comment/44094701
has comment: http://stackoverflow.com/comment/44094565
score: 0
has comment: http://stackoverflow.com/comment/44094814
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27844724
has comment: http://stackoverflow.com/comment/44093877
answers question: http://stackoverflow.com/q/27844724
type: Answer

http://stackoverflow.com/q/27825064
tagged with: javascript
tagged with: destroy
upvote count: 1
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27844004
accepted answer: http://stackoverflow.com/a/27844004
has title: Deleting root nodes in jstree detaches event listeners
has body: I want to recreate the jstree by deleting all the root nodes and reading back the structure by using ajax. If I use: $("#tree").jstree("destroy"); and then recreate the jstree instance: $("#tree").jstree({ "core": {"check_callback" : true} }); it draws a new jstree. I add the json information coming from the ajax, but the event listeners don't work any more when I click on the root nodes. This is the workaround routine that works: var ref = $("#tree").jstree(true); // get an existing instance var nodes = ref.get_node("#").children; // -1 didn't work, so I used "#" while (nodes.length &gt; 0){ ref.delete_node(nodes[0]); } Is there any parameter that I am missing with the "destroy" method that will allow the event listeners connect back with the new jstree instance ?
type: AnsweredQuestion
tagged with: root
downvote count: 0
score: 1
type: Question
tagged with: jstree
tagged with: children

http://stackoverflow.com/q/27943937
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/44283128
has comment: http://stackoverflow.com/comment/44283236
downvote count: 0
has comment: http://stackoverflow.com/comment/44283207
possible better answer: http://stackoverflow.com/a/27944003
favorite count: 0
has title: String split in 2 arrays
has answer: http://stackoverflow.com/a/27944003
upvote count: 2
has body: I want to split the following string into 2 arrays. First array from the beginning to '/' and the second from '/' to end. Also, I've tryied with replace to remove the '/' but returns error. var str = 'word1-word2/word3+word4'.replace(/\+|/|-/g,' '); http://jsbin.com/kubezabemu/1/edit?js,console The wanted output should be like: var arr1 = ['word1', 'word2']; var arr2 = ['word3', 'word4'];
has comment: http://stackoverflow.com/comment/44283164
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27944146
type: Question
accepted answer: http://stackoverflow.com/a/27944146
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/q/27867432
has answer: http://stackoverflow.com/a/27868003
has title: get radio checked values and switch div without reload page
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27868442
score: 0
answer count: 2
tagged with: radio-button
has comment: http://stackoverflow.com/comment/44137523
accepted answer: http://stackoverflow.com/a/27868003
possible better answer: http://stackoverflow.com/a/27868442
has body: My first question here. I have two option groups, when I use the selected option of two groups, I expect the page to show result div ( without the page reloading ) My code is below Viet Nam US Europe bikers cars planes I want, eg location == vn AND type == biker ==> replace div id=result by div id=vnbiker or if location == eu AND type = cars ==> replace div id=result by div id=eunotplanes When any radio button is changed, the result div should change too (without a page reload).
type: AnsweredQuestion

http://stackoverflow.com/q/27920514
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27922271
has body: The Problem I'm wondering if there's a neat, performant way to bind an angular view to the existence of a particular item in an array. Basically, I have two controllers on one page. Controller A can delete or add items in an array that's injected by a service. I want Controller B, that's injected with the same service, to update its view when I do deletes or adds from Controller A. The Problem With Lobsters Say I'm creating a lobster dating site. I'd have two views, side by side: The hottest lobster view shows a list of the hottest lobsters in the ocean. If any of these lobsters happens to be your friend, its list item will be highlighted and have a message saying that you're friends. The lobster friends view is on the same page as the hottest lobster view. If I unfriend a lobster from the lobster friend view, (i.e. remove the lobster from the lobsterFriend array), the hottest lobster view should update accordingly, and stop highlighting the unfriended lobster. I'd like a solution that will work with large numbers of lobsters. The Setup Disclaimer: Code in this question is just for illustration purposes. I'm not actually creating a dating site for lobsters. I have an angular service that I'm injecting into two controllers. The service returns an array of objects. lobsterFriendService, a service for managing lobster friends: angular.module('lobsterDating') .factory('lobsterFriendService', function($http) { return { // An array of lobsters lobsterFriends: $http.get('lobsterApi/lobsterFriends/'), addLobsterFriend: function (lobster) { this.lobsterFriends.push(lobster); $http.post('lobsterApi/lobsterFriends/', lobster); }, deleteLobsterFriend: function (crustaceanId) { this.lobsterFriends = this.lobsterFriends.filter(function (lobster) { return lobster.id !== crustaceanId; }); $http.delete('lobsterApi/lobsterFriends/', crustaceanId); } } }); LobsterFriendsCtrl, a controller for the friends list, injected with lobsterFriendService: angular.module('lobsterDating') .contro…
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44240522
tagged with: computed-properties
score: 0
has comment: http://stackoverflow.com/comment/44239380
tagged with: binding
has comment: http://stackoverflow.com/comment/44240377
answer count: 1
has comment: http://stackoverflow.com/comment/44240937
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27922271
has title: Angular binding to existence in array, or, performant computed properties

http://stackoverflow.com/a/27806272
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44021955
upvote count: 1
has comment: http://stackoverflow.com/comment/44021807
type: Answer
has comment: http://stackoverflow.com/comment/44022040
answers question: http://stackoverflow.com/q/27806192
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27806192
has body: You can get a similar effect with just CSS - set the same color and background on the cells, then switch to something readable on hover: .red { color: red; background-color: red; } .blue { color: blue; background-color: blue; } .revealer:hover td { color: black; background-color: white; } One Two Three Four
has comment: http://stackoverflow.com/comment/44021692
has comment: http://stackoverflow.com/comment/44021637

http://stackoverflow.com/q/27828611
has comment: http://stackoverflow.com/comment/44063246
has body: I'm trying to make a function that whenever I click on the button, the image on the screen width decrease by 100px, the width of the picture are all 800px here is what I have: var width_of_pic = 800 ; function shrink() { width_of_pic = width_of_pic - 100; var image_element= document.getElementById( "image_element_id" ) ; image_element.style.width = width_of_pic; }
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27828672
type: Question
has comment: http://stackoverflow.com/comment/44063228
has title: How to shrink image using Javascript
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27828672

http://stackoverflow.com/q/27920291
tagged with: jquery
has comment: http://stackoverflow.com/comment/44238031
favorite count: 0
has answer: http://stackoverflow.com/a/27920383
has comment: http://stackoverflow.com/comment/44238046
has comment: http://stackoverflow.com/comment/44238192
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/750486
type: Question
has title: set event function trigger in looping with jquery
has body: I would like to ask something about set event trigger with jquery. First of all, i have a form with many buttons ( btnadd1 , btnadd2, btnadd3 , ... ) I have this code: for(i=1;i=&lt;3;i++){ $('.btnAdd'+i).click(function(){ alert(i); }); } The code should be alert(1) when i click btnadd1 , alert(2) when i click btnadd2, but the problem is when i click btnadd1, btnadd2, or btnadd3 it alerts "3" My assumption is that the function overwrites the previous function. Does anyone have a solution for this problem?
tagged with: javascript
score: -1
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/27920410
has answer: http://stackoverflow.com/a/27920627

universal-analytics
tag name: universal-analytics
tags question: http://stackoverflow.com/q/27900705
type: Tag
tags question: http://stackoverflow.com/q/27934994

http://stackoverflow.com/q/27810071
has answer: http://stackoverflow.com/a/27831163
answer count: 1
tagged with: double-click
accepted answer: http://stackoverflow.com/a/27831163
type: AnsweredQuestion
type: Question
has title: Adblocker detection using gpt callback in javascript
tagged with: javascript
has body: I have seen a few methods to detect if a user has ad blocking enabled, such as loading a ads.js file and changing a variable once that has loaded. Is there a way to detect this simply in the google doubleclick gpt callback? Basically I just want to look into some ad view discrepancies and see how many users not seeing ads have an ad blocker enabled. I noticed with both ad blockers I am trying the gpt callback is still fired and the iframes are loaded with empty body tags.
score: 0

http://stackoverflow.com/a/27833702
score: 1
has comment: http://stackoverflow.com/comment/44072882
has comment: http://stackoverflow.com/comment/44074501
upvote count: 1
has comment: http://stackoverflow.com/comment/44074225
has comment: http://stackoverflow.com/comment/44073308
type: Answer
has body: Try this $("#btnReg").on('click',function(){ }); //click EDIT: $.each(response, function(index,value){ hiddenId+=' '+value.Hotel.Id+' '; output+=' '+value.Hotel.Name+' has'+value.Hotel.Romms+' '; }); $(".hotel").on('click',function(){ }); //click EDIT2 $(".hotel").live('click',function(){ }); //click $(".hotel").delegate('click',function(){ }); //click EDIT3 ' '+value.Hotel.Name+' has'+value.Hotel.Romms+' '; $(".hotel").live('click',function(){ var id = $(this).attr('id'); alert(id); }); //click
downvote count: 0
answers question: http://stackoverflow.com/q/27833594
has comment: http://stackoverflow.com/comment/44074623

http://stackoverflow.com/comment/44149612
type: Comment
comment on: http://stackoverflow.com/a/27873672
score: 0
type: AnswerComment
has text: no bro but now i want to print the data in a table row like a grid view

http://stackoverflow.com/comment/44220467
has text: The geolocation service is asynchronous (so position will not be defined until the callback function runs). [Your code as posted works for me](http://jsfiddle.net/pmmdg3cu/)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27909901

http://stackoverflow.com/comment/44253842
type: QuestionComment
has text: Inform `Polymer` about `headerList`: `Polymer( "graph-optionsLoad", { headerList: [] ...` (even better in `create()` callback) or use `template is='auto-binding'`. Plus iterationg should be done on `headerList.headers`: `repeat="{{h in headerList.headers}}"`.
comment on: http://stackoverflow.com/q/27928340
score: 0
type: Comment

http://stackoverflow.com/comment/44180263
has text: That's great, but link-only answers aren't useful on SO. If you could summarize the main points *and* link, that would be useful.
comment on: http://stackoverflow.com/a/27889665
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44297582
score: 0
comment on: http://stackoverflow.com/q/27951157
type: Comment
type: QuestionComment
has text: Try narrowing down the code a bit to find your issue.

http://stackoverflow.com/q/27912213
upvote count: 8
tagged with: google-chrome-extension
has title: Using Segment IO in Chrome Extension
score: 8
possible better answer: http://stackoverflow.com/a/76850475
tagged with: google-chrome
accepted answer: http://stackoverflow.com/a/28060922
has answer: http://stackoverflow.com/a/76850475
type: Question
type: AnsweredQuestion
tagged with: segment-io
answer count: 2
has body: I can't seem to get Segment to work despite following these instructions: https://segment.com/docs/platforms/chrome-extension/ When I run analytics.track, I don't see any network requests for the tracking pixels but I don't see any error either. The analytics object exists, but it doesn't seem to do anything. It's important to note here that I'd like to run Segment from the context of the page. My extension injects new DOM elements and CSS styles into the webpage and I want to track the user's interactions with these elements. So Segment is not running in the context of the extension at all. It's injected into the page's head as a script.
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28060922

http://stackoverflow.com/comment/44257211
type: Comment
comment on: http://stackoverflow.com/a/27929828
score: 0
type: AnswerComment
has text: You will if you examine the content's namespace.

http://stackoverflow.com/q/27827008
tagged with: jsp
tagged with: javascript
tagged with: linux
has title: Deleting a file that resides on an internal Linux server via my application
has answer: http://stackoverflow.com/a/27849334
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/27829757
tagged with: spring
has body: I've recently been working on an enhancement for an application at work that will allow users to delete presentations stored not on their local machine but on a Linux server present on the internal network. My problem is that I am not sure how to go about performing this delete. The location of the files are as follows: http://ipaddress/dataconf/productusers/**ACCOUNT**/presentations/ I have access to the ACCOUNT name which is a parameter that will need to be passed in to navigate to the right directory. I will also have access to the presentation name which will be needed to specify the correct presentation to delete. What I am having trouble with is where to begin. I am using the Spring framework so my code is a mixture of Java, JSP, and JavaScript. Essentially I have a .jsp page where I layout the presentations that are associated with each account. I.E when you click on an account it makes a call to a database and lists the presentations that are associated with that account. You can then select individual accounts and delete, or press one delete all button and delete them all. I currently have it working so that when you delete a presentation in my application, it deletes the appropriate record from the database, but I also need to delete the physical presentation which is the basis for this question. Just as an FYI, these requests (get presentations from database, remove presentations from database) are all being handled through AJAX and JSON. I am hoping to learn how to create a connection to the correct server, navigate to the proper directory as specified above, and issue the Linux command "sudo rm file-name" all in the same delete process that I described in the prior paragraph. If you could point me in the right direction, any help would be much appreciated. Also, if you need any further clarification please feel free to let me know. Thanks again, Dave
tagged with: java
type: Question
answer count: 2

http://stackoverflow.com/comment/96001790
has text: this is the best answer
type: AnswerComment
type: Comment
score: 6
comment on: http://stackoverflow.com/a/50790330

http://stackoverflow.com/comment/44134122
comment on: http://stackoverflow.com/q/27865787
has text: @AlexanderO'Mara right - there's no "childNodes" property on a NodeList object.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29877440
type: Answer
answers question: http://stackoverflow.com/q/27830052
score: 0
has body: Like g00glen00b said, you should have listed the code for MarkTicket. However, since you said that: MarkTicket only shows a Createsubclass and extend method when I debug. ...it's clear that MarkTicket is a class created through dojo.declare(). Presumably Test() is an method on MarkTicket instances, not on the MarkTicket class itself. Therefore, you could do something like this: var m = new MarkTicket(); m.Test("call from MarkTicketForm");

http://stackoverflow.com/q/27895137
has comment: http://stackoverflow.com/comment/44191445
has comment: http://stackoverflow.com/comment/44191993
has title: appending to a list in jquery
type: Question
has body: In my appinventor app, I use a webviewer to view an html page, which contains a listview. Now, I have exactly ten list items and I wrote them in the html code. If I have 12 items in my list which is urlArray.length=12 in the code, is there a way I could append items to the list like the following? 12 Test Name 9 Test Explanation 9 as you can see in the code, for the 11th item in the list datasent(10) should be datasent(11), id="listimg9" should be id="listimg10", id="testscore9" should be id="testscore10", id="testname9" should be id="testname10" and id="testexp9" should be id="testexp10" If there is a better solution, like generating the list depending on how long the urlArray is, it would be a better solution but currently, I don't have any idea how to place those id tags inside li items other than typing. List App Tests 12 Test Name 0 Test Explanation 0 12 Test Name 1 Test Explanation 1 12 Test Name 2 Test Explanation 2 12 Test Name 3 Test Explanation 3 12 Test Name 4 Test Explanation 4 12 Test Name 5 Test Explanation 5 12 Test Name 6 Test Explanation 6 12 Test Name 7 Test Explanation 7 12 Test Name 8 Test Explanation8 12 Test Name 9 Test Explanation 9
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27896255
type: UnansweredQuestion

http://stackoverflow.com/a/27807062
has body: You might want to try focus and blur/change. $("select.desired").on("blur change focus", function (evt){ $(this).toggleClass('desired', evt.type!=="focus"); //if (evt.type==="change") $(this).blur(); }); select { margin: 30px 10px; border: 1px solid #111; background: transparent; border: 1px solid #ccc; padding: 5px 10px; -webkit-appearance: none; -moz-appearance: none; appearance: none; } select.desired { font-size: 30px; color: blue; } Apples Pineapples Chocklate Pancakes
has comment: http://stackoverflow.com/comment/44023113
has comment: http://stackoverflow.com/comment/44023237
has comment: http://stackoverflow.com/comment/44023306
has comment: http://stackoverflow.com/comment/44023092
score: 0
answers question: http://stackoverflow.com/q/27806890
type: Answer

http://stackoverflow.com/comment/44042471
comment on: http://stackoverflow.com/a/27818178
score: 0
type: AnswerComment
has text: can you just give your cursor data that you are getting from database
type: Comment

http://stackoverflow.com/q/27872193
has title: How to interpolate handlebars values into a Rails link_to helper?
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44146915
tagged with: handlebars.js
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/44146894
type: Question
has answer: http://stackoverflow.com/a/27872234
score: 1
has body: I'm working on a handlebars.erb template, but I'm getting an error when trying to put a handlebars {{id}} into a link_to helper. Any ideas how to do it? &lt;%= link_to "Link", edit_user_photo_path(id: {{id}} ) %&gt; This wont work, the value for the id will be {{id}}. If I put {{id}} outside the helper, its value is 139. I don't know how can I make a link_to interpret the handlebars value! Thanks
upvote count: 1
has comment: http://stackoverflow.com/comment/44147178
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/27930543
score: 1
linked to: http://stackoverflow.com/q/11442632
tagged with: post
type: Question
has comment: http://stackoverflow.com/comment/44258793
has comment: http://stackoverflow.com/comment/44259023
has title: Unable to send data using POST request in AngularJS
linked to: http://stackoverflow.com/q/24710503
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has body: I try to post data from angularJS to my web-Service and want to get data back. The post-request works great, I get data back (which I hardcoded in PHP), but (after 2h searching) my problem is that I cant send some Post-Data. Here my code: angular.module('LunchApp', []) .controller('MessagesCtrl', function($scope, $http){ $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded"; var postData = { callMethod: 'getChat' }; $http.post(url, postData).success(function(data){ $scope.messages = data; }); }); I have tried many solutions: https://www.youtube.com/watch?v=vs-egO-odAg How do I POST urlencoded form data with $http in AngularJS? $http post in Angular.js but nothing works for me... :( If I try it with a RESTful TestClient, it works perfectly. all posted data reach the server. But not with AngularJS :(
has comment: http://stackoverflow.com/comment/44258576
linked to: http://stackoverflow.com/q/15894650
upvote count: 1
tagged with: web-services

http://stackoverflow.com/comment/44299030
score: 0
has text: So what have you tried? Is something not working? SO Is not a coding service, we're not going to write this for you.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27951974

http://stackoverflow.com/a/27929557
score: 1
answers question: http://stackoverflow.com/q/27929456
has body: $('#container').append(grid); $('#container &gt; div').addClass('grid-class'); $('#container &gt; div').addClass(line); You're selecting all of the divs, not just the most recent one. You could solve that simply by adding a :last selector: $('#container').append(grid); $('#container &gt; div:last').addClass('grid-class'); $('#container &gt; div:last').addClass(line); You could also simplify this by doing it all on a jQuery object created out of grid: $(grid).addClass('grid-class').addClass(line).appendTo('#container');
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/q/27961881
answer count: 0
has comment: http://stackoverflow.com/comment/44317423
has comment: http://stackoverflow.com/comment/44317309
has title: Addthis: Display total shares
has comment: http://stackoverflow.com/comment/44317363
has comment: http://stackoverflow.com/comment/44318764
type: Question
has comment: http://stackoverflow.com/comment/44317128
has comment: http://stackoverflow.com/comment/44317233
has comment: http://stackoverflow.com/comment/44317092
tagged with: javascript
has body: I would like to get the AddThis widget to display the total number of shares of an URL on Facebook, Twitter and Google+. Here comes my code: JSFIDDLE: http://jsfiddle.net/ez8ya0ov/ How do I achieve that the total count of shares on facebook, twitter and google+ get displayed in a bubble on the right side? I do NOT want the individual numbers of each social media service get displayed (in this example I want to get rid of the bubble with "7" next to the google+ icon). Anyone has an idea how to achieve that?
tagged with: social-media
has comment: http://stackoverflow.com/comment/44317520
score: 0
type: UnansweredQuestion
tagged with: addthis

http://stackoverflow.com/a/27843470
score: 1
type: AcceptedAnswer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27841252
type: Answer
answers question: http://stackoverflow.com/q/27841252
has body: it is a question of how you want to target the fields. At the moment, your validateMe() function selects all inputs with the name 'c' and all with the name 'd', that are available in the DOM. But It only does anything "real" when there is exactly one element of each. So, what could you do? If you want to validate all forms at once, you could loop over all selected fields quick and dirty: var a = $('input[name="c"]'); var b = $('input[name="d"]'); if( a != null && a.length >= 1 && b != null && b.length == a.length ){ for (i = 0; i < a.length; i++) { // your code, just use a[i], b[i] instead of a[0].. } } If you want to target exactly one form it is easier to use ids. One way to do it is to use a fixed prefix for each form, for example form1_. HTML <input type="text" id="form1_code" name="code".... apply .... JS function validateMe(formPrefix) { var a = $('#' + formPrefix + '_code'); ... if (a != null...) { // use a directly, it is not an array in this case, so no need for a[0] etc
downvote count: 0

image
tags question: http://stackoverflow.com/q/27886677
tags question: http://stackoverflow.com/q/27856565
tags question: http://stackoverflow.com/q/27828691
tags question: http://stackoverflow.com/q/27952304
tags question: http://stackoverflow.com/q/27959498
tags question: http://stackoverflow.com/q/27915355
tags question: http://stackoverflow.com/q/27917430
tags question: http://stackoverflow.com/q/27845568
tags question: http://stackoverflow.com/q/27854033
tags question: http://stackoverflow.com/q/27949539
tags question: http://stackoverflow.com/q/27862111
tags question: http://stackoverflow.com/q/27954834
tags question: http://stackoverflow.com/q/27837928
tags question: http://stackoverflow.com/q/27873103
tags question: http://stackoverflow.com/q/27869112
tags question: http://stackoverflow.com/q/27953911
tags question: http://stackoverflow.com/q/27922814
tags question: http://stackoverflow.com/q/27957719
tags question: http://stackoverflow.com/q/27860884
tags question: http://stackoverflow.com/q/27863617
tags question: http://stackoverflow.com/q/27953872
tags question: http://stackoverflow.com/q/27890347
tag name: image
tags question: http://stackoverflow.com/q/27817698
tags question: http://stackoverflow.com/q/27865472
tags question: http://stackoverflow.com/q/27902633
tags question: http://stackoverflow.com/q/27902458
type: Tag
tags question: http://stackoverflow.com/q/27930441
tags question: http://stackoverflow.com/q/27884029

http://stackoverflow.com/comment/62812969
type: Comment
has text: @StanE "I don't think that async AJAX requests would work in a worker thread" - wrong, async requests are fully functional in worker threads. If the thread is terminated, then the request may be cancelled (like what happens when a page is unloaded before the server sends a reply to a request). Sending requests in order is a no-brainer, just wait until the request is completed (via events).
score: 0
comment on: http://stackoverflow.com/a/27899624
type: AnswerComment

http://stackoverflow.com/q/27905214
answer count: 2
has comment: http://stackoverflow.com/comment/44237135
possible better answer: http://stackoverflow.com/a/27910045
has body: I've been trying to learn Web GL using these awesome tutorials. My goal is to make a very simple 2D game framework to replace the canvas-based jawsJS. I basically just want to be able to create a bunch of sprites and move them around, and then maybe some tiles later. I put together a basic demo that does this, but I hit a performance problem that I can't track down. once I get to ~2000 or so sprites on screen, the frame rate tanks and I can't work out why. Compared to this demo of the pixi.js webgl framework, which starts losing frames at about ~30000 bunnies or so (on my machine), I'm a bit disappointed. My demo (framework source) has 5002 sprites, two of which are moving, and the frame rate is in the toilet. I've tried working through the pixi.js framework to try to work out what they do differently, but it's 500kloc and does so much more than mine that I can't work it out. I found this answer that basically confirmed that what I'm doing is roughly right - my algorithm is pretty much the same as the one in the answer, but there must be more to it. I have so far tried a few things - using just a single 'frame buffer' with a single shape defined which then gets translated 5000 times for each sprite. This did help the frame rate a little bit, but nothing close the the pixi demo (it then meant that all sprites had to be the same shape!). I cut out all of the matrix maths for anything that doesn't move, so it's not that either. It all seems to come down to the drawArrays() function - it's just going really slow for me, but only for my demo! I've also tried removing all of the texture based stuff, replacing the fragment shader with a simple block colour for everything instead. It made virtually no difference so I eliminated dodgy texture handling as a culprit. I'd really appreciate some help in tracking down what incredibly stupid thing I've done! Edit: I'm definitely misunderstanding something key here. I stripped the whole thing right back to basics, changing the vert…
upvote count: 3
linked to: http://stackoverflow.com/q/26564104
downvote count: 2
accepted answer: http://stackoverflow.com/a/27912649
linked to: http://stackoverflow.com/q/13009328
tagged with: javascript
tagged with: webgl
has title: Why is my simple webgl demo so slow
type: AnsweredQuestion
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27912649
has answer: http://stackoverflow.com/a/27910045
type: Question

http://stackoverflow.com/comment/44060558
has text: Because the executable expects a file as it's argument not a javascript command.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27824313

http://stackoverflow.com/a/27944562
score: 6
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27907050
type: Answer
accepted answer of: http://stackoverflow.com/q/27907050
upvote count: 6
has body: I've re-written your code based on the assumption that you have a target size in mind , e.g. after scrolling 650px you want your image to be 250px wide. It scrolls smoothly between the native size and the target size, and takes into account the fact that the window height could be less than your maximum scrolling distance: logoSize = function () { // Get the real width of the logo image var theLogo = $("#thelogo"); var newImage = new Image(); newImage.src = theLogo.attr("src"); var imgWidth = newImage.width; // distance over which zoom effect takes place var maxScrollDistance = 650; // set to window height if that is smaller maxScrollDistance = Math.min(maxScrollDistance, $(window).height()); // width at maximum zoom out (i.e. when window has scrolled maxScrollDistance) var widthAtMax = 500; // calculate diff and how many pixels to zoom per pixel scrolled var widthDiff = imgWidth - widthAtMax; var pixelsPerScroll =(widthDiff / maxScrollDistance); $(window).scroll(function () { // the currently scrolled-to position - max-out at maxScrollDistance var scrollTopPos = Math.min($(document).scrollTop(), maxScrollDistance); // how many pixels to adjust by var scrollChangePx = Math.floor(scrollTopPos * pixelsPerScroll); // calculate the new width var zoomedWidth = imgWidth - scrollChangePx; // set the width $('.logo').css('width', zoomedWidth); }); } logoSize(); See http://jsfiddle.net/raad/woun56vk/ for a working example.

http://stackoverflow.com/comment/138993706
comment on: http://stackoverflow.com/a/27883040
type: AnswerComment
has text: For V3 use "matches" instead of "ids" (also the wildcard won't work)
score: 0
type: Comment

http://stackoverflow.com/a/27939388
type: AcceptedAnswer
has body: You could the title of the page using JavaScript as simple as document.title. &lt;script type="text/javascript"&gt; var title = document.title; &lt;/script&gt; If you want to get the title of the page using jQuery, you could try this: $(function(){ var title = $('title').text(); }) Update The above can be applied, if you are the "owner" of the page. If you want to get the title of a page given it's url, there is a helpful link here, which addresses this problem.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27939318
answers question: http://stackoverflow.com/q/27939318
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44275253

http://stackoverflow.com/a/27915271
has comment: http://stackoverflow.com/comment/44230055
type: Answer
has comment: http://stackoverflow.com/comment/44229907
answers question: http://stackoverflow.com/q/27915217
has comment: http://stackoverflow.com/comment/44229947
has comment: http://stackoverflow.com/comment/44229841
has comment: http://stackoverflow.com/comment/44230414
score: 0
has comment: http://stackoverflow.com/comment/44229972
has comment: http://stackoverflow.com/comment/44230198
has comment: http://stackoverflow.com/comment/44229753
has comment: http://stackoverflow.com/comment/44230385
has comment: http://stackoverflow.com/comment/44229791
has body: You need to use class instead of id as it must be unique. Also use on() as live() is not available in latest versions of jquery. Now, your code looks like, $("#cart_details").on('blur','.rate', function(){ var rate=this.value; var $tr=$(this).closest('tr'); var qty =$tr.find('.quantity').val(); // use quantity class not id var amt=parseInt(rate)* parseInt(qty); $tr.find(".amount").val(amt); // use amount class not id }); And in your piece of PHP code would be, ....... echo " "; echo " ".$product_name." "; echo " "; echo " quantity."'/> "; echo " "; echo " "; echo " "; .......

http://stackoverflow.com/q/27889687
has comment: http://stackoverflow.com/comment/44182198
score: 23
type: Question
has answer: http://stackoverflow.com/a/27890038
downvote count: 0
tagged with: es6-promise
upvote count: 23
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/64591681
has title: Promise.defer() browser support
linked to: http://stackoverflow.com/q/28687566
tagged with: cross-browser
answer count: 4
has body: I am looking for a way to create deferred object which will be resolved outside the current scope. I like deferred objects and as I see Promise.defer() in Chrome 38 returns the deferred object. But in latest Firefox 34 Promise.defer is undefined as well in Safari 8.0. So I can't use Promise.defer everywhere now. What about future status? Will it be implemented in other browsers or will be removed as deprecated?
tagged with: promise
possible better answer: http://stackoverflow.com/a/27890038
has answer: http://stackoverflow.com/a/77674939
has answer: http://stackoverflow.com/a/27889770
accepted answer: http://stackoverflow.com/a/27889770
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44180701
has answer: http://stackoverflow.com/a/79079621

http://stackoverflow.com/q/27889663
answer count: 1
tagged with: javascript
upvote count: 1
favorite count: 0
has body: Can anybody explain why remove() method does not work as I expected. I want remove all img elements from the document. Loop through document and remove all images, that is what I want but this removes only 2 images,why? Here is the code JSBIN HTML &lt;img src="http://www.lorempixel.com/50/50" alt="pic"&gt; &lt;img src="http://www.lorempixel.com/50/50/animals" alt="pic"&gt; &lt;img src="http://www.lorempixel.com/50/50/city" alt="pic"&gt; JS var imgElements = document.getElementsByTagName("img"); // HTMLCollection for(var i=0; i&lt;imgElements.length; i++) { var img = imgElements[i]; img.remove(); }
downvote count: 0
accepted answer: http://stackoverflow.com/a/27889688
has title: removing images elements using DOM method
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27889688
tagged with: dom
type: Question

http://stackoverflow.com/comment/44320773
comment on: http://stackoverflow.com/q/27963018
score: 0
type: Comment
type: QuestionComment
has text: I know. I'm doing an internship and they chose this option a long time ago. It's too much work in my period as an intern to change all of this, so I really just can't.

firefox
tags question: http://stackoverflow.com/q/27813731
tags question: http://stackoverflow.com/q/27865209
tags question: http://stackoverflow.com/q/27886281
tags question: http://stackoverflow.com/q/27866328
tags question: http://stackoverflow.com/q/27886567
tags question: http://stackoverflow.com/q/27894362
tags question: http://stackoverflow.com/q/27916160
tags question: http://stackoverflow.com/q/27930442
tags question: http://stackoverflow.com/q/27893399
tags question: http://stackoverflow.com/q/27910458
tags question: http://stackoverflow.com/q/27818200
tags question: http://stackoverflow.com/q/27928671
tags question: http://stackoverflow.com/q/27831016
tags question: http://stackoverflow.com/q/27830784
tags question: http://stackoverflow.com/q/27848001
tag name: firefox
tags question: http://stackoverflow.com/q/27945484
tags question: http://stackoverflow.com/q/27817552
tags question: http://stackoverflow.com/q/27829023
tags question: http://stackoverflow.com/q/27843301
tags question: http://stackoverflow.com/q/27901159
tags question: http://stackoverflow.com/q/27814048
type: Tag
tags question: http://stackoverflow.com/q/27851153
tags question: http://stackoverflow.com/q/27933022
tags question: http://stackoverflow.com/q/27842615
tags question: http://stackoverflow.com/q/27925077
tags question: http://stackoverflow.com/q/27943917
tags question: http://stackoverflow.com/q/27844884
tags question: http://stackoverflow.com/q/27873580
tags question: http://stackoverflow.com/q/27907236
tags question: http://stackoverflow.com/q/27956045
tags question: http://stackoverflow.com/q/27854021
tags question: http://stackoverflow.com/q/27863009
tags question: http://stackoverflow.com/q/27901935
tags question: http://stackoverflow.com/q/27914809
tags question: http://stackoverflow.com/q/27843850
tags question: http://stackoverflow.com/q/27941779

http://stackoverflow.com/a/27809948
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27806344
has comment: http://stackoverflow.com/comment/44068100
has comment: http://stackoverflow.com/comment/44031845
has body: Try coming at it from another angle. Make a directive that binds to a value in your main controller. WIthin that directive watch that value and when it gets set to true, for example, call the method within the directive. In your main controller you can make the keypress shortcut set the necessary value to true based on focus that is also maintained in your main controller. Something like this angular.module('sampleApp', []).controller("SampleController", function($scope) { $scope.childDirectiveFlags = {dir1:false,dir2:false,dir3:false}; $scope.currentFocus = 'dir1'; // on keypress event set the flag to true in the directive you want action to // happen on $scope.childDirectiveFlags[$scope.currentFocus] = true; // Will trigger watch }; sampleApp.directive = directive('testQuestion', function() { return { restrict: 'E', scope : { watchValue: '@' }, link: function(scope, el, attrs) { scope.$watch('watchValue',function() { if(scope.watchValue) { scope.someFunction(); scope.watchValue = false; } }); scope.someFunction = function() {}; } } });
has comment: http://stackoverflow.com/comment/44030712

http://stackoverflow.com/q/27883188
score: 0
possible better answer: http://stackoverflow.com/a/27883221
has answer: http://stackoverflow.com/a/27961972
linked to: http://stackoverflow.com/q/9904379
has title: Google maps Infowindow doesnt size as expected
has answer: http://stackoverflow.com/a/27883606
accepted answer: http://stackoverflow.com/a/28329859
has answer: http://stackoverflow.com/a/27883221
has comment: http://stackoverflow.com/comment/44168812
answer count: 5
has body: I just want to display a default info window with the content The 123456789. So I am using the maps example from google, and changing the infowindow content. Simple as that. Info windows I am getting this in both Firefox and Chrome (expected The 123456789). Only in IE I have the desired result. The rest of the text is wrapped and in chrome the scrollbar is also visible. Now, as per the documentation, the InfoWindow should be expanded to fit my text, which it does if the content is a bit longer than the one I am testing. Is this a google maps styling issue and how can I simply display that text without custom InfoWindows and without hackish css? edit Tested the abode code again. The first time the infowindo is shown its problematic, the following times it's displayed as it should.
has comment: http://stackoverflow.com/comment/44168743
has answer: http://stackoverflow.com/a/28329859
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44168807
has comment: http://stackoverflow.com/comment/44168969
type: Question
has answer: http://stackoverflow.com/a/27883622
tagged with: google-maps
tagged with: javascript

http://stackoverflow.com/a/27868479
has comment: http://stackoverflow.com/comment/44207039
accepted answer of: http://stackoverflow.com/q/27867431
has comment: http://stackoverflow.com/comment/44255644
has comment: http://stackoverflow.com/comment/44206395
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27867431
has body: If you don't need old browser support you can use HTML5's localstorage function. Store your value and load it every time a new page loads. timer.php 00:00:00 example1.php 00:00:00
score: 0
type: Answer

http://stackoverflow.com/a/27870535
type: Answer
answers question: http://stackoverflow.com/q/27869655
score: 0
has body: I'm hoping to clarify what you've written in your question. In JavaScript, there are essentially 2 'styles' of declaring functions: 1) using function declarations or 2) using function expressions. Here are examples: function something () { console.log( 'This is a function declaration' ); } var orAnother = function () { console.log( 'This is a function expression' ); }; something(); // 'This is a function declaration' will show up on console orAnother(); // 'This is a function expression' will show up on console Both are valid ways to create a new function in JavaScript. Both are almost identical except in the way the JavaScript engine compiles these objects prior to execution of code. Function declarations are hoisted, a term which means that during the compilation phase, the JavaScript engine will assign the function object value to the function's identifier (i.e. 'something'). Function expressions, on the other hand, are only processed during the execution phase. The variable identifier associated with the function expression will be hoisted during compilation phase, but the function object itself won't be evaluated and assigned to the identifier until the execution phase. Between these two styles of declaring functions, function expressions are the most common form in my opinion. Another misconception you may hold (I'm assuming based on your example with function G) is that there is a special type of function called a constructor. I want to point out that this is NOT TRUE. In JavaScript, there is no such thing as a special constructor function. JavaScript only has functions - however, (unfortunately in my opinion) it has tried to mimic other classical languages by allowing you to use the new keyword before a function invokation. Here's an example: var cat = function (color) { this.color = color; }; var garfield = new cat('orange'); // garfield is now a new object with a color property of 'orange' However, you can just as easily call the function without a new key…

http://stackoverflow.com/comment/44177148
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27888092
type: Comment
has text: I've included the latest jQuery version using .. Still it doesn't work.

http://stackoverflow.com/comment/44542774
has text: is your product simple ? and do not have custom-options at all, because there are to many cases
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27942502
score: 0

http://stackoverflow.com/comment/44241347
type: QuestionComment
has text: It's a responsive layout - I'm not sure I can set fixed attributes?
comment on: http://stackoverflow.com/q/27922030
score: 0
type: Comment

http://stackoverflow.com/q/27897938
downvote count: 0
has comment: http://stackoverflow.com/comment/44200417
favorite count: 0
has comment: http://stackoverflow.com/comment/44196044
accepted answer: http://stackoverflow.com/a/27903007
has title: Is it possible that the comments from a NodeJS script create memory issues?
has comment: http://stackoverflow.com/comment/44196095
tagged with: node.js
upvote count: 11
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44202731
has comment: http://stackoverflow.com/comment/44290030
has body: I write NodeJS libraries and I usually put JSDoc comments in the code, generating documentation then. So, my code looks like this: /** * Sum * Calculates the sum of two numbers. * * @name Sum * @function * @param {Number} a The first number, * @param {Number} b The second number. * @return {Number} The sum of the two numbers. */ module.exports = function (a, b) { return a + b; }; When this script will be required from another NodeJS script, will the comment above be loaded in the RAM? So, do the big comments affect the memory somehow? I guess the NodeJS scripts are parsed and irrelevant things (e.g. comments) are not kept in the memory. Is this true? So, in conclusion, can such comments create any memory issues? Examples Stringifying a function, the comment is printed too: function foo () { // Hello World comment return 10; } console.log(foo.toString()); Output: $ node index.js function foo() { // Hello World comment return 10; } Another example is to generate lorem ipsum on 2 million lines and then, on the last line console.log(1). So, the file looks like: // long lorem ipsum on each line // ... // after 2 million lines console.log(1) Running the script above I get: $ node run.js FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory Aborted (core dumped) This happened on a 16GB RAM machine. I also compared the performance of a simple console.log(1) file with one that has lot of comments: $ time node with-comments.js 1 real 0m0.178s user 0m0.159s sys 0m0.023s $ time node no-comments.js 1 real 0m0.040s user 0m0.036s sys 0m0.004s
tagged with: ram
tagged with: memory
has comment: http://stackoverflow.com/comment/44200503
type: Question
has comment: http://stackoverflow.com/comment/44200393
tagged with: javascript
tagged with: comments
has answer: http://stackoverflow.com/a/27903007
score: 11
has comment: http://stackoverflow.com/comment/44200330
answer count: 1

http://stackoverflow.com/comment/44135480
type: AnswerComment
score: 0
type: Comment
has text: Very informative, worked and well. On a 30,000+ array took milliseconds. Thank you.
comment on: http://stackoverflow.com/a/27866414

http://stackoverflow.com/comment/44265289
comment on: http://stackoverflow.com/q/27933724
score: 0
type: Comment
has text: why are you using onclick with jquery?
type: QuestionComment

http://stackoverflow.com/a/27816513
answers question: http://stackoverflow.com/q/27815825
score: 0
has comment: http://stackoverflow.com/comment/44039191
has comment: http://stackoverflow.com/comment/44039336
has body: change id into class $(".jq-radio").change(function () { var status = $(this); if (status.val()=="True") { $("#SuppSelect").show(); } else { $("#SuppSelect").hide() } }); you can use this...
type: Answer

http://stackoverflow.com/a/27856558
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44116515
answers question: http://stackoverflow.com/q/27856540
downvote count: 0
has comment: http://stackoverflow.com/comment/44118026
has comment: http://stackoverflow.com/comment/44116528
has body: Yeah.. you could. Just modify your code to return the Shelf Object. function Library () { this.name = "My Library"; this.createShelf = function (n) { return new Shelf(n); } } Then you can do this var myLib = new Library(); var shelf = myLib.createShelf(number);

http://stackoverflow.com/comment/44318697
has text: That was pretty much perfect. Two things though: First off, every line of the script needs a semi-colon at the end, otherwise it won't work. Secondly, mapDisableUi returned true/false as it should, as that is the two values I assigned it in the xml file. But this was incredibly useful. If you don't mind, could you explain how to make an AJAX call like this work, for future reference?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27883653

http://stackoverflow.com/q/27813498
tagged with: javascript
tagged with: jquery
tagged with: jasmine
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I'm using jasmine framework with jquery and I need to load fixtures from a specific path. Here is my folder structure: E: - project - app - views //FIXTURE FILES HERE IN THIS FOLDER - main.html - public - scripts - library - jasmine-standalone - SpecRunner.html //JASMINE SPECRUNNER - specs //CHANGED PATH OF JASMINE'S SPEC FOLDER - testSpecs.js //FILE WHERE I NEED TO LOAD FIXTURES test.js //CONTAINS CODE I NEED TO TEST (included in SpecRunner) Now, I've changed the path of specs as shown, but I included that in SpecRunner and it works fine, as my tests are getting run. I now need to load main.html as a fixture to testSpecs. How would I do that? Here's what i tried: In testSpecs.js: describe("Login Form", function() { beforeEach(function(){ jasmine.getFixtures().fixturesPath = "/../../../app/views"; //(EDIT NEEDED HERE) jasmine.getFixtures().load('main.html'); }); In SpecRunner.html: Jasmine Spec Runner v2.1.3 PS - Can I incude .php files in fixture?
score: 1
has title: Jasmine fixtures: problems in setting path
tagged with: jasmine-jquery
type: Question
downvote count: 0

http://stackoverflow.com/comment/44276585
type: AnswerComment
has text: You can split it like @Alexis said and the remove the extra ""
type: Comment
comment on: http://stackoverflow.com/a/27940216
score: 0

http://stackoverflow.com/comment/44138792
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27866827
has text: Link.Text has "www.abc.com" but when the link is opened it tries to open my application name plus the link.text
score: 0

http://stackoverflow.com/q/27827847
has comment: http://stackoverflow.com/comment/44061831
has title: Merge objects containing array
has comment: http://stackoverflow.com/comment/44061638
has comment: http://stackoverflow.com/comment/44061897
has comment: http://stackoverflow.com/comment/44062102
has body: How can I merge two objects containing array and other fields using lodash? For example, obj1 = { name: "abc", hobbies: ["reading","cricket"] } obj2 = { name: "abc2", hobbies: ["reading","hockey"] } _.merge(obj1, obj2) // output { name: "abc2", hobbies: ["reading","hockey"] } this returns an object after merging obj1 into obj2 but without merging the hobbies.
upvote count: 1
has answer: http://stackoverflow.com/a/27828305
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44061761
type: Question
accepted answer: http://stackoverflow.com/a/27828305
downvote count: 0
answer count: 1
tagged with: javascript
score: 1
favorite count: 0
tagged with: lodash

http://stackoverflow.com/q/27924998
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/57028621
favorite count: 0
type: UnansweredQuestion
has body: There is a problem in jQuery, that causes event handler bound via document not to fire, when the accesskey is used. The code sample for the problem: &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script src="//code.jquery.com/jquery-2.1.3.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function () { $(document).on("click", "#btnOK", save1); $("#btnOK").on("click", save2); document.getElementById("btnOK").addEventListener("click", save3); $(document).on("click", save4); }); $(document).on('submit', function () {alert("Submitting the page"); }); function save1() { alert('1'); //return false; } function save2() { alert('2'); // return false; } function save3() { alert('3'); //return false; } function save4(e) { console.log(this, e) if (e.target.id === "btnOK") alert(4); //return false; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form&gt; &lt;button id="btnOK" name="btnOK" accesskey="S" &gt;&lt;u&gt;S&lt;/u&gt;ave&lt;/button&gt;&amp;nbsp; &lt;/form&gt; &lt;/body&gt; As you would presume, when we click a button (using mouse button) in IE11, we get the sequence of messages: "2", "3", "1", "4", "Submitting the page". Then, it would be rational for the page to show the same behaviour if we "click" the button, using accesskeys. But you would be wrong. All we get is "2", "3", "4", "Submitting the page". Despite the fact, that "click" event is exactly the same (except for button and buttons properties, but that doesn't matter), we register the click event with $(document).on("click", save4); but not with $(document).on("click", "#btnOK", save1); Does anybody know, how to fix it? Not using IE11 is not an option.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44248049
answer count: 0
has comment: http://stackoverflow.com/comment/44247779
has comment: http://stackoverflow.com/comment/56947912
score: 1
has comment: http://stackoverflow.com/comment/44247084
upvote count: 1
type: Question
has title: jQuery submit button accesskey issue in the IE11
tagged with: javascript
linked to: http://stackoverflow.com/q/5061353

http://stackoverflow.com/a/27883661
type: Answer
has comment: http://stackoverflow.com/comment/44251602
has comment: http://stackoverflow.com/comment/44262997
has comment: http://stackoverflow.com/comment/44173856
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44252392
has body: Here's one way using a gradient that's translated through your symbols: var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var cw=canvas.width; var ch=canvas.height; var gradient=ctx.createLinearGradient(0,0,30,0); gradient.addColorStop(0.00,'blue'); gradient.addColorStop(0.50,'red'); gradient.addColorStop(1.00,'blue'); ctx.font='36px verdana'; ctx.fillStyle=gradient; var text='Sing along with Mitch'; var offset=0; var offsetChange=1; var textWidth=100; var textWidth=ctx.measureText(text).width; var nextTime=0; var delay=16*3; requestAnimationFrame(animate); function animate(time){ if(offset&lt;textWidth){requestAnimationFrame(animate);} if(time&lt;nextTime){return;} ctx.fillStyle='black'; ctx.fillRect(0,0,cw,ch); ctx.fillStyle=gradient; ctx.translate(offset,0); ctx.fillText(text,-offset,50); ctx.translate(-offset,0); offset+=offsetChange; } body{ background-color: ivory; } #canvas{border:1px solid red;} &lt;canvas id="canvas" width=500 height=200&gt;&lt;/canvas&gt;
has comment: http://stackoverflow.com/comment/44250378
answers question: http://stackoverflow.com/q/27880821
has comment: http://stackoverflow.com/comment/44239670
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27880821
has comment: http://stackoverflow.com/comment/44260239

windows-8.1
tags question: http://stackoverflow.com/q/27902416
type: Tag
tags question: http://stackoverflow.com/q/27941713
tag name: windows-8.1

http://stackoverflow.com/comment/44124272
has text: I want that the computed array `parameters` to keep the values that it already has, delete the ones that are no longer there and add the new ones. Currently it resets the array and repopulates it, therefore I lose the state of the objects I already have
comment on: http://stackoverflow.com/q/27857046
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44246259
comment on: http://stackoverflow.com/a/27923150
score: 0
type: AnswerComment
has text: There is cartModel i ncontroller. Sorry, I have'nt written this
type: Comment

http://stackoverflow.com/q/27936851
type: Question
possible better answer: http://stackoverflow.com/a/27937090
has comment: http://stackoverflow.com/comment/44270697
has title: ng-show from controller Angular
has comment: http://stackoverflow.com/comment/44270735
has comment: http://stackoverflow.com/comment/44270606
has comment: http://stackoverflow.com/comment/44270928
tagged with: javascript
has comment: http://stackoverflow.com/comment/44270873
score: 0
answer count: 2
has body: I have a controller like this : $scope.checkCodeMeli = function (id) { var result = myHellperService.checkCodeMeli(id); if (result === false) { $scope.requesterViewModel.NationalCode = ""; $scope.inValidMeliCode = "کد ملی نا معتبر می باشد"; } else { $scope.GetRequesterByNationalCode(id); } } and form like this : &lt;input ng-model="requesterViewModel.NationalCode" name="meli" type="text" placeholder="کد ملی" ng-blur="checkCodeMeli(requesterViewModel.NationalCode)" my-maxlength="10" ng-minlength="10" ng-maxlength="10" ng-required="true" required valid-number /&gt; in controller i want to print out a message when checkCodeMeli function is false . this ng-show doesn't work : ng-show : &lt;span ng-show="checkCodeMeli.inValidMeliCode"&gt;{{inValidMeliCode}}&lt;/span&gt; am i missing something ?
has comment: http://stackoverflow.com/comment/44270894
has answer: http://stackoverflow.com/a/27937090
has answer: http://stackoverflow.com/a/27937051
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27937051
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44270767

http://stackoverflow.com/comment/44179138
has text: At the first glance, your code should work. Where does `usageTime` come from? Have you simplified the code here?
comment on: http://stackoverflow.com/q/27888704
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44652122
score: 0
comment on: http://stackoverflow.com/q/27860689
type: QuestionComment
type: Comment
has text: I just have to add a ***<clipPath>***, this brilliant answer clear everything [Simple way to use existing object as a clipping path?](http://stackoverflow.com/questions/23691618/simple-way-to-use-existing-object-as-a-clipping-path) Problem solved

http://stackoverflow.com/a/54430602
has comment: http://stackoverflow.com/comment/131104336
upvote count: 6
downvote count: 0
has body: I know this is old but it is in the top results when searching for something along these lines. So for those that land here looking for a solution to this, here you go: (note that this only works well if you know the file is small. Otherwise for larger files refer to the answer provided by Dieterg) const fs = require('fs'); const crypto = require('crypto'); function fileHashSync(filePath){ var fileData; try{ fileData = fs.readFileSync(filePath, 'utf8'); } catch(err){ if(err.code === 'ENOENT') return console.error('File does not exist. Error: ', err); return console.error('Error: ', err); } return crypto.createHash('sha1').update(fileData, 'utf8').digest('hex'); }
answers question: http://stackoverflow.com/q/27943166
type: Answer
score: 6

http://stackoverflow.com/a/27822876
upvote count: 3
answers question: http://stackoverflow.com/q/27822828
score: 3
type: AcceptedAnswer
has body: This is quite a broad question but you may find some useful information here https://developers.google.com/analytics/resources/concepts/gaConceptsTrackingOverview It shows you what the code actually does as well as describing all of the parameters.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27822828
type: Answer
has comment: http://stackoverflow.com/comment/44054153
has comment: http://stackoverflow.com/comment/44054018

http://stackoverflow.com/q/27863573
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27864420
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/27848095
downvote count: 0
has answer: http://stackoverflow.com/a/27864420
has title: Using the AngularJS require option to call into another directive
tagged with: angularjs-directive
type: AnsweredQuestion
score: 1
type: Question
has body: I was just reading here about accessing one directive's controller from within another directive via the require option: http://jasonmore.net/angular-js-directives-difference-controller-link/ The directive droppable and dashboard declarations in on my view - on two different divs: &lt;div class="wrapper wrapper-content animated fadeInRight"&gt; &lt;div class="row"&gt; &lt;div class="col-lg-12" data-droppable drop="handleDrop"&gt; &lt;div id="dash" dashboard="dashboardOptions" class="dashboard-container"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; However I can't seem to get it to work. My dashboardCtrl param below is NULL. Here in my droppable directive, I use the REQUIRE option: .directive('droppable', function () { return { scope: { drop: '&amp;', }, //****************** dashboard directive is optionally requested ************ require: '?dashboard', link: function (scope, element, attributes, dashboardCtrl) { el.addEventListener('drop', function (e) { if (e.preventDefault) { e.preventDefault(); } this.classList.remove('over'); var item = document.getElementById(e.dataTransfer.getData('Text')); this.appendChild(item.cloneNode(true)); // *** CALL INTO THE dashboardCtrl controller *** dashboardCtrl.addWidgetInternal(); return false; }, false); } } }); and the dashboard directive : angular.module('ui.dashboard') .directive('dashboard', ['WidgetModel', 'WidgetDefCollection', '$modal', 'DashboardState', '$log', function (WidgetModel, WidgetDefCollection, $modal, DashboardState, $log) { return { restrict: 'A', templateUrl: function (element, attr) { return attr.templateUrl ? attr.templateUrl : 'app/shared/template/dashboard.html'; }, scope: true, controller: ['$scope', '$attrs', function (scope, attrs) { // ommitted for brevity }], link: function (scope) { scope.addWidgetInternal = function (event, widgetDef) { event.preventDefault(); scope.addWidget(widgetDef); }; }; } }]); However, my dashboardCtrl parameter is NULL. Please help me to figure out how to use require. I act…

cocos2d-x
tags question: http://stackoverflow.com/q/27865387
tag name: cocos2d-x
type: Tag

http://stackoverflow.com/q/27846405
tagged with: javascript
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44098587
score: 0
has body: I have requirement to show progress bar image on submission of any server-side action. I want to show this image till I get the response back from the server. While displaying of this loading image user not allowed making any actions on that page i.e. page will be disabled. Can anybody know how I can achieve this?
tagged with: c#-4.0
has comment: http://stackoverflow.com/comment/44096712
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44097547
has title: How to show progress bar image on server-side submit of action through ASP.Net?
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44097113
has comment: http://stackoverflow.com/comment/44096695

http://stackoverflow.com/a/27862190
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27862073
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/27862073
downvote count: 1
has body: Well, it seems like asking improves the possibility of finding out the correct answer for a problem (hehehe). Here's my solution: // ==UserScript== // @name Sound Alert // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @grant none // ==/UserScript== var player = document.createElement('audio'); player.src = 'https://dl.dropbox.com/u/7079101/coin.mp3'; player.preload = 'auto'; for (var i = 0; i &lt;= 10; i++) { if (i === 10) { // Play a sound when i === 10 player.play(); } else { console.log('Not yet!'); } }
score: 7

http://stackoverflow.com/comment/44140212
type: Comment
comment on: http://stackoverflow.com/a/27866612
score: 0
type: AnswerComment
has text: Thanks for the suggestions. I'm trying to avoid loading everything in full into the document, as I have 50 different bits of text, each at around 1000 words. That'd be a mess. (I'm also not sure, but don't think, I could format using your option?) As for the ajax, I don't know anything about it at all - is there a good resource to reference for this kind of issue?

http://stackoverflow.com/comment/44356333
score: 0
comment on: http://stackoverflow.com/a/27968745
type: Comment
type: AnswerComment
has text: I understand it's a bad idea to load it synchronously. However I still get the undefined error when changing my OData call to be asynchronous even with your defaultValue: [] suggestion. I have used typeof to determine the type of getHoursData() and it is an object, not undefined which I did not expect.

http://stackoverflow.com/comment/44053104
type: AnswerComment
comment on: http://stackoverflow.com/a/27823429
type: Comment
has text: Could you first clarify what `.destroy` is in the HTML, and how your current request to `/delete/...` is made?
score: 0

http://stackoverflow.com/comment/44194365
comment on: http://stackoverflow.com/a/27864887
type: Comment
has text: Thanks for your help. I moved the script tag to the end of document. However, now the popup doesn't appear at all.
score: 0
type: AnswerComment

d3.js
tags question: http://stackoverflow.com/q/27825943
tags question: http://stackoverflow.com/q/27854302
tags question: http://stackoverflow.com/q/27920920
tags question: http://stackoverflow.com/q/27849643
tags question: http://stackoverflow.com/q/27904291
tags question: http://stackoverflow.com/q/27820109
tags question: http://stackoverflow.com/q/27806132
tags question: http://stackoverflow.com/q/27894500
tags question: http://stackoverflow.com/q/27883455
tags question: http://stackoverflow.com/q/27813492
tags question: http://stackoverflow.com/q/27837713
tags question: http://stackoverflow.com/q/27827981
tags question: http://stackoverflow.com/q/27829172
tags question: http://stackoverflow.com/q/27880534
tags question: http://stackoverflow.com/q/27948264
tags question: http://stackoverflow.com/q/27914624
tags question: http://stackoverflow.com/q/27867043
tags question: http://stackoverflow.com/q/27947225
tags question: http://stackoverflow.com/q/27823666
tags question: http://stackoverflow.com/q/27838938
tags question: http://stackoverflow.com/q/27864091
tags question: http://stackoverflow.com/q/27844884
tags question: http://stackoverflow.com/q/27961196
tags question: http://stackoverflow.com/q/27925801
tags question: http://stackoverflow.com/q/27845161
tags question: http://stackoverflow.com/q/27804203
tags question: http://stackoverflow.com/q/27895192
tags question: http://stackoverflow.com/q/27938655
type: Tag
tags question: http://stackoverflow.com/q/27930803
tags question: http://stackoverflow.com/q/27912763
tags question: http://stackoverflow.com/q/27863082
tags question: http://stackoverflow.com/q/27859658
tags question: http://stackoverflow.com/q/27930405
tags question: http://stackoverflow.com/q/27873631
tags question: http://stackoverflow.com/q/27862800
tags question: http://stackoverflow.com/q/27829932
tags question: http://stackoverflow.com/q/27906686
tags question: http://stackoverflow.com/q/27818936
tags question: http://stackoverflow.com/q/27828848
tags question: http://stackoverflow.com/q/27916836
tags question: http://stackoverflow.com/q/27821895
tags question: http://stackoverflow.com/q/27821389
tags question: http://stackoverflow.com/q/27821510
tags question: http://stackoverflow.com/q/27948023
tags question: http://stackoverflow.com/q/27841944
tags question: http://stackoverflow.com/q/27936632
tags question: http://stackoverflow.com/q/27836622
tags question: http://stackoverflow.com/q/27895182
tags question: http://stackoverflow.com/q/27887960
tags question: http://stackoverflow.com/q/27891225
tags question: http://stackoverflow.com/q/27951351
tags question: http://stackoverflow.com/q/27893711
tag name: d3.js
tags question: http://stackoverflow.com/q/27931067
tags question: http://stackoverflow.com/q/27921894
tags question: http://stackoverflow.com/q/27883790
tags question: http://stackoverflow.com/q/27913266
tags question: http://stackoverflow.com/q/27931261
tags question: http://stackoverflow.com/q/27951560
tags question: http://stackoverflow.com/q/27882796
tags question: http://stackoverflow.com/q/27926059
tags question: http://stackoverflow.com/q/27892517
tags question: http://stackoverflow.com/q/27846722
tags question: http://stackoverflow.com/q/27911547
tags question: http://stackoverflow.com/q/27949820
tags question: http://stackoverflow.com/q/27942575
tags question: http://stackoverflow.com/q/27837141
tags question: http://stackoverflow.com/q/27927588
tags question: http://stackoverflow.com/q/27934397
tags question: http://stackoverflow.com/q/27963811
tags question: http://stackoverflow.com/q/27860849
tags question: http://stackoverflow.com/q/27900260
tags question: http://stackoverflow.com/q/27946147
tags question: http://stackoverflow.com/q/27948312
tags question: http://stackoverflow.com/q/27905790
tags question: http://stackoverflow.com/q/27856226
tags question: http://stackoverflow.com/q/27938902
tags question: http://stackoverflow.com/q/27892200
tags question: http://stackoverflow.com/q/27844633

http://stackoverflow.com/comment/44271756
type: Comment
comment on: http://stackoverflow.com/q/27937445
has text: the value of the td is from an input text i show all inputted data in a table, using the id. I want to use those value to be stored in database...are you sure this is feasible because the answer below says otherwise
score: 0
type: QuestionComment

http://stackoverflow.com/q/27848934
upvote count: 4
has answer: http://stackoverflow.com/a/43294795
answer count: 2
downvote count: 0
has body: I upload images to server with gridfs in my sails.js Application. My uploading codes are as follows upload: function (req, res) { req.file('avatar') .upload({ adapter: require('skipper-gridfs'), uri: 'mongodb://localhost:27017/dbname.images' }, function whenDone(err, uploadedFiles) { if (err) return res.negotiate(err); else return res.ok({ files: uploadedFiles, textParams: req.params.all() }); }); } I get the following response from this... { "files": [ { "fd": "2d8910a0-8ca2-4df1-9930-6ddd721a0416.jpg", "size": 172883, "type": "image/jpeg", "filename": "Photo on 12-20-14 at 9.53 PM.jpg", "status": "bufferingOrWriting", "field": "avatar", "extra": { "fileId": "54aee6ced4a0e88f0dc9025f", "fd": "2d8910a0-8ca2-4df1-9930-6ddd721a0416.jpg", "dirname": "." } } ], "textParams": {} } My question is , if I need to download the uploaded file above , what shall I do ? I got the following code in the internet for downloading task but this does not make much sense to me. Basically I want the download url of the uploaded image that I can use that url in Mobile App to show image. var blobAdapter = require('skipper-gridfs')({ uri: 'mongodb://localhost:27017/dbname.images' }); blobAdapter.read(filename, callback); Can anybody help me on this ? Thanks in advance.
favorite count: 0
type: UnansweredQuestion
tagged with: gridfs
tagged with: node.js
type: Question
tagged with: mongodb
tagged with: sails.js
has answer: http://stackoverflow.com/a/27868171
tagged with: javascript
score: 4
has title: Download image from skipper-gridfs in Sails.js

http://stackoverflow.com/q/27962471
has answer: http://stackoverflow.com/a/60481697
linked to: http://stackoverflow.com/q/3698200
possible better answer: http://stackoverflow.com/a/58754469
tagged with: cross-domain
tagged with: javascript
tagged with: jquery
has body: I have a cross-domain iframe inside one of my page, its content should use the window.parent.postMessage method to notify it is rendered to the containing page (so it can adjust iframe's height to its content). It works quite well, but only once, if I start clicking in the iframe and browsing different pages, the load event does not get triggered anymore even if all the pages in the iframe contains the same JavaScript code (see below). here's the container's code let's say container.js: function onMessage(jqEvent) { if (jqEvent.originalEvent.data.iframe) { var iframeContentHeight = jqEvent.originalEvent.data.iframe; $('iframe').height(iframeContentHeight + 300); } } $(window).on('message.socialPanel', onMessage); and here is the code inside the iframe (it is in an external file, let's call it iframe.js): $(window).on('load', function () { var height = $('html').height(); window.parent.postMessage({'iframe': height}, '*'); });
favorite count: 0
upvote count: 3
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27963126
has answer: http://stackoverflow.com/a/58754469
accepted answer: http://stackoverflow.com/a/27963126
has title: onload event inside iframe only triggers once
downvote count: 0
tagged with: iframe
type: Question
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/27861118
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44124839
tagged with: javascript
tagged with: browserify
downvote count: 0
tagged with: web
tagged with: jquery
favorite count: 0
has body: For module manangement tools such as requirejs or browserify, jquery should be loaded using require function. Moreover, requirejs or browserify provides bundle and minification, which can convert all dependent modules into one minified js file. It looks quite simple. However, converting everything into one big file will lose the advantage of CDN. Previously, browser can make use of the cache of public sites which hosts jQuery CDN, but it will not work for the bundle and minification approach.. Is it good practice to include all third-party library into the minified code? If not, what is a better way?
has comment: http://stackoverflow.com/comment/44127610
has comment: http://stackoverflow.com/comment/44127755
type: UnansweredQuestion
tagged with: requirejs
answer count: 0
score: 1
has title: Should I include jQuery into the minified code with requireJS or browserify?

http://stackoverflow.com/q/27845041
has answer: http://stackoverflow.com/a/27845201
type: AnsweredQuestion
upvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/27845201
type: Question
has comment: http://stackoverflow.com/comment/44093852
tagged with: javascript
score: -1
has title: Dynamically add values using Javascript
has comment: http://stackoverflow.com/comment/44094161
answer count: 2
accepted answer: http://stackoverflow.com/a/27845418
downvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27845418
has body: I'm trying to dynamically add values using a for loop in JavaScript. I can't figure out how to compare each value in my new Array named section2answers. I created two arrays. One that holds all the values I am comparing which is called radios. And another array that is empty to hold the values that pass the first arrays condition. Then I have two for loops. One that goes through all the possible answers and determines which one of those are true for being checked. And another for loop that goes through the values that passed the condition in the first loop. This loop then checks each value in the new loop to determine if they match a correct answer and then assigns a score value to be output to an input field. I have a couple problems I can see. My first for loop is not properly comparing each element in the array to my condition. My second problem is my second for loop is only using the element that was initially clicked on instead of comparing to each of the if conditions. And as with the first loop, I don't think it is comparing each value in the loop the the set of if conditions. Also, if the user decides to change their answer I can't figure out a way to subtract from the total value. I would like to create something that runs these loops every time a radio button is clicked to give the new total. Code: HTML 1. How long is the battery life on the PicoPix PPX 2340 Traveller? Two hours 90 minutes One hour Five hours 2. What size is the ladies & gents Eternity Summer? 50ml 75ml 125ml 100ml JS: $('input[type="radio"]').on('change', function () { var section2a1 = document.getElementById('no1-two-hours'); var section2a2 = document.getElementById('no2-100ml'); var section2a3 = document.getElementById('no3-almond'); var section2a4 = document.getElementById('no4-2years'); var section2a5 = document.getElementById('no5-reveal'); var section2a6 = document.getElementById('no6-mild'); var section2a7 = document.getElementById('no7-60'); var section2a8 = document.getElementByI…

http://stackoverflow.com/comment/44274031
has text: @Walt - I would raise another question for this, and make sure it's clear what you want it to be able to do. When you write out the code "the long way" it's relatively easy to just switch around the way it works. But if you want something short and compact the way to write that will depend on the specific requirements, each different requirement may result in quite different short code. Generalised/easy to modify code is generally long/verbose where as code for very specific scenarios can be made much shorter.
type: Comment
comment on: http://stackoverflow.com/a/27932200
score: 0
type: AnswerComment

http://stackoverflow.com/q/27857354
score: 0
has answer: http://stackoverflow.com/a/27857471
answer count: 3
has answer: http://stackoverflow.com/a/27857469
has answer: http://stackoverflow.com/a/27857673
possible better answer: http://stackoverflow.com/a/27857471
has title: how to remove bug character in html using jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44117695
accepted answer: http://stackoverflow.com/a/27857469
type: Question
has body: I have a bug in my code and i try to remove it using jquery. Some code: s Test and etc etc etc.... I want to use jquery to remove the s (if exist...in some cases not) I've tried var cont = $('#content').html(); $('#content').html(cont.replace('/s\s(.*)/','$1')); Seams that the code above is not working...some sugestions ?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44117657

http://stackoverflow.com/q/27806132
has comment: http://stackoverflow.com/comment/44021528
has comment: http://stackoverflow.com/comment/44028457
accepted answer: http://stackoverflow.com/a/27810976
tagged with: d3.js
tagged with: chess
has body: I would like to draw a chess board in D3: I would be satisfied with just being able to draw the initial game position (as above). It may be the case that one does not need image files for king, queen, knight, etc. (there are 12 distinct pieces) since they are all part of Unicode as codepoints 2654-265F: The Unicode characters appear in any modern browser: ♔ ♕ ♖ ♗ ♘ ♙ ♚ ♛ ♜ ♝ ♞ ♟ Unicode chess symbols on Wikipedia: here Python script to display chess board in a terminal using Unicode characters: here. Its result: Any pointers or help would be much appreciated.
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/44028344
score: 0
downvote count: 3
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27810976
tagged with: javascript
possible better answer: http://stackoverflow.com/a/31010382
has answer: http://stackoverflow.com/a/31010382
has title: How to draw a chess board in D3?
has comment: http://stackoverflow.com/comment/44029059
has comment: http://stackoverflow.com/comment/44021396
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/q/27925163
upvote count: 2
has body: I am trying to use Geolocation to automatically fill in the address fields for my users. Where I am struggling is on (Mailing Address 1:) & (Physical Address 1:) As of now it will show the user addresses once they start typing but when they select and make their choice for their address I do not want the entire address plus city state and zipcode on Mailing Address 1:. I want it show Street Number and Street Address then fill in the other fields (city, state, zip) leaving Mailing Address 2: blank in case they have an apartment or suite. Then if you select that the physical and mailing addresses are the same obviously I would like it to fill in exactly like above. If the addresses are not the same I would like it to follow the same process as above. Any help would be greatly appreciated! var placeSearch, autocomplete, autocomplete2; var componentForm = { route: 'long_name', locality: 'long_name', administrative_area_level_1: 'short_name', postal_code: 'short_name' }; var componentForm2 = { route2: 'long_name', locality2: 'long_name', administrative_area_level_12: 'short_name', postal_code2: 'short_name' }; function initialize() { // Create the autocomplete object, restricting the search // to geographical location types. autocomplete = new google.maps.places.Autocomplete( /** @type {HTMLInputElement} */ (document.getElementById('autocomplete')), { types: ['geocode'] }); autocomplete2 = new google.maps.places.Autocomplete( /** @type {HTMLInputElement} */ (document.getElementById('autocomplete2')), { types: ['geocode'] }); // When the user selects an address from the dropdown, // populate the address fields in the form. google.maps.event.addListener(autocomplete, 'place_changed', function() { fillInAddress(); }); google.maps.event.addListener(autocomplete2, 'place_changed', function() { fillInAddress2(); }); } // [START region_fillform] function fillInAddress() { // Get the place details from the autocomplete object. var place = autocomplete.getPlace(); for (var compon…
accepted answer: http://stackoverflow.com/a/27969115
has title: Automatic Address Fill In Form Using Geolocation
possible better answer: http://stackoverflow.com/a/42501387
type: AnsweredQuestion
tagged with: geolocation
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27969115
score: 2
favorite count: 0
has answer: http://stackoverflow.com/a/42501387

http://stackoverflow.com/comment/44283154
type: Comment
score: 0
has text: Thanks adeneo. it works but i can get that for 1/31/2015. it says NAN Saturday
comment on: http://stackoverflow.com/a/27943697
type: AnswerComment

http://stackoverflow.com/comment/44223758
type: QuestionComment
has text: Too complicated. Assume a surrounding element of `html` and the ability for `data-spellcheck="false"` to exist on any element.
score: 0
comment on: http://stackoverflow.com/q/27911772
type: Comment

http://stackoverflow.com/comment/44118930
has text: @user2768984 — Can you add the *output* from the server side function.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27857214
type: Comment

http://stackoverflow.com/comment/44109901
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27852817
has text: I tested my servlet on browser using this URL: http://localhost:8080/TrackNYP/TrackNYPServlet?action=GetAllMrtPop&time=8:00. I tried to changed the Data to time directly as suggested by Todd but I am still getting the same error message
score: 0

http://stackoverflow.com/comment/44097212
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27846377
has text: yeah.. @informatik thank you... I tried to redirect using an event onclick of button... but only jsp pages can be retrieved not servlet

http://stackoverflow.com/q/27933006
downvote count: 2
accepted answer: http://stackoverflow.com/a/27950988
answer count: 1
tagged with: kendo-combobox
has body: I been trying to implement this without success. Here is my scenario: I need to implement a kendo Combobox with the text enable, so you can input some text and it will find any matching record, but, also, if I click the drop down arrow, it shows a grid inside it with all matching records (partial search) and it shall allow filtering in the column's header. I have seen sample, for DropDownList, with a grid inside but you are not able to type a text in the text box. Has anyone have a sample on how to implement this? thanks in advance for your replies Ron
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27950988
favorite count: 0
tagged with: kendo-ui
type: Question
score: -2
has title: Kendo UI combobox with filterable multi columns

http://stackoverflow.com/comment/44169701
score: 0
type: Comment
type: QuestionComment
has text: why not call a function when the element is removed that modifies the timer?
comment on: http://stackoverflow.com/q/27883455

http://stackoverflow.com/comment/44082248
comment on: http://stackoverflow.com/q/27839096
type: Comment
type: QuestionComment
has text: One approach would be to loop over the characters in the input string, check if each one is a consonant or not, then do the right thing. By the way, could you give your question a title saying what it's actually about?
score: 0

http://stackoverflow.com/comment/44266251
comment on: http://stackoverflow.com/q/27934166
has text: Please see, might help: http://stackoverflow.com/a/5000993/771848
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44178211
comment on: http://stackoverflow.com/a/27888648
type: Comment
score: 0
has text: I have now indented my code. I added the ; but it still says undefined for addtocart.
type: AnswerComment

http://stackoverflow.com/comment/44045089
type: AnswerComment
score: 0
has text: you're welcome :) Perhaps you can use findOne().BusinessContact
type: Comment
comment on: http://stackoverflow.com/a/27818370

http://stackoverflow.com/a/27844231
has body: Try this $(function() { // assuming jQuery is loaded before this block $("#whereIWantMyAds").html(dchtml.join("\n")); });
has comment: http://stackoverflow.com/comment/44093078
has comment: http://stackoverflow.com/comment/44229254
has comment: http://stackoverflow.com/comment/44092428
has comment: http://stackoverflow.com/comment/44131500
downvote count: 0
answers question: http://stackoverflow.com/q/27844099
type: Answer
has comment: http://stackoverflow.com/comment/44131541
has comment: http://stackoverflow.com/comment/44226104
score: 1
upvote count: 1

http://stackoverflow.com/q/27889262
tagged with: google-authentication
favorite count: 0
answer count: 0
upvote count: 2
tagged with: google-api
type: UnansweredQuestion
tagged with: google-app-engine
score: 2
has comment: http://stackoverflow.com/comment/44182587
tagged with: google-cloud-storage
type: Question
has comment: http://stackoverflow.com/comment/44184480
has body: I want to use GCS to store pictures taken by users in my Cordova app. I have a first major issue : I can't figure out how to use GCS properly for that purpose. Every usable example in the documentation ( here or there for the auth process alone ) needs to give credentials from a Google account on the client side to be able to use the JSON API. I don't want that. Basically I want every people connected to my app to be able to upload freely to the wanted bucket. I thought about issuing tokens for every user of my app, etc... But first I need to be able to upload something anyhow, right ? My current status is this : function init() { gapi.client.setApiKey(apiKey); gapi.auth.authorize({ client_id: clientId, scope: 'https://www.googleapis.com/auth/devstorage.full_control', immediate: true }, initializeApi); } function initializeApi() { gapi.client.load('storage', 'v1').then(makeRequest); } function makeRequest() { var request = gapi.client.storage.buckets.list({ 'project': PROJECT }); request.then(function(response) { console.log(response); }, function(reason) { console.log('Error: ' + reason.result.error.message); }); } And well, the log just gives me the error : "Error: Login Required" along with a 401 unauthorized on https://content.googleapis.com/storage/v1/b?project=PROJECT&amp;key=apiKey Well, since I provided everything I had, I guess I need some sort of authentication token. I simply didn't find anywhere how to do that. The only lead I have would be this : service accounts and it absolutely doesn't sound like something fit for client side code. Thanks ahead !
downvote count: 0
has title: Google Cloud Storage Javascript anonymous upload
tagged with: javascript
has comment: http://stackoverflow.com/comment/44184840
has comment: http://stackoverflow.com/comment/44186390

http://stackoverflow.com/q/27844979
has body: I'm doing a real time application with jxcore (nodejs for Plesk Panel) and I'm new on nodejs. Application file index.js is running on domain mydomain.it: var socket = require( 'socket.io' ); var express = require( 'express' ); var http = require( 'http' ); var app = express(); var server = http.createServer( app ); var io = socket.listen( server ); io.sockets.on( 'connection', function( client ) { client.on( 'message', function( data ) { io.sockets.emit( 'message', { name:data.name, surname:data.surname }); }); }); server.listen( 8080 ); On the same domain there is a client page, for example mydomain.it/app, that includes: &lt;script src="../node/js/bootstrap.js"&gt;&lt;/script&gt; &lt;script src="../node/js/node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.js"&gt;&lt;/script&gt; &lt;script src="../node/js/nodeClient.js"&gt;&lt;/script&gt; This is my nodeClient.js file: var socket = io.connect( 'http://mydomain.it:8080' ); socket.on( 'message', function( data ) { var obj = { name:data.name, surname:data.surname } // do something }); Now, I need to connect to the websocket from an Android app, installed on several devices. So there is a domain that contain a nodejs server and a client. And other remote android devices (with an html5 app, developed with jquery mobile). But I can't connect to the socket, it returns errors (ERR_CONNECTION_TIMED_OUT on chrome browser). From the client page on the domain I can connect to the socket only if I change var socket = io.connect( 'http://mydomain.it:8080' ); to var socket = io.connect( 'http://127.0.0.1:8080' ); But of course I can't connect to the server from remote devices using localhost. Socket.io is installed only on mydomain.it Is it possible to realize this kind of application? Thanks
type: Question
tagged with: jxcore
has comment: http://stackoverflow.com/comment/44120987
has title: Socket.io connection from remote
has comment: http://stackoverflow.com/comment/44119063
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: android
tagged with: node.js
has comment: http://stackoverflow.com/comment/44120874
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46640366
tagged with: socket.io

http://stackoverflow.com/comment/44190807
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27894763
score: 1
has text: @user4035 ``return`` shows a popup when passed a ``String`` inside the ``onbeforeunload`` event in the ``window``. Reference: [MDN window.onbeforeunload](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers.onbeforeunload)

http://stackoverflow.com/comment/44150168
comment on: http://stackoverflow.com/a/27873672
score: 0
type: AnswerComment
has text: @SalisTariq have you checked my answer and fiddle..does it helpful to you?
type: Comment

http://stackoverflow.com/comment/44137325
type: AnswerComment
has text: Thank you, so at this point i have to do a href to my other page. window.location.href = Routing.generate('pspiess_letsplay_customer_new')
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27866462

http://stackoverflow.com/q/27882773
accepted answer: http://stackoverflow.com/a/28224860
type: AnsweredQuestion
score: 1
has body: Seems like bind() is part of the Web Components spec, which Polymer extends for various reasons with Node.bind(). Here's docs on bindProperty(). Is this simply the internal implementation/polyfill for bind()? And thus should developers thus be using bind() rather than bindProperty()?
downvote count: 1
type: Question
tagged with: polymer
has title: What's the difference between bind() and bindProperty() in PolymerJS?
has answer: http://stackoverflow.com/a/28224860
tagged with: javascript
answer count: 1
favorite count: 0
tagged with: data-binding
upvote count: 2

http://stackoverflow.com/q/27933490
has comment: http://stackoverflow.com/comment/44264669
has answer: http://stackoverflow.com/a/27933515
has body: I have an algo that is essentially =1-(1-50%)*(1-24%) the 50% is the probability and the 24% is the unresolved amount. 1 is the starting position of an array - (1-50%) or .5 * (1-24%) or .76. The answer comes out to .62 which I run the value through an array and match the next closest value to 62%. What I want to know is how in javascript do you write 1-(1-50%)*(1-24%) and have it give you a value. Right now is returns NaN. Any help is much appreciated. I have created this algo in excel and it works great but need to figure out how to write this in javascript. Here is a fiddle of what I am trying to do var colicEnd = 1 - (1 - probability50) * (1 - unknown); http://jsfiddle.net/jessemfulton/ar4sufaj/4/ Right now the script runs through and takes the value of the second dropdown and minuses it from the first to get a number. I then take that number and run it through an array to get the unknown value. The next part I want to create a probability for 50% So I would take the first possibility of the array which is 1 and minus the value of 50% or .5 and then times it by the unknown value to get the percentage which is this 1-(1-50%)*(1-24%). So in the fiddle if you select 2 from the first dropdown and 6 from the second you are left over with 4. Take that number and run it through the wessel_array to give you a value of 23.6% so I round up to 24%. I then need to take that value and add it the the algo above to get the 50% probability the colic will end in 7 weeks because the left over remainder of the algo above is 62% which I then have to go up to the next available number in the wessel_data and you get the week that is assigned to 64% which is 7.
answer count: 1
type: UnansweredQuestion
score: 0
type: Question
has comment: http://stackoverflow.com/comment/44264748
has title: Setting a var equal to a number in an array minus percent times another percent
has comment: http://stackoverflow.com/comment/44264664
tagged with: javascript

http://stackoverflow.com/comment/44065839
has text: It connects by "this", and, my suggestion is, remove the "this". Put the function inside the controller, and everything will be like "$scope.yourNamedFunction" or "$scope.yourAttribute". I'm still developing the ideas here, to give you a full answer.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27829809

http://stackoverflow.com/comment/44147984
type: Comment
type: QuestionComment
has text: Do you have control over the structure of the array you are using for data? If so, you can structure myArray differently to make understanding the relationships and rendering the HTML much easier.
comment on: http://stackoverflow.com/q/27872825
score: 1

http://stackoverflow.com/comment/44251535
comment on: http://stackoverflow.com/q/27914450
score: 0
type: Comment
type: QuestionComment
has text: @KevinB See I though by putting the JS at the bottom of the page outside of the div `dount5` it would render the graph then pull through the div. The other script snippets I only added to test why jquery wanst working at all which led to me noticing that jQuery was not loading in the Network Tab at all for donut1.php but was for donut5.php which had be going crazy as they are identical really.

http://stackoverflow.com/q/27934720
has answer: http://stackoverflow.com/a/27935841
downvote count: 0
possible better answer: http://stackoverflow.com/a/30561396
has body: I wanted to implement the overlay effect like Atmospherejs.com by iron-router when overlay has the specific route (https://atmospherejs.com/?q=). Does anyone have any idea?
tagged with: meteor
has title: Meteor iron-router set route for overlay
favorite count: 0
tagged with: iron-router
upvote count: 2
tagged with: overlay
tagged with: css
has comment: http://stackoverflow.com/comment/47376948
accepted answer: http://stackoverflow.com/a/27935841
score: 2
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47082635
has answer: http://stackoverflow.com/a/30561396

http://stackoverflow.com/q/27829407
tagged with: youtube
tagged with: embed
score: 3
tagged with: responsive-design
upvote count: 3
type: Question
has title: mobile-first method to deal with size of embedded video players?
tagged with: javascript
tagged with: jwplayer
has answer: http://stackoverflow.com/a/27829849
has body: I see a number of ways to deal with layouts, and interchange, etc to deal with image sizes, but I haven't come across any info about video player size. For instance, using viewbix, voo, jw, or any other js served video player, the size of the player is built into the embed. It also has an associated image file for the poster frame. Just wondering how other folks approach this. Do you make multiple versions of the embed and image for various breakpoint sizes? Does it matter if the embed is too big? Not sure if that actually affects streaming speed or not, or if the video itself is technically doing anything until play is pressed. Image would still be an issue though as serving a full width desktop size image on a 320px screen seems a waste. What's the smart way to handle this globally? thx
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/27894023
score: 1
has body: One option would be converting the video file to a gif. One website that I have used before is https://cloudconvert.com/. Then in the css write background-image: url("testgif.gif"); background-repeat: repeat;
type: Answer
answers question: http://stackoverflow.com/q/27880191
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/27840390
type: AnsweredQuestion
tagged with: java
has title: How to get value of SelectBox when using AppEngine in Java, JavaScript and HTML
type: Question
has body: I am trying to create a way of filtering data that is stored within the datastore. The method I am using for this is a mixture of HTML, Javascript and Java Servlets. A form is made that allows data that is input into the Web Application to be sent to the Java Servlet. The Servlet then does the required actions and sends the user back to the page with the updated data. My problem is I have to use a SelectBox within this form that allows the user to select the atribute they wish to filter by, e.g. title, author. When the submit button is pressed, the value of the SelectBox is not sent as a parameter. This means a ERROR 500 appears as there isn't enough parameters to perform the function. I need to:- Get the value of the SelectBox. Pass it to the function with the parameter value in a text field. (Almost Completed) Set the value of idvBook to equal the List that is sent back to the Webb Application. Firstly, this is how I am creating the form with the SelectBox, TextInput and ButonInput:- Filter the DataStore To view individual records, select the attribute you'd like to filter by and enter the value you'd like to find. Click the button to generate the table based on your search criteria. Attribute Select Attribute ID Title Author Publisher Value Book ID Title Description Author Publisher Publish Date Remove Book <% for (Book book : idvBook) { %> <%=book.getId()%> <%=book.getTitle()%> <%=book.getDescription()%> <%=book.getAuthor()%> <%=book.getPublisher()%> <%=book.getPublishDate()%> <a class="done" href="/done?id=<%=book.getId()%>">Remove <% } %> Once this has been made, it is then placed in the HTML table located below the form (shown in the code above). This sends the parameters to this servlet:- public class ServletGetBooks extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); resp.getWriter().println("Hello, world"); String attribute = request.getParameter("attributeSel…
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27842197
tagged with: google-app-engine
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27842197

http://stackoverflow.com/comment/44089482
comment on: http://stackoverflow.com/q/27842862
score: 3
type: QuestionComment
has text: Please share what you have tried.
type: Comment

http://stackoverflow.com/comment/44098061
has text: Name is an attribute of the JSON objects in the devices array. You want `{{robots.devices.name}}`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27847057

http://stackoverflow.com/q/27828360
has comment: http://stackoverflow.com/comment/44062724
has answer: http://stackoverflow.com/a/27828494
has comment: http://stackoverflow.com/comment/44063167
linked to: http://stackoverflow.com/q/15393935
has comment: http://stackoverflow.com/comment/44062678
has comment: http://stackoverflow.com/comment/44062708
has title: Why does this "IF" always execute even the condition is false?
upvote count: 1
has body: This is my code: $('.btn-back').off('click').on('click', function (event) { var valid = carInfo.validate(); if (valid) { event.preventDefault(); } }); the sentence event.preventDefault() always executes no matter what value valid is. When I change the code to $('.btn-back').off('click').on('click', function (event) { var valid = carInfo.validate(); if (valid) { event.preventDefault(); } else { } }); it runs the way it should be. Maybe it's something related to Automatic Semicolon Insertion (ASI).
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44062859
tagged with: validation
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44063576
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44062757
type: UnansweredQuestion

http://stackoverflow.com/q/27871931
score: 0
tagged with: animation
answer count: 1
tagged with: polymer
has answer: http://stackoverflow.com/a/27873564
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27873564
tagged with: javascript
has body: My Polymer application animates an object's top from an arbitrary position to 0. It's using Velocity to do that right now, since the way to animate from any current state to a new state is very obvious. Is it possible (or even proper) to do with Polymer's core-animation? All of the demos show fixed values at each keyframe.
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: velocity.js
has title: Animate from current value with Polymer core-animation

http://stackoverflow.com/comment/44244804
comment on: http://stackoverflow.com/a/27923661
type: AnswerComment
has text: `innerText` isn't a valid property.
score: 0
type: Comment

http://stackoverflow.com/q/27856177
has body: I have a problem with ajax delete in codeigniter. I want to delete without refreshing page Here is my controller function delete($id_post='') { $hapus=$this-&gt;home_model-&gt;delete($id_post); if($hapus){ echo "true"; } else { echo "error"; } } here is my model: function delete($id_post='') { $sql = "DELETE FROM post WHERE id_post=?"; return $this-&gt;db-&gt;query($sql,array($id_post)); } Here is my view and javascript: &lt;?php foreach($news as $data):?&gt; &lt;div id="row"&gt; &lt;?php echo $data['news']?&gt; Post by: &lt;?php echo ['username']?&gt; &lt;button onClick="return confirm('Sure to delete?')" class="btn-danger btn-xs delete" id="&lt;?php echo $data['id_post']?&gt;"&gt;delete&lt;/button&gt; &lt;/div&gt; &lt;?endforeach;?&gt; &lt;script languge="javascript" type="text/javascript"&gt; $(document).ready(function(){ // added $(".delete").click(function(){ //var id_post = this.id; var btn = this; e.preventDefault(); $.ajax({ type: "POST", url: "&lt;?php echo base_url()?&gt;delete", cache: false, data: "id_post="+$(this), success: function(reaksi){ if (reaksi=="true"){ alert('Success delete'); } else { alert('failed'); } } }); return false }); }); // added &lt;/script&gt; When i click delete, ajax not even trigerred. Any answer?
accepted answer: http://stackoverflow.com/a/27857140
has answer: http://stackoverflow.com/a/27856554
answer count: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27856554
tagged with: javascript
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/27857140
has title: Codeigniter - Delete without refreshing page
score: 0
tagged with: codeigniter

http://stackoverflow.com/q/27943169
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27943328
has comment: http://stackoverflow.com/comment/44281947
has comment: http://stackoverflow.com/comment/44281880
has comment: http://stackoverflow.com/comment/44281734
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44281753
linked to: http://stackoverflow.com/q/1773852
has comment: http://stackoverflow.com/comment/44282030
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27943328
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44281925
score: 0
has title: How to trigger unpress on a button using Javascript
has comment: http://stackoverflow.com/comment/44281899
has body: Can anybody please tell me how to trigger unpress event on Submit button I am doing a validation on button press if any of the fields are empty . i am preventing th e navigation to second page. But the Submit button remains pressed after validation and if From or To field is left empty. enter code here From: To: How do you want to travel?: Minimum Number of Hops Maximum Bus Route Availability Via Terminal Bus Stations Only Direct Routes Only Shortest Distance Submit"

http://stackoverflow.com/q/27946042
answer count: 1
favorite count: 0
tagged with: curl
tagged with: http://stackoverflow.com/tag/svg
upvote count: 1
tagged with: php
type: AnsweredQuestion
has title: Bad request when requesting svg.sencha.io with cUrl
score: 1
has answer: http://stackoverflow.com/a/27947618
has body: I'm trying to use Extjs's feature to convert graphics into images. I'm not requesting svg.sencha.io directly from the javascript, instead, I'm trying to call using cUrl in my php code. For some reasons, calling it from the php is my only option and with the cUrl code that I'm using right now, I always get "Bad request". So, my question is: Have anyone around here dealt with this situation before? Here is the code I'm trying to work with: $url = 'http://svg.sencha.io'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $file = curl_exec($ch); curl_close($ch); var_dump($file); The $_POST contains the parameters type, width, height and svg. They seem to be fine, because I runned cUrl directly from my machine and it worked. So the problem really is with cUrl and php. The var_dump($file);prints string(12) "Bad request." I would really appreciate some help, I've been stuck in this for awhile now.
type: Question
downvote count: 0
tagged with: javascript
tagged with: extjs
accepted answer: http://stackoverflow.com/a/27947618

http://stackoverflow.com/a/27942059
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/27941959
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27941959
has body: Javascript timer intervals are not guaranteed to run at exactly the time you request, due to the single threaded nature of JS. What you get is a callback that is queued up to run after the interval expires, whenever the engine is free to run it. John resig has covered this off in some depth: http://ejohn.org/blog/how-javascript-timers-work/ http://ejohn.org/blog/analyzing-timer-performance/ And from his conclusions, which is going to be important for your app: If a timer is blocked from immediately executing it will be delayed until the next possible point of execution (which will be longer than the desired delay). I don't really have a better solution for your problem, due to these fundamental issues with timers in JS, but this may at least explain what is happening.
type: Answer

http://stackoverflow.com/q/27893300
score: 1
tagged with: dom
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27899251
has body: I am creating a chrome extension for gmail, and I have seen some odd instabilities around when certain page objects load. Since I am trying to modify the GMAIL DOM (Customize it for my extension) it needs to be fully loaded before my initializer runs. My extension always initializes well before the DOM is fully loaded, so I need a way to have it poll until the DOM is fully formed to do its thing. I have tried using document.readyState to poll the document so I know when to start modifying the fully-loaded DOM, but it doesn't always work. I put into the console a printout of document.readyState polled every 100 milliseconds once the page begins to load, and I noticed that about 1/10 page loads document.readyState becomes "complete" BEFORE the DOM is fully loaded. I can tell this because I do a jQuery selector for the GMAIL compose button and it comes up empty when this occurs, and find it as expected every other time (It finds the compose button). Why would this be? Is there a better way to have my extension initialize script check to make sure the DOM is fully loaded before firing the DOM mods? EDIT-- I have the script that checks document.readyState as a script injected into the UI as a content script.
favorite count: 0
tagged with: google-chrome-extension
possible better answer: http://stackoverflow.com/a/27893834
has answer: http://stackoverflow.com/a/27893834
accepted answer: http://stackoverflow.com/a/27899251
has comment: http://stackoverflow.com/comment/44197070
upvote count: 1
tagged with: google-chrome
has title: Gmail Chrome Extension and document.readyState
tagged with: gmail
type: AnsweredQuestion

http://stackoverflow.com/comment/44293214
type: Comment
has text: Implementation questions are best asked on StackOverflow.
comment on: http://stackoverflow.com/q/27949138
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44194214
comment on: http://stackoverflow.com/a/27896384
score: 0
type: Comment
has text: Then you can get Json array as a value with using "NewDataSet" key.
type: AnswerComment

http://stackoverflow.com/comment/44181480
comment on: http://stackoverflow.com/q/27884507
has text: The first approach doesn't create an ng-bind class on the element, so I don't think it gets watched.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27866462
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Arent you missing the expose option in your routing ? pspiess_letsplay_customer_new: pattern: /admin/customer/new defaults: { _controller: pspiessLetsplayBundle:Customer:new } options: expose: true
has comment: http://stackoverflow.com/comment/44136082
answers question: http://stackoverflow.com/q/27866401
has comment: http://stackoverflow.com/comment/44137030
accepted answer of: http://stackoverflow.com/q/27866401
upvote count: 1
has comment: http://stackoverflow.com/comment/44137325
score: 1
has comment: http://stackoverflow.com/comment/44137100

http://stackoverflow.com/q/27872911
upvote count: 1
has title: How to get Parse User information from User object
favorite count: 0
tagged with: parse-platform
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44152720
type: Question
has body: Is there a direct way to get Parse User information like name, password etc from object Pointer&lt;_User>? Right now I have to do another query on User to match objectId with 'id' in object Pointer&lt;_User> to get those info. Is there a quicker way to do that since the object is of type Pointer&lt;_User>, and in Parse data, you can click on that, which would directly link to that User object (see screenshot).
tagged with: javascript

http://stackoverflow.com/comment/44127483
score: 0
type: Comment
has text: I tried with ng-show, hide and if and it still gives to me NaN, but making an inspection i can see the correct number inside the data-final-number field
comment on: http://stackoverflow.com/a/27862503
type: AnswerComment

http://stackoverflow.com/q/27812590
tagged with: angularjs
has body: I want to show 5 number of datas by default when I reload the page. But it shows blank as it is unable to select the entrylimit. I define in controller using $scope, but it doesnot working when reloading the page. dynamic_table.html &lt;div ng-controller="dashboard"&gt; &lt;section id="main-content"&gt; &lt;section class="wrapper"&gt; &lt;!-- page start--&gt; &lt;div class="row" &gt; &lt;div class="col-sm-12"&gt; &lt;section class="panel"&gt; &lt;div class="breadcrumbs"&gt;Home &gt; &lt;b&gt;Customers&lt;/b&gt;&lt;/div&gt; &lt;header class="panel-heading"&gt; Customers Table &lt;/header&gt; &lt;div class="row" style="margin: 5px 0 0 0;"&gt; &lt;div class="col-md-2"&gt; &lt;select ng-model="entryLimit" class="form-control"&gt; &lt;option&gt;5&lt;/option&gt; &lt;option&gt;10&lt;/option&gt; &lt;option&gt;20&lt;/option&gt; &lt;option&gt;50&lt;/option&gt; &lt;option&gt;100&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="col-md-3" style="float:right;"&gt; &lt;input type="text" ng-model="search" ng-change="filter()" placeholder="Search" class="form-control" /&gt; &lt;/div&gt; &lt;div class="col-md-4"&gt; &lt;h5&gt;Filtered {{ filtered.length }} of {{ totalItems}} total customers&lt;/h5&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="panel-body"&gt; &lt;div class ="row"&gt; &lt;div class="adv-table" ng-show="filteredItems &gt; 0"&gt; &lt;table class="display table table-bordered table-striped" id="dynamic-table"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;S.No&amp;nbsp;&lt;a ng-click="sort_by('user_id');"&gt;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt; &lt;th&gt;Name&amp;nbsp;&lt;a ng-click="sort_by('user_name');"&gt;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt; &lt;th&gt;Phone No.&amp;nbsp;&lt;a ng-click="sort_by('mobile');"&gt;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt; &lt;th&gt;Email ID&amp;nbsp;&lt;a ng-click="sort_by('email');"&gt;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&…
type: AnsweredQuestion
has title: ng-model for entrylimit is not working when reload the page in angularjs
has comment: http://stackoverflow.com/comment/44033457
has answer: http://stackoverflow.com/a/27816618
accepted answer: http://stackoverflow.com/a/27816618
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/q/27886591
has comment: http://stackoverflow.com/comment/44174280
has body: I want to write next condition: document.onkeydown = function(e) { e = e || event; e.preventDefault(); if(e.ctrlKey&amp;&amp;e.keyCode==120) { alert('Hello'); } else { alert('Bye'); } But when we begin pressing Ctrl key, we see message 'Bye'. How to disable Ctrl key if it pressed alone ?
has answer: http://stackoverflow.com/a/27886624
linked to: http://stackoverflow.com/q/5203407
downvote count: 1
type: Question
tagged with: keypress
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
tagged with: handler
tagged with: events
favorite count: 0
has title: Ignore some keys when pressed alone, but not when multiple keys pressed at once
type: UnansweredQuestion

http://stackoverflow.com/a/27859598
answers question: http://stackoverflow.com/q/27859421
downvote count: 1
score: -1
upvote count: 0
type: Answer
has body: The callback is actually a comparator function which gives advantage how the developer wants to sort the array. To arrange array elements in descending order, a.sort(function(a,b) { return b-a });

http://stackoverflow.com/comment/44098434
type: Comment
has text: Yeah, exactly, that should work. Glad I could be of help! Tell me if there is something unclear or other issues :)
comment on: http://stackoverflow.com/a/27841906
type: AnswerComment
score: 0

http://stackoverflow.com/q/27872840
downvote count: 1
has comment: http://stackoverflow.com/comment/44148042
type: Question
upvote count: 5
tagged with: javascript
tagged with: jquery
score: 4
tagged with: ajax
linked to: http://stackoverflow.com/q/25842822
has answer: http://stackoverflow.com/a/50407041
has answer: http://stackoverflow.com/a/27873042
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/44147980
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44147995
tagged with: php
has body: I was wondering if I can do this jquery ajax on my code: $.ajax({ type: "POST", dataType: 'json', url: "functions/ajaxNca_add.php", "functions/ajaxNca_update.php", data: dataString, cache: false, success: function(response){ // show success alert(response.a); } The code above is just an example and I knew that it's not working. How can I call 2 php script in just one ajax request in jquery ? Can someone help ?
has answer: http://stackoverflow.com/a/27872855
has title: 2 urls in one ajax call?
has answer: http://stackoverflow.com/a/27873158

http://stackoverflow.com/q/27882702
has comment: http://stackoverflow.com/comment/44167227
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27882726
answer count: 5
has title: How to add a name to a function?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44167196
possible better answer: http://stackoverflow.com/a/27882719
has answer: http://stackoverflow.com/a/27882753
has answer: http://stackoverflow.com/a/27882719
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27882743
upvote count: 1
has body: This is probably a really simple question but I am sort of confused how jQuery or JavaScript work in this way. If I have a function for instance like this $(function() { $('section').on('click', 'div', function(e) { var number = Math.floor(Math.random()*videos.length); $(this).find('source').each(function(index){ videoSrc = videos[number][index].src; $(this).attr('src', videoSrc); $('video').load(); $('video').play(); }); }); }); How would I write it so that I could reference it to run in html? I see functions written like window.onload=function() or thisFunction = function() etc.. and it sort of has me confused as to how a function is declared when compared to something like HTML where it is literally just div id="name" or class="name" etc.. I guess my main question is how would I get the above code to run onload in html instead of on click? Where do I title a function so that I can use it for later? Any help on clarifying this would be greatly appreciated! Cheers! A lot of the answers i've received have ended up making more more confused and I am actually not sure what to do now.. I know I must be over thinking this but I still can't figure out how to get the site to randomize both on click and on page load. Here is the code I have currently. HTML Randomizer Your browser does not support the video element. JavaScript var videos = [ [{type:'mp4', 'src':'/videos/1.webm'}, {type:'webm', 'src':'/videos/1.mp4'}], [{type:'mp4', 'src':'/videos/2.webm'}, {type:'webm', 'src':'/videos/2.mp4'}], [{type:'mp4', 'src':'/videos/3.webm'}, {type:'webm', 'src':'/videos/3.mp4'}], [{type:'mp4', 'src':'/videos/4.webm'}, {type:'webm', 'src':'/videos/4.mp4'}], [{type:'mp4', 'src':'/videos/5.webm'}, {type:'webm', 'src':'/videos/5.mp4'}], ]; $(function() { $('section').on('click', 'div', function(e) { var number = Math.floor(Math.random()*videos.length); $(this).find('source').each(function(index){ videoSrc = videos[number][index].src; $(this).attr('src', videoSrc); $('video').load(); $('…
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27882722
score: 0
has answer: http://stackoverflow.com/a/27882743
tagged with: function

http://stackoverflow.com/comment/44118297
comment on: http://stackoverflow.com/q/27857564
score: 0
type: QuestionComment
has text: use flex properties for the same height
type: Comment

http://stackoverflow.com/comment/44052134
has text: OP said "So if you are at the 8th question and click on progress indicator 1, fade out current div and fade in div no. 1." but this scenario doesnt work in the fiddle (I understand there is no div 8, but div 1 doesnt display when i'm on the supposed div 8)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27822848

http://stackoverflow.com/comment/44110070
type: Comment
has text: possible duplicate of [Search inside circle markers](http://stackoverflow.com/questions/11704148/search-inside-circle-markers/11704394#11704394). [BTW - a bounds object is square, not circular...]
comment on: http://stackoverflow.com/q/27852937
score: 0
type: QuestionComment

http://stackoverflow.com/a/76529557
has body: JS libraries to make a life simpler (no need to invent a wheel): compose EML file: nodemailer/lib/mail-composer parse EML file: mailparser parse MSG file: @kenjiuno/msgreader
answers question: http://stackoverflow.com/q/27951843
downvote count: 0
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/135825867

http://stackoverflow.com/comment/44109740
score: 0
type: AnswerComment
has text: Maybe you just need to use data, could you post the value of data?
type: Comment
comment on: http://stackoverflow.com/a/27852817

http://stackoverflow.com/q/27848634
tagged with: meteor
tagged with: meteor-blaze
has comment: http://stackoverflow.com/comment/44102212
has body: I found that I can just call a findOne in a global function and I'll have access to the subscription... The only thing I'm confused about is, how global a function distinguishes between collections, one subscription to the other. // pubs Meteor.publish("just_dob_and_id_shared_collection", function () { return shared_collection.find({_id: this.userId}, {fields: {'dob': 1}}); }); Meteor.publish("entire_recordset_shared_collection", function () { return shared_collection.find({_id: this.userId}); }); // IR controllers fooController = RouteController.extend({ template: 'foo-template', waitOn: function () { Meteor.subscribe("just_dob_and_id_shared_collection"); }, ... }); barController = RouteController.extend({ template: 'bar-template', waitOn: function () { Meteor.subscribe("entire_recordset_shared_collection"); }, ... }); // global functions fooFunction = function () { var foo = shared_collection.findOne({_id: Meteor.userId()}); // in this case I'll have the _id and dob... this is kinda what I've tested // ## will be used in foo-template } barFunction = function () { var bar = shared_collection.findOne({_id: Meteor.userId()}); // in this case maybe I'd want the entire record set to do stuff with // ## will be used in bar-template } // template helpers Template.registerHelper("fooHelper", function () { fooFunction(); } Template.registerHelper("barHelper", function () { barFunction(); } // templates &lt;template name="foo-template"&gt; {{#if fooHelper}} ... {{/if}} &lt;template&gt; &lt;template name="bar-template"&gt; {{#if barHelper}} ... {{/if}} &lt;template&gt; EDIT: To clarify further I have two subscriptions, each pulling (maybe from the same record-set) different data profiles (portions of a record-set from a document within a collection). On the client, when I do a findOne on the collection name (since I don't do it on the subscription name), (1) which/what record-set (data profile) do I get when I call, for example the fooFunction, and why?, (2) when does this d…
tagged with: iron-router
answer count: 0
type: UnansweredQuestion
has title: Meteor and Iron Router subscription queries
has comment: http://stackoverflow.com/comment/44124915
type: Question
score: 0
tagged with: javascript

http://stackoverflow.com/comment/44241107
has text: @SinjuAngajan sounds like you will need some `regex` vodoo!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27920940
type: Comment

http://stackoverflow.com/q/27848063
type: Question
tagged with: charts
tagged with: google-visualization
tagged with: javascript
score: 0
answer count: 1
has body: I am building a stacked ColumnChart from the Google Charts API, and all is well - mostly. It is stock information with a double y-axis. Only in chrome, when I set the viewWindow min value to something greater than 0 to adjust the chart, the columns do not stop at the bottom vertical boundary of the chart and instead bleed into the labels. The chart is here: http://ir.stockpr.com/mainstcapital/stock-information Chrome: The chart data is all correct. Code: function drawVisualization() { var data = google.visualization.arrayToDataTable([ &lt;?= $chart_data ?&gt; ]); var options = { legend: { position: 'top', textStyle: {color: '#333', fontSize: 10, fontName: 'Arial', bold: false, italic: false} }, isStacked: true, title : 'Historical Dividend, Distributable Net Investment Income (“DNII”), And Net Asset Value (“NAV”) Per Share Growth', vAxes: { 0: {title: "DNII and Dividends Per Share", viewWindowMode: 'explicit', viewWindow: { min: 0.2, max: 1 } }, 1: {title: "NAV Per Share", viewWindowMode: 'explicit', viewWindow: { min: 8, max: 24 } } }, hAxis: {title: "As of &lt;?= $last_day_of_last_complete_quarter ?&gt;, &lt;?= $last_complete_year ?&gt;"}, series: { 0: {type: "bars", color: '#6d6d66', targetAxisIndex: 0}, 1: {type: "bars", color: '#d4d4d4', targetAxisIndex: 0}, 2: {type: "line", color: 'green', lineWidth: 3, targetAxisIndex: 1}, 3: {type: "line", color: 'red', lineWidth: 3, targetAxisIndex: 0}, } }; var chart = new google.visualization.ComboChart(document.getElementById('chart_div')); chart.draw(data, options); } Is there some CSS I could do to fix this? I couldn't figure anything out. Or am I missing something in the API? Any help is appreciated, thank you in advance.
accepted answer: http://stackoverflow.com/a/27864581
tagged with: css
has answer: http://stackoverflow.com/a/27864581
type: AnsweredQuestion
has title: Google Charts ColumnChart hard min axis value overflows label (Chrome only)
tagged with: google-chrome

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/27879515
tags question: http://stackoverflow.com/q/27910811
tags question: http://stackoverflow.com/q/27934461
tags question: http://stackoverflow.com/q/27913773
tags question: http://stackoverflow.com/q/27804405
tags question: http://stackoverflow.com/q/27889930
tags question: http://stackoverflow.com/q/27836008
tags question: http://stackoverflow.com/q/27889302
tags question: http://stackoverflow.com/q/27841821
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/27902548

http://stackoverflow.com/a/27908565
score: 2
upvote count: 2
has body: I'd recommend either creating a Mixin or utilizing Ember's Loading Route. So in your case, the Mixin would work as follows: App.PaceLoader = Ember.Route.extend({ activate: function() { this._super(); return Pace.restart(); }, deactivate: function() { this._super(); return Pace.stop(); } }); And then just include it in each route you want it to work in: App.AboutRoute = Ember.Route.extend(App.PaceLoader, { //the rest of your route code here... }); I haven't used Pace before, but you may be able to just add it to Ember's less obvious Loading route (I don't believe they've documented it...), which is used in each transition: App.LoadingRoute = Ember.Route.extend({ activate: function() { this._super(); return Pace.restart(); }, deactivate: function() { this._super(); return Pace.stop(); } }); If this works, you wouldn't have to include it in any other routes. :)
answers question: http://stackoverflow.com/q/27908232
downvote count: 0
has comment: http://stackoverflow.com/comment/44216726
type: Answer

http://stackoverflow.com/comment/44290685
comment on: http://stackoverflow.com/q/27947876
type: Comment
type: QuestionComment
score: 1
has text: Can't you use an array?

http://stackoverflow.com/a/27820827
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27820682
has comment: http://stackoverflow.com/comment/44047251
has comment: http://stackoverflow.com/comment/44047365
has body: Try this: myVar = document.getElementById("idname"); varLink = (myVar.attributes.href);

http://stackoverflow.com/comment/44074383
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27834551
score: 0
has text: _product name (example NP-V80)_....where is it placed in your html?

http://stackoverflow.com/q/27926010
tagged with: angularjs
type: UnansweredQuestion
has body: Why doesn't this work? {{ report }} {{ index }} Like this does? {{ report }} {{ index }} While you can add $index to any name or id (renders as id="myDiv1"), it does not behave the same for other directives (will render as ng-model="myDiv{{ $index }}"). My goal is to create a table where users can view, sort and download 6-10 different reports within a date range. The client requires a sortable list of reports all at once on the page, each with its own date-range-picker. Because the reports selection varies on the user, this needs to be done dynamically. The following is basically what I am trying to do... {{ report.title }} Print Report When hard coded, everything works. If rendered WITHOUT $index in the directives, each calendar will affect other calendars because they are all dependent on the same variables which make them show, hide, reset, etc. Hopefully I am just doing this the wrong way or a workaround, or another solution is need soon.
type: Question
has answer: http://stackoverflow.com/a/27926812
tagged with: javascript
has title: how can I dynamically assign an index to ng-show values in angular
score: 0
answer count: 2
upvote count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27926266

http://stackoverflow.com/comment/44067706
has text: Thanks Mottie for trying, but this still doesn't work. It's actually more broken now than before (the sort used to just mess up due to comma, but with this code I get $5,405.00, $1,435.00, $702.00, $1050.00, etc., completely non-sensical ordering. I'm not using your fork, so maybe I should try that too. But I'm really starting to think it's time to find a new sorting library.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27830113

http://stackoverflow.com/q/27885926
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44173004
has title: why my radio uncheck inside php?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27886044
has answer: http://stackoverflow.com/a/27886022
has body: 1. I am whahaha. <?php for($i=1; $i<=10; $i++){?><input type="radio" name="de" id="p2"value="<?=$i?>"> <?=$i?> <?php } ?> 2. I am hehehe. <?php for($i=1; $i<=10; $i++){?><input type="radio" name="Iquestion[1]" id="p2"value="<?=$i?>"> <?=$i?> <?php } ?> Box 3 Box 4 why my check on php wont work ? my intention is when i check the 1st question radio and == checked , but it keep return me uncheck , can anyone tell me what wrong ? isit causing by my php code warp around the div ? how i going to by pass that i need that php warp also.

http://stackoverflow.com/comment/44023385
type: QuestionComment
score: 1
has text: `(1)[1]` weird....Why not just look at that character and not bother with a substring...
comment on: http://stackoverflow.com/q/27807183
type: Comment

http://stackoverflow.com/comment/44248100
score: 0
type: Comment
has text: can you check my above code ( table and input fields) '
type: AnswerComment
comment on: http://stackoverflow.com/a/27925287

http://stackoverflow.com/comment/44249752
type: AnswerComment
has text: Read your comment on what you are actually trying to do.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27913549

http://stackoverflow.com/q/27924902
tagged with: javascript
type: UnansweredQuestion
tagged with: ajax
linked to: http://stackoverflow.com/q/7363011
downvote count: 0
has answer: http://stackoverflow.com/a/27927255
score: 1
has answer: http://stackoverflow.com/a/27928073
favorite count: 0
type: Question
answer count: 2
has body: I am trying to post JSON data from JavaScript to PHP. You can do that with either Content-Type: application/json or Content-Type: application/x-www-form-urlencoded Both works, but I had a hard time getting the first one to work. The reason is that I missed that the PHP script seems to be running 2 times when the content type is application/json. I am quite surprised and wonder what is going on. Can anyone explain what is going on and how to handle it? (There are some related questions, but none of the answers seems to observe this behaviour.) Here is my test code. First start PHP builtin server: php.exe -S localhost:7000 Then in that directory create the file test1.php with the following code: &lt;?php header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: Content-Type"); header("Content-Type: application/json"); function writeStdErr($msg) { $fh = fopen('php://stderr','a'); fwrite($fh, $msg); fclose($fh); } writeStdErr("\n\nI am here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); $e = stripslashes(file_get_contents("php://input")); writeStdErr("e=".$e."\n"); if (strlen($e) &gt; 0) echo $e; Now from a web browser console (I am using Google Chrome) make an ajax call: function test1(j) { url = "http://localhost:7000/test1.php"; type = "application/x-www-form-urlencoded"; if (j) type = "application/json"; xhr = new XMLHttpRequest(); xhr.open("POST", url, true); xhr.setRequestHeader("Content-type", type); xhr.addEventListener("readystatechange", function () { if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) { var json = JSON.parse(xhr.responseText); console.log(json.email + ", " + json.password) } }); var data = JSON.stringify({"email":"hey@mail.com","type":type}); xhr.send(data); console.log("now sending &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;", url, type); } test1(false) The output in the console is just what I expect: I am here!!!!!!!!!!!!!…
upvote count: 1
tagged with: xmlhttprequest
tagged with: php
linked to: http://stackoverflow.com/q/27176465
linked to: http://stackoverflow.com/q/24468459
has title: Why do an ajax `application/json` run PHP code twice?
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/16112197
linked to: http://stackoverflow.com/q/477816

http://stackoverflow.com/a/27940365
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44277103
has comment: http://stackoverflow.com/comment/44277556
downvote count: 0
has body: Currently, the exact same model (job.selectedPeople) is assigned to every row, and the state of the checkbox is added on to the end of selectedPeople every time it's clicked. This means selectedPeople is acting as a history of all clicks, not a record of the current state. You can use $index to specify that each row in your repeat is modeled on its own array element: ng-model="selectedPeople[$index]" You can then remove this because the array will be automatically updated by data binding: $scope.selectedPeople.push(id + " selected"); helloWorld.selectedPeople = $scope.selectedPeople; More generally I think it would help to have clearer separation of jobs and people, but hopefully the above will help.
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27939738
answers question: http://stackoverflow.com/q/27939738

http://stackoverflow.com/q/27963201
score: 0
tagged with: validation
answer count: 1
linked to: http://stackoverflow.com/q/9996041
type: UnansweredQuestion
has body: I have simple validation for textbox on my cshtml page: @Html.EditorFor(model =&gt; Model.Subject) @Html.ValidationMessageFor(model =&gt; Model.Subject) Without tinymce unobtrusive validation works just perfect, but when I adding tinymce control using: @Html.EditorFor(model =&gt; model.EmailBody) Page loads with no errors(I guess 1-st on-page-load validation is passed, because the same jquery.validate.js:449 lines executes few time with no errors thrown), but before postback when I call $('#emailNotificationsForm').valid() it's fails on jquery.validate.js:449 with message: Uncaught TypeError: undefined is not a function. My view model fields are: [Required] public string Subject { get; set; } [UIHint("tinymce_jquery_full"), AllowHtml] public string EmailBody { get; set; } tinymce partial view: &lt;script src="@Url.Content("~/Content/Scripts/tinymce/jquery.tinymce.js")" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; (function () { $(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)').tinymce({ script_url: '@Url.Content("~/Content/Scripts/tinymce/tiny_mce.js")', theme: "advanced", height: "300", width: "600", verify_html: false, theme_advanced_buttons1: "bold,italic,underline,|,&amp;Font,fontselect,Size,fontsizeselect,|,image,code", theme_advanced_buttons2: false, theme_advanced_buttons3: false, theme_advanced_buttons4: false, theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_statusbar_location: false, theme_advanced_resizing: false, content_css: "@Url.Content("~/Content/Site.css")", convert_urls: false, body_class: "mceBodyClass" }); }); })(); &lt;/script&gt; @Html.TextArea(string.Empty, /* Name suffix */ ViewData.TemplateInfo.FormattedModelValue /* Initial value */ ) Additionally when whole next section is commented validation also works fine: @*(function () { $(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)').tinymce({ script_url: '@Url…
type: Question
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/28489449
has title: Jquery unobtrusive validation doen't work when tinymce control is rendered on page(Uncaught TypeError: undefined is not a function)
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44065568
has text: @AlexBalashov But for your case `process.nextTick` is a best choice.
comment on: http://stackoverflow.com/a/27810189
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27887862
has comment: http://stackoverflow.com/comment/44176704
tagged with: ajax
has title: jQuery ajax unable retrieve json
has comment: http://stackoverflow.com/comment/44176724
type: Question
has body: So here is the ajax call that is making the problem $.ajax({ type: "POST", url: "src/login.php", dataType: "JSON", data: {username: usr, password: pwd}, success: function(json){ loggedStatus=json.status; alert(json.status); } }); It is succesfully passing the variables to the php file, but it isn't entering th success: part. This is example of what the php file returns { "status": "Wrong" } or { "status": "154414707fe8d22bb6239648ce11a9c9bede1a3e" } Which is totaly fine.
has comment: http://stackoverflow.com/comment/44176675
tagged with: php
has comment: http://stackoverflow.com/comment/44176941
has comment: http://stackoverflow.com/comment/44176898
possible better answer: http://stackoverflow.com/a/27887972
score: 0
tagged with: http://stackoverflow.com/tag/json
answer count: 3
has answer: http://stackoverflow.com/a/27887972
has comment: http://stackoverflow.com/comment/44176956
has answer: http://stackoverflow.com/a/27888044
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44176758
has answer: http://stackoverflow.com/a/27888289
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44176749
accepted answer: http://stackoverflow.com/a/27888044

http://stackoverflow.com/q/27900649
favorite count: 0
has comment: http://stackoverflow.com/comment/44201019
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44201466
tagged with: css
has title: Is it possible to show title when clicking on a div?
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44201282
type: Question
has comment: http://stackoverflow.com/comment/44201337
has comment: http://stackoverflow.com/comment/44201530
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44201240
downvote count: 4
has answer: http://stackoverflow.com/a/27901044
answer count: 1
has comment: http://stackoverflow.com/comment/44200855
tagged with: jquery
has body: I would like title (not Tooltip) to "popup" when the user clicks with the mouse on the div. I don't want to wait for the title to show up when mouse over (but it also needs to be a mouse over). &lt;div id="someDiv" title ="Info on both click and hover!"&gt;&lt;/div&gt; At this point I don't care how its done :-) EDIT Ok to recap what I´m trying to do: I need to popup the title as soon as I click on the div, but if I don´t click on the div , I like the title to work just as normally with mouseover. There should never be 2 titles showing at once. This is just one of the things I tried to solve this. I have the title attribute.. but what now? This is probably something very easy... $('#someDiv').click(function () { $(this).attr("title"); //And how do I show the title right away? });

http://stackoverflow.com/a/27870885
answers question: http://stackoverflow.com/q/27870441
score: 0
has body: Something like this should work. var max_scroll = 0; var done = [false, false, false, false] var height = $(document).height() - $(window).height(); $(window).on('scroll', function() { var perc = $(window).scrollTop() / height; if (perc &lt;= max_scroll) return false; max_scroll = perc; var index = Math.floor(perc / 25) - 1; if (index &gt;= 0 &amp;&amp; !done[index]) { done[index] = true; console.log(((index + 1) * 25) + '% scrolled'); } });
type: Answer

http://stackoverflow.com/comment/44064894
has text: @eg_dac That is a relative url... Problem is the server is not set up to serve that file type.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27829147
score: 0

http://stackoverflow.com/comment/44322804
type: AnswerComment
has text: Do you have the avatar in your database ? If it returns null, this means Avatar.new_avatar(@username) is null
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27962641

http://stackoverflow.com/comment/44207947
has text: What exactly do you mean by "the only diff is the URL"?
comment on: http://stackoverflow.com/q/27904225
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44211952
has text: @slime — Wouldn't be able to deal with binary input. Wouldn't make base64 data any shorter.
comment on: http://stackoverflow.com/q/27905106
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/30731748
has body: It's not possible to catch Gesture because the Kinect will only provide you the raw data in the JavaScript SDK. Read this thread on Microsoft forum: https://social.msdn.microsoft.com/Forums/en-US/c285b9ae-a8d3-4ed7-bcf6-0b05b03deebf/developing-with-javascript-vs-wpf-c?forum=kinectv2sdk You will need to make the swipe gesture yourself, maybe this repository on github could help: https://github.com/ekino/ek-winjs-kinect
upvote count: 1
answers question: http://stackoverflow.com/q/27853699
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44032690
type: Comment
has text: can i show you example ? Like this [DEMO](http://codepen.io/shadowman86/pen/raBRxO) there is popup window. Can i add here like that popup ?
comment on: http://stackoverflow.com/a/27812582
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44238773
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27920779
score: 2
has text: Your problem is your title

http://stackoverflow.com/q/27935737
tagged with: bootstrap-modal
has answer: http://stackoverflow.com/a/27936085
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/66337017
tagged with: ajax
answer count: 3
possible better answer: http://stackoverflow.com/a/66337017
favorite count: 0
has answer: http://stackoverflow.com/a/68230027
tagged with: twitter-bootstrap
has body: I'm trying to figure out why I can't change the backdrop to 'true' after first changing it to 'static' when using Bootstrap's modal. I run this code: $('#modal').modal({backdrop: 'static', keyboard: false, show: true}); $.post('server.php', $('#form').serialize(), function(data) { if(data.success) { $('#modal').modal({backdrop: true, keyboard: true}); } else { $('#modal').modal({backdrop: true, keyboard: true}); } }, 'json'); It will set it so the backdrop and keyboard will not function at the start, but I cannot figure out why I can't set it back to default. Thanks for reading.
accepted answer: http://stackoverflow.com/a/27936085
type: AnsweredQuestion
has title: Why can't I change backdrop to 'true' or remove it after changing to 'static' in Bootstrap?
type: Question
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/44180641
type: Comment
type: QuestionComment
has text: @esner_togo I think that's enough code to get the idea
comment on: http://stackoverflow.com/q/27889800
score: 0

http://stackoverflow.com/comment/44067767
type: Comment
has text: Javascript is the language you need to look at, not java. The two are not the same thing.
comment on: http://stackoverflow.com/q/27830919
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44327463
comment on: http://stackoverflow.com/a/27965226
type: Comment
has text: is there a way to specify a different content for the first column when dynamically adding the row? The column is configured to display a button, but I would like to show something else when adding a row via a API call. Sorry this is deviating from my original question, but I don't know if there is a way to take this thread into a chat or messaging system within StackOverflow!
score: 0
type: AnswerComment

http://stackoverflow.com/q/27881917
has comment: http://stackoverflow.com/comment/44165607
has answer: http://stackoverflow.com/a/27882114
has comment: http://stackoverflow.com/comment/44165807
has answer: http://stackoverflow.com/a/27882117
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44165672
tagged with: javascript
downvote count: 4
answer count: 3
has comment: http://stackoverflow.com/comment/44165795
tagged with: jquery
has title: JQuery - Hide and Show - Not Functioning
favorite count: 0
has comment: http://stackoverflow.com/comment/44165779
has body: I am trying to use the JQuery Hide and show script to display text on top an image when the div tag is clicked. The JQuery code I am using is bellow, I have created a JSFiddle to show 2 examples, a before and after with my current result. UPDATE: I have managed to get the toggle to work and changed some of the CSS. But need div tag hidden until click. Any help or feedback would be great thanks (Y) Im sorry about the prev link; $(".card-options").click(function () { $(".card-list").toggle(); }); [JSfiddle][1] [1] http://jsfiddle.net/jinghming/u4epkev4/
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44165616
score: -3
tagged with: css
has answer: http://stackoverflow.com/a/27882125
has comment: http://stackoverflow.com/comment/44165733

http://stackoverflow.com/q/27846286
possible better answer: http://stackoverflow.com/a/27846339
score: 55
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27846310
tagged with: css
accepted answer: http://stackoverflow.com/a/27846302
has body: Following is the form with id msform that I want to apply style="display:none" attribute to. &lt;form id="msform" style="display:none;"&gt; &lt;/form&gt; Also the check should be performed before adding the "style=display:none;" property. That is if it is already set like in above code it should not set again. But if it's not set then it should. How should I achieve this? Please help me.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27846339
has answer: http://stackoverflow.com/a/59882231
has answer: http://stackoverflow.com/a/27846302
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/51076674
has answer: http://stackoverflow.com/a/58739945
has comment: http://stackoverflow.com/comment/44096802
has answer: http://stackoverflow.com/a/27859017
tagged with: javascript
tagged with: show-hide
has answer: http://stackoverflow.com/a/27846346
has title: How to set "style=display:none;" using jQuery's attr method?
upvote count: 55
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27900705
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28180244
has title: Server-side Google Analytics Experiments
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/28180244
tagged with: google-analytics
tagged with: google-experiments
tagged with: javascript
has body: I'm wondering why I have to include the JavaScript cxApi when I'm running the experiments server-side. Furthermore, can I send the chosen experiment and variations by PHP? Or maybe by injecting a JavaScript snippet without external resources (like the cxApi). I'm using Universal Analytics on the front-end and on the back-end.
answer count: 2
upvote count: 1
tagged with: universal-analytics
favorite count: 0
has answer: http://stackoverflow.com/a/28180188
accepted answer: http://stackoverflow.com/a/28180188

http://stackoverflow.com/a/55494826
has comment: http://stackoverflow.com/comment/97697587
downvote count: 0
score: 1
has body: $("video").one( would solve your problem as you asked it, but I agree with commenters, you'd probably be better to use directly the poster attribute rather than this hack. $(document).ready(function() { $("video").one("play", function() { this.currentTime = 0; }); });
has comment: http://stackoverflow.com/comment/97698115
has comment: http://stackoverflow.com/comment/97698488
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27838041
has comment: http://stackoverflow.com/comment/97697351
answers question: http://stackoverflow.com/q/27838041
type: Answer

http://stackoverflow.com/q/27905088
favorite count: 0
tagged with: scope
has title: $scope exists on browser debugger, but does not exist in terminal
possible better answer: http://stackoverflow.com/a/27905400
tagged with: angularjs
tagged with: unit-testing
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I have a directive that is depended on a controller which gets data from an api though Ajax call. It works correctly. I am trying to test it using jasmine and the strange issue is that when I debug the code and check for a value of let's say $scope.measurement it returns true, but when I run in the terminal it can't find $scope.measurement and raises an error Expected undefined to be true. no clue what can be the issue. I thought the problem might be with an isolated scope, but the element doesn't have a function isolateScope(). Is there any idea what can be the problem? Here is the controller: 'use strict'; angular.module('myApp') .controller('MeasurementsTimelineCtrl', ['$scope', 'Measurements', function($scope, Measurements) { $scope.measurements = null; var userId = $scope.currentUser ? $scope.currentUser.id : null; if (userId) { var listOfMeasurements = Measurements.users(userId); listOfMeasurements.then(function(data){ $scope.measurements = data; }); } }); This is the directive: 'use strict'; angular.module('myApp') .directive('measurementTimeline', function() { return { restrict: 'E', templateUrl: 'myView.html', controller: 'MeasurementsTimelineCtrl', link: function(scope, element){ scope.$on('measurements-updated', function(measurements) { _.defer(function(){ if(measurements) { scope.measurementScroll = true; } }); }); } }; }]); And this is the test: 'use strict'; describe('Directive: measurementTimeline', function () { var $rootScope, $compile, element, scope, createController, $httpBackend, apiUrl; beforeEach(function() { module('myApp'); inject(function($injector) { $rootScope = $injector.get('$rootScope'); $compile = $injector.get('$compile'); $httpBackend = $injector.get('$httpBackend'); apiUrl = $injector.get('apiUrl'); }); scope = $rootScope.$new(); element = angular.element('&lt;dashboard-measurement-timeline&gt;&lt;/dashboard-measurement-timeline&gt;'); element = $compile(element)(scope); scope.$digest(); scope.measurements = [{id: 'someId', time_of…
type: Question
has answer: http://stackoverflow.com/a/27918546
accepted answer: http://stackoverflow.com/a/27918546
has answer: http://stackoverflow.com/a/27905400
answer count: 2
upvote count: 1
linked to: http://stackoverflow.com/q/27921918
tagged with: javascript
tagged with: jasmine

http://stackoverflow.com/q/27904143
has comment: http://stackoverflow.com/comment/44207424
type: Question
has body: How to change this random result into a sequence starting from lower number? I am new in JS and have tried to make modification with no solution. I hope anybody can help. function randomFeed() { var $el = $("#randomFeed"); var random = new Array('news1','news2','news3','news4','news5','news6'); var randomIndex = Math.floor(Math.random() * 4); var newElement = random[randomIndex]; $el.prepend("&lt;tr&gt;&lt;td&gt;" + newElement + "&lt;/td&gt;&lt;/tr&gt;").find("tr").first().hide(); $el.find("tr").first().fadeIn(); if ($el.find("tbody tr").length &gt; 20) { $el.find("tbody tr").last().fadeOut(400, function() { $(this).remove(); }); } slimScrollUpdate($el.parents(".scrollable")); setTimeout(function() { randomFeed(); }, 3000); }
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44208667
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27904210
has answer: http://stackoverflow.com/a/27904210
has title: Change random result to sequence
score: 0
has answer: http://stackoverflow.com/a/27904438
accepted answer: http://stackoverflow.com/a/27904438

http://stackoverflow.com/a/27961335
score: 8
accepted answer of: http://stackoverflow.com/q/27954806
downvote count: 1
answers question: http://stackoverflow.com/q/27954806
upvote count: 9
has comment: http://stackoverflow.com/comment/44316313
has comment: http://stackoverflow.com/comment/44342487
has comment: http://stackoverflow.com/comment/44316558
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44316888
has comment: http://stackoverflow.com/comment/44342414
has comment: http://stackoverflow.com/comment/44316539
type: Answer
has comment: http://stackoverflow.com/comment/44342874
has comment: http://stackoverflow.com/comment/44342438
has body: * Real solution of your question at the bottom. Clearing browser address bar This is a pretty old question that came in the mind of almost everyone who ever used JavaScript: can I replace the whole URL shown in the address bar via JavaScript? Well, I'm sorry, but the answer is a huge NOPE! Why can't you clear/replace the URL in the address bar? First of all, JavaScript doesn't actually provide any feature for doing it, and neither do the most famous browsers (Chrome, Mozilla, Opera...) with their APIs. Secondly, but not less important, it would be a huge security flaw. Imagine that some malicious individual wants to steal you some passwords (for example, the Facebook one): if changing the browser's address bar was possible, he would easily create a fake log-in page, copying the original one, and then replace the URL with "facebook.com/login" to make it look like you really are on Facebook (it would be pretty easy, huh?). You can obviously see that this could apply to any site and many other services. JavaScript location and history In JavaScript, there are two common objects used to manipulate the page address: The first one is window.location, which provides you useful information about the current page's location, (such as .hostname, .path, .href, etc), and functions to reload the page or navigate to a different URL. By the way, when changing the address using this object, the page will always be reloaded. location.href = "http://newsite.com"; // will reolad location.path = "/home.html"; // will reload location.replace("google.com"); // will also reload The second, more tricky one, is window.history, which also allows you to manipulate the URL without reloading the page, within some limitations (obviously). With its methods .pushState() and .replaceState() makes you able to change the current path without reloading the page. By the way, you only can navigate through your own site's pages (you cannot change the hostname). history.back(); // will make your browser g…

http://stackoverflow.com/q/27817654
has body: I am adding custom markers to a Here V3 map, but by default, it is the top-left pixel that is attached to the marker's cooredinates that I am trying to pin-point. Is there a way that I could tell the DomMarker the precise pixel that correlates to the required position? var outerElement = document.createElement('div'), innerElement = document.createElement('div'); innerElement.innerHTML = '&lt;img src="/Images/' + getMarkerImage(donation) + '" /&gt;'; outerElement.appendChild(innerElement); var domIcon = new H.map.DomIcon(outerElement, {}); var domMarker = new H.map.DomMarker( { lat: donation.Lat, lng: donation.Long }, { icon: domIconn} ); map.addObject(domMarker);
favorite count: 0
has title: Here maps custom marker with custom 'center'
downvote count: 0
score: 1
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27828004
tagged with: here-api
accepted answer: http://stackoverflow.com/a/27828004
tagged with: javascript
possible better answer: http://stackoverflow.com/a/65818531
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/65818531

http://stackoverflow.com/q/27858134
has comment: http://stackoverflow.com/comment/44119003
favorite count: 0
has comment: http://stackoverflow.com/comment/44119223
has title: How to set browser cookie that expires every hour
tagged with: python
tagged with: cookies
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44119742
has comment: http://stackoverflow.com/comment/44119160
linked to: http://stackoverflow.com/q/22001112
tagged with: javascript
type: Question
linked to: http://stackoverflow.com/q/3794989
has body: I have a website with a python backend and a javascript/html front-end, naturally. There is a certain pop-up that I want to show every hour. It does not matter on which page of the site a user is on; once the popup appears, it should wait for one hour to show up again. I can’t figure out how to create the cookie to do this. Presently the popup is governed by the front-end and it shows up each time a person navigates to a different page on the site. I would prefer to keep the management completely in the front-end. But I don’t mind managing it on the server either. So how to do track that I have already shown the popup to a certain user/browser instance and so wait for another hour before showing it again? The key problem for me is that the cookie is for the entire website not just for one web page
upvote count: 1
has comment: http://stackoverflow.com/comment/44119172
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27858304

http://stackoverflow.com/comment/44293014
type: Comment
type: QuestionComment
has text: @CasimiretHippolyte I should have seen that. Thanks for pointing it out.
score: 0
comment on: http://stackoverflow.com/q/27934616

http://stackoverflow.com/q/27936194
has answer: http://stackoverflow.com/a/27936625
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/21456326
has answer: http://stackoverflow.com/a/27936418
accepted answer: http://stackoverflow.com/a/27936418
has body: Following is my table which is dynamically generated. Means rows are generated through query result loop. But I am displaying here as simple html to avoid confusion. Particulars Packing Quantity Rate Amount 1 1 quantity."'/> 1 1 quantity."'/> 1 1 quantity."'/> In every row rate and quantity will be different. So I want the value in quantity and rate and multiply them and display amount in respective td's input box. Question is user is going to enter rate for each row and then only will be amount display in amount input box. So how do I do this? Using jquery or use rate div's blur event or any other way of doing it??
has comment: http://stackoverflow.com/comment/44269445
possible better answer: http://stackoverflow.com/a/27936625
has comment: http://stackoverflow.com/comment/44269783
type: AnsweredQuestion
has title: calculate amount on change of rate for each row
has comment: http://stackoverflow.com/comment/44269498
type: Question
score: 0
answer count: 2

jquery-plugins
tags question: http://stackoverflow.com/q/27912738
tags question: http://stackoverflow.com/q/27845336
tags question: http://stackoverflow.com/q/27961312
tags question: http://stackoverflow.com/q/27888769
type: Tag
tags question: http://stackoverflow.com/q/27819794
tags question: http://stackoverflow.com/q/27903765
tags question: http://stackoverflow.com/q/27850349
tags question: http://stackoverflow.com/q/27885313
tags question: http://stackoverflow.com/q/27838621
tag name: jquery-plugins
tags question: http://stackoverflow.com/q/27823081
tags question: http://stackoverflow.com/q/27835422
tags question: http://stackoverflow.com/q/27857812

http://stackoverflow.com/a/58049526
score: 3
has body: We used Express.js' 404 handling approach. // Path to the static React build directory const frontend = path.join(__dirname, 'react-app/build'); // Map the requests to the static React build directory app.use('/', express.static(frontend)); // All the unknown requests are redirected to the React SPA app.use(function (req, res, next) { res.sendFile(path.join(frontend, 'index.html')); }); It works like a charm. A live demo is our site.
upvote count: 3
has comment: http://stackoverflow.com/comment/119353856
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27928372

http://stackoverflow.com/q/27816682
tagged with: google-maps-api-3
type: Question
type: AnsweredQuestion
score: 3
favorite count: 0
has answer: http://stackoverflow.com/a/27817459
answer count: 1
has title: Setting Google Maps API V3 Zoom level based on screen/device width
upvote count: 3
accepted answer: http://stackoverflow.com/a/27817459
has body: I have the following code which display 3 markers on a google map. On screen widths larger than 600px the zoom level is set to '13', which is fine. Ideally, once the screen/device width is lower than 600px I would like the zoom level to drop to '12'. I have tried using fitBounds(), and looked at LatLngBounds, but I'm struggling to get those to work with my code. Is this simple to achieve? Any help would be grately appreciated. My code is below: var map; var locations = [ ['Location 1', 53.560410,-2.105351, 2], ['Location 2', 53.532154, -2.165793, 1], ['Location 3', 53.5386671,-2.1681325, 3] ]; function bindInfoWindow(marker, map, infowindow, strDescription) { google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(strDescription); infowindow.open(map, marker); }); } function setMarkers(map, locations) { var infowindow = new google.maps.InfoWindow({ content: "" }); var i, location, myLatLng, marker; for (i = 0; i &lt; locations.length; i++) { location = locations[i]; myLatLng = new google.maps.LatLng(location[1], location[2]); marker = new google.maps.Marker({ position: myLatLng, map: map, title: location[0], zIndex: location[3] }); bindInfoWindow(marker, map, infowindow, location[0]); } } function initialize() { var mapOptions = { zoom: 13, center: new google.maps.LatLng(53.545701, -2.131714), panControl: false, disableDefaultUI: true, zoomControl: true, scrollwheel: false, panControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); setMarkers(map, locations); } google.maps.event.addDomListener(window, 'load', initialize); google.maps.event.addDomListener(window, 'resize', initialize); window.onpopstate = initialize(); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;div id="map-canvas" style="he…
tagged with: google-maps
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44288556
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27946338
type: AnswerComment
has text: @IsmaelMiguel I didn't say `$` was jQuery. In fact, the original question specifically says it is Prototype, so my answer is generalized to cover both Prototype (specified by OP) and jQuery (defacto `$` implementation).

http://stackoverflow.com/q/27857214
upvote count: 2
tagged with: jsonp
has comment: http://stackoverflow.com/comment/44118291
has comment: http://stackoverflow.com/comment/44118061
has comment: http://stackoverflow.com/comment/44118377
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44118541
has comment: http://stackoverflow.com/comment/44118658
favorite count: 0
has comment: http://stackoverflow.com/comment/44119607
has comment: http://stackoverflow.com/comment/44118036
score: 2
has comment: http://stackoverflow.com/comment/44117590
has body: I am doing an example on webservices and i want to return json using jsonp callback function. I have implemented spring on my server side here is my code $("#button5").click(function() { $.getJSON("....webServices/rest/hello/jsonp?callback=?", function(result){ //response data are now in the result variable alert("jsonp");//NOT printing }); }); This is my server-side code @GET @Path("/jsonp") @Produces(MediaType.APPLICATION_JSON) public Person sayJsonpHello() { Person person = new Person(); person.setID(1); person.setName("person1"); System.out.println("jsonp hello"); return person; } when i execute the url in the rest client on chrome it says "unexpected token c" I am able to return json but not jsonp...that is the callback function is not working. I have gone through other links in stackoverflow but it dint help. Is there any configuration i need to set up on the server side. This is the other option i have tried $("#button5").click(function () { alert("button5"); $.getJSON("....../webServices/rest/hello/jsonp?callback=callbackFunction", function (result) { alert("jsonp"); //NOT printing }).fail(function() { console.log(arguments); }); }); function callbackFunction() { alert("call back function"); } The corresponding code on server-side @GET @Path("/jsonp") @Produces(MediaType.APPLICATION_JSON) public String sayJsonpHello() { Person person = new Person(); person.setID(1); person.setName("shalini"); System.out.println("jsonp hello"); return "callbackFunction("+person+")"; } updating - answer for my question ( posting after i solved the issue ) My mistake was - @Produces("application/x-javascript") should be used instead of @Produces(MediaType.APPLICATION_JSON). The reurn type should be JSONWithPadding instead of string Server side @GET @Path("/jsonp") @Produces("application/x-javascript") public JSONWithPadding sayJsonpHello() { Person person = new Person(); person.setID(1); person.setName("google"); System.out.println("jsonp hello"); return new JSONWithPadding(per…
downvote count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/44118738
has comment: http://stackoverflow.com/comment/44196903
type: UnansweredQuestion
has title: Jsonp callback function not working
has comment: http://stackoverflow.com/comment/44151402
type: Question
has comment: http://stackoverflow.com/comment/44117852
has comment: http://stackoverflow.com/comment/44118930
has comment: http://stackoverflow.com/comment/44117932
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/a/27843007
score: 2
accepted answer of: http://stackoverflow.com/q/27828379
answers question: http://stackoverflow.com/q/27828379
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
has body: For starters, to create buttons that look the way they do in your layout design, you can't easily use radio input types. The reason for this is that you can't style a radio button to have a text value inside of it like a button input type may have. So in my fiddle example, I have opted to use button input types, but you could choose to use any html tag that allows you to wrap text inside &lt;!-- Your design requires html elements that can wrap text inside --&gt; &lt;input type="button" class="answer" value="CSS or JS" /&gt; Next, to make your buttons and question responsive: You can simply use css media-queries to achieve this. First, set your default width, then use css media-queries to change any of your page's elements relative to screen size: /* the default width */ .question input { width: 100px; } /* the width when the screen is &gt;= 700px */ @media (min-width: 700px) { .question input { width:350px; } } Using media-queries, you can take complete control over how the page looks at each screen size you want to target. /* You can get more granular control with orientation targets: */ @media (min-width: 700px) and (orientation: landscape) { .question input { } } See this link for more information on using media-queries. Media-queries are all you need to handle the responsive nature of your form. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bonus: Handling your form data in Javascript / jQuery Your layout design requires that you have the ability to style your buttons in a special way (i.e. text in the middle of an element that appears like a button), but you can't style a radio button to look the way they do in your design, so you will have to "fake it", by using a common technique of turning regular html elements into interactive elements (for example: transforming a regular &lt;div&gt; or &lt;span&gt; into a button by assigning a clickable behavior to it). This is a popular technique used by developers to use CSS and Javascript to get the applicat…

http://stackoverflow.com/comment/44342904
has text: Thanks for the reply. I have another thread on the same code going with a more specific question. I will end this thread and point you to "How to view jpg images with a command line PHP program" thread. thanks
type: AnswerComment
comment on: http://stackoverflow.com/a/27897529
type: Comment
score: 0

http://stackoverflow.com/q/27926955
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44251310
score: 1
has title: Jquery append() not working with angularjs
has comment: http://stackoverflow.com/comment/44251201
type: Question
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27927095
has comment: http://stackoverflow.com/comment/44251176
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/14994391
has body: We are working with jquery 1.9.1 and angular 1.2.13. We are using a wysiwyg editor that works great, we save the html into the database and load the html back using jquery append function and works fine. Now we are trying to append the same html into a div tag (the wysiwyg editor also uses a div) and the append function it's not working. We check in the console, and the string we are trying to append is there, also jquery grabs the element (also checked in the console log) but the append function it's not working. PD: I apologize for my english The html &lt;div data-ng-controller="PreviewCtrl"&gt; &lt;div class="container"&gt; &lt;div id="resumenPreview"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; The controller angular.module('module').controller('PreviewCtrl', ['$scope', '$routeParams', '$location', '$http', 'selectedElement', function ($scope, $routeParams, $location, $http, selectedElement) { $scope.id = $routeParams.id; $scope.mensaje = $scope.id; $scope.imagen = null; $scope.dataImagen = null; //is not working either $('#resumenPreview').append("hola"); $scope.pageLoad = function () { var x = selectedElement.data.Resumen; //This is properly displayed in the console console.log(x); //This too, is displayed in the console log console.log($('#resumenPreview')); // Why this isn't working? I'am clueless $('#resumenPreview').append(x); }; $scope.pageLoad(); }]);
favorite count: 0
accepted answer: http://stackoverflow.com/a/27931156
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44251123
has comment: http://stackoverflow.com/comment/44251351
has comment: http://stackoverflow.com/comment/44251269
has answer: http://stackoverflow.com/a/27931156
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/27927095

http://stackoverflow.com/a/27935261
has body: I would try a different approach. I would place an ajax request (using jQuery.ajax()) within a setInterval loop (every 2 seconds perhaps). If the AJAX request, either http://www.getthisvideoexample.com?whichvideo=id0 // returns a MP4 file ... or http://www.getthisvideoexample.com?whichvideo=id0&amp;webm=true // returns a webm file ... is successful, then clear the interval (clearInterval()), otherwise keep trying until the server responds successfully (you may need to set a method to clear the interval after some time in case the server is not available, otherwise you will end up in an infinity loop) How-to? If the ajax request is successful, then I would build the &lt;video&gt; tag structure with the response and append the tag to a video container (a &lt;div&gt; perhaps) Then I would bind MEJS to the selector of the newly appended tag like : var URL = "http://www.getthisvideoexample.com?whichvideo=id0 "; // request video URL jQuery(document).ready(function ($) { var getVideo = setInterval(function () { $.ajax({ url: URL, cache: false, dataType: "json", // or else success: function (response) { clearInterval(getVideo); // ends loop // build video tag // select proper type, based on response var video = '&lt;video id="video_player" width="320" height="240" controls&gt;' + '&lt;source src="' + response + '" type="video/' + (response.indexOf("webm") == -1 ? 'mp4' : 'webm') + '" /&gt;' + '&lt;/video&gt;'; // target container's selector $("#videoContainer") .html(video) // insert video tag .find("#video_player") // find video selector after insertion // bind MEJS .mediaelementplayer({ // MEJS options }); }, error: function () { // error in ajax, will try again in 2 seconds } }); }, 2000); }); // ready
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27909568

http://stackoverflow.com/a/27894481
has comment: http://stackoverflow.com/comment/44190060
score: 0
accepted answer of: http://stackoverflow.com/q/27894439
type: Answer
answers question: http://stackoverflow.com/q/27894439
has comment: http://stackoverflow.com/comment/44190167
has body: is this the one you want? try use JSON.stringify to convert json object in order to show out http://jsfiddle.net/akpn3/525/
type: AcceptedAnswer

http://stackoverflow.com/comment/44271177
has text: I got `Server Error in '/' Application.`
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27936837

http://stackoverflow.com/comment/44168665
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27883399
has text: heres an update. i added a print to the add method and that functions but the actual adding it to the list doesnt ` public void add() { if (!triangles.contains(this)) { triangles.add(this); } System.out.println(this.b.x); }`

http://stackoverflow.com/comment/44321053
comment on: http://stackoverflow.com/q/27948715
score: 0
has text: The sharepoint masterpage forces IE9.0 to be run in compatibility mode (i.e. IE8) . A common issues seems to be the security level to solve the issue of IE8.0 not working with repond.js But unfortunately unchecking the box "enable protected mode" dit not help in my case
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27880766
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27880516
has body: You could also try to do it with just css and adding a .selected class for you to target. $('.title').each(function(){ $(this).click(function(){ $('.title.selected').removeClass('selected'); // Prevents having multiples selected. $(this).addClass('selected') }); }); $('.post-footer').click(function(){ $('.title').css('background', ''); // Undo css on previous titles $('.title.selected').css('background','red'); });

http://stackoverflow.com/comment/44091427
type: Comment
comment on: http://stackoverflow.com/q/27843833
has text: @AmitJoki unless touch screens now detect when users do that :P
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44176472
has text: Thank you hatzaviv for your quick answer! I am quite noob that is why I asked this noob question. The only thing is that the script is located in the php page, at the bottom. I want to take the value send to php and do something with it. Everything needs to happen in the same page! I have read a little bit about ajax, but honest to be I am looking for the easiest way to do it!
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27887734
type: Comment

http://stackoverflow.com/comment/44165120
type: QuestionComment
has text: Prototypal inheritance doesn't create anything. Angular adds a property to the current scope. It also doesn't matter if the property is a primitive or an object.
comment on: http://stackoverflow.com/q/27881291
score: 0
type: Comment

http://stackoverflow.com/comment/44296229
has text: I tested this on yesterday and this works great. I updated my fiddle http://jsfiddle.net/myyellowshoe/qsL6uyw2/2/
comment on: http://stackoverflow.com/a/27912175
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27938381
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/44273246
has answer: http://stackoverflow.com/a/27939215
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44273236
has answer: http://stackoverflow.com/a/27938459
has comment: http://stackoverflow.com/comment/44273205
upvote count: 4
has body: I'm trying to format an accordion in Foundation (Version 5.5.0), but it's just display the titles of each section without any way of getting to the content below. What am I doing wrong? My html is below: Html Section 1 Content of section 1. Section 2 Content of section 2. Javascript $(document).foundation(); Example
has comment: http://stackoverflow.com/comment/44273192
answer count: 2
downvote count: 4
possible better answer: http://stackoverflow.com/a/27938459
accepted answer: http://stackoverflow.com/a/27939215
tagged with: zurb-foundation
has comment: http://stackoverflow.com/comment/44273382
has comment: http://stackoverflow.com/comment/44273195
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44273238
tagged with: http://stackoverflow.com/tag/html
has title: Accordion not working in Foundation

http://stackoverflow.com/q/27825661
has answer: http://stackoverflow.com/a/28923154
has answer: http://stackoverflow.com/a/61774394
has answer: http://stackoverflow.com/a/27825970
linked to: http://stackoverflow.com/q/11522151
favorite count: 0
has body: I want to make a web app primarily using Python Flask framework as well as AngularJS and whilst thinking about doing so and maintaining features of the application I started wondering how the routing would be handled. In flask it is very easy to manage how the back end directly deals with routing: @app.route('/') def home(): In Angular it is easy to manage routing as well obviously, and the data can be worked with by loading specific controllers in to access certain parts of the back end via XHR and what not. To make a good single page web app would I benefit most from delegating all the routing responsibility to either Flask or Angular, or would it make sense to let Flask handle all the routes with just a /, and let Angular deal with all the hash-routing for changes in that single view. I'm not exactly sure how to tackle and delegate this and I realize there is no one way to do it but I interested to see if anyone has messed with this before and what they found to be easier to work with.
possible better answer: http://stackoverflow.com/a/61774394
has answer: http://stackoverflow.com/a/27845019
accepted answer: http://stackoverflow.com/a/27845019
tagged with: angularjs
tagged with: python
upvote count: 4
answer count: 4
type: AnsweredQuestion
downvote count: 0
has title: Flask and Angular Web Application Routing
type: Question
tagged with: javascript
score: 4
tagged with: flask

http://stackoverflow.com/q/27925705
type: AnsweredQuestion
has body: I have just a single VPS, but i want to host multiple node.js app on it. (like Apache or nginx) I use nginx for proxy but there is a worry sense. You know well; The most important features of Node are I/O non blocking and single threading. If I use this paradigm (nginx proxy), Will I miss this features ? How I can handle this anxiety?
has answer: http://stackoverflow.com/a/27927515
linked to: http://stackoverflow.com/q/1884724
type: Question
has comment: http://stackoverflow.com/comment/44248555
tagged with: javascript
tagged with: express
score: 0
answer count: 1
has title: Host multiple app which has been written by node using just a single server
accepted answer: http://stackoverflow.com/a/27927515
tagged with: node.js

http://stackoverflow.com/comment/44076662
has text: awh man thanks for all the help =[ wasn't able to get it though. I'll give you the upvote anyways for effort. Tried out your code but for some reason it after it randomizes on load when you click it doesnt click to randomize again. You can essentially only click or randomize the page once instead of being able to click through it. Not sure what is wrong with it
comment on: http://stackoverflow.com/a/27834312
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27869606
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/61249071
upvote count: 22
has answer: http://stackoverflow.com/a/27870109
downvote count: 0
has answer: http://stackoverflow.com/a/27869948
favorite count: 0
has comment: http://stackoverflow.com/comment/44141829
has comment: http://stackoverflow.com/comment/44142598
tagged with: utc
has answer: http://stackoverflow.com/a/50346653
has answer: http://stackoverflow.com/a/27870733
has comment: http://stackoverflow.com/comment/44141690
type: AnsweredQuestion
score: 22
has comment: http://stackoverflow.com/comment/44142160
has answer: http://stackoverflow.com/a/61993124
possible better answer: http://stackoverflow.com/a/37711771
accepted answer: http://stackoverflow.com/a/27869948
has comment: http://stackoverflow.com/comment/44142959
has answer: http://stackoverflow.com/a/47816063
linked to: http://stackoverflow.com/q/1056728
has answer: http://stackoverflow.com/a/37711771
type: Question
tagged with: gmt
answer count: 8
has title: Remove time from GMT time format
has body: I am getting a date that comes in GMT format, Fri, 18 Oct 2013 11:38:23 GMT. The problem is that the time is messing up the timeline that I am using. How can I strip out everything except for the actual date?

http://stackoverflow.com/a/27902287
has comment: http://stackoverflow.com/comment/44210592
has comment: http://stackoverflow.com/comment/44207008
has comment: http://stackoverflow.com/comment/44204543
type: Answer
has comment: http://stackoverflow.com/comment/44213152
has comment: http://stackoverflow.com/comment/44209375
has comment: http://stackoverflow.com/comment/44210055
has comment: http://stackoverflow.com/comment/44210833
score: 3
has comment: http://stackoverflow.com/comment/44204644
upvote count: 3
has comment: http://stackoverflow.com/comment/44204294
has body: You need to add a header to output it as json in PHP script: json_encoded_array.php header("Content-type: application/json"); By default PHP will return text/html which is not a valid JSON for $.getJSON() The MIME media type for JSON text is application/json. The default encoding is UTF-8. (Source: RFC 4627).
answers question: http://stackoverflow.com/q/27902181
has comment: http://stackoverflow.com/comment/44208880
has comment: http://stackoverflow.com/comment/44207231
downvote count: 0
has comment: http://stackoverflow.com/comment/44204050
has comment: http://stackoverflow.com/comment/44203992

http://stackoverflow.com/a/27931454
score: 1
has comment: http://stackoverflow.com/comment/44293174
answers question: http://stackoverflow.com/q/27930622
has comment: http://stackoverflow.com/comment/44285369
has body: make sure completions you provide have higher score than default ones. default completers all give score 0, so something like {..., score:100 + (c.score || 0)}; should work
upvote count: 1
type: Answer
downvote count: 0

forex
tags question: http://stackoverflow.com/q/27825384
tag name: forex
type: Tag

http://stackoverflow.com/q/27917442
has title: how to avoid form resets automatically on submit
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44233639
has body: The Source code is below. When i press the submit button. the alert message is shown but immediately after that the form resets all text fieds and i have written an autocomplete jquery for from and to field which doesnt work after reset. Can anyone please guide me to avoid this reset. enter code here &lt;div data-role="content" &gt; &lt;form action="#" name="myform" onsubmit="return validateForm()" method="post"&gt; From:&lt;input id="from" type="text" name="From-busstop"&gt; To:&lt;input id= "to" type="text" name="To-busstop"&gt; &lt;input type="submit" value="Submit" &gt; &lt;/form&gt; &lt;/div&gt; &lt;script&gt; function validateForm() { var x = document.forms["myform"]["from"].value; if (x==null || x=="") { alert("From must be filled out"); return false; } } &lt;/script&gt; oh sorry. i was actually changing the content to be more readible.. i have update the code which i am trying to build
has comment: http://stackoverflow.com/comment/44234737
tagged with: form-submit
has comment: http://stackoverflow.com/comment/44281796
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27917562
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/27943169
has comment: http://stackoverflow.com/comment/44233125
has comment: http://stackoverflow.com/comment/44233163
has comment: http://stackoverflow.com/comment/44281530
has comment: http://stackoverflow.com/comment/44233167
has comment: http://stackoverflow.com/comment/44234227
score: -1
has comment: http://stackoverflow.com/comment/44233716
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/27882456
has body: Add the following HTTP header to your server's response to the get/post queries: Access-Control-Allow-Origin: * For more information: http://enable-cors.org/server.html
type: Answer
answers question: http://stackoverflow.com/q/27882281
score: 0

http://stackoverflow.com/comment/44024025
comment on: http://stackoverflow.com/a/27804094
has text: latlng was defined in Javascript (client), not in PHP. Instead of $latlng you should point to a variable defined in PHP (server) containing the addres "410 Walker Street Lowell MA 01851"
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44070682
type: QuestionComment
comment on: http://stackoverflow.com/q/27832310
has text: My apologies, here it is: http://jsfiddle.net/nmmevtht/
score: 0
type: Comment

http://stackoverflow.com/comment/44072919
type: QuestionComment
score: 0
has text: It was my random guess. My direction was, if you're using Jersey, without enable the `JSONConfiguration.FEATURE_POJO_MAPPING`, you will need to mark the class to be a `XmlRootElement` or else the parser will not able to map the value object properly. For further checking, can you verify from the browser devtool, to check the POST returned a valid JSON object?
comment on: http://stackoverflow.com/q/27833184
type: Comment

http://stackoverflow.com/q/27918579
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29558459
tagged with: aerospike
answer count: 3
tagged with: node.js
favorite count: 0
type: UnansweredQuestion
has title: Any way to use Aerospike LDT (Large data types) from Node.js Client?
upvote count: 1
has body: I am using Node.js aerospike client to access the aerospike server. I wish to use LDTs for storing my data. I know this feature is still not provided by the Node.js client, but is there any way I can achieve this? Thanks in advance! :)
has answer: http://stackoverflow.com/a/32544184
score: 1
type: Question
has answer: http://stackoverflow.com/a/27969080

http://stackoverflow.com/a/27858692
downvote count: 1
answers question: http://stackoverflow.com/q/27858193
score: -1
accepted answer of: http://stackoverflow.com/q/27858193
upvote count: 0
type: AcceptedAnswer
type: Answer
has body: See: http://dojo.telerik.com/OWUvU Kendo UI Snippet Validate The code above adds custom validation in the format you requested. You were using a combination of custom jquery validation script and kendo validation. You need to use the full kendo validation methods, see - http://docs.telerik.com/kendo-ui/api/javascript/ui/validator for the full api.

http://stackoverflow.com/q/27908670
favorite count: 0
has title: How to enable front camera in webview for android
has answer: http://stackoverflow.com/a/28025770
type: UnansweredQuestion
has body: How do you enable the front camera on a Webview? I have enable the features in AndroidManifest.xml &lt;uses-feature android:name="android.hardware.camera" android:required="true" /&gt; &lt;uses-feature android:name="android.hardware.camera.front" android:required="true" /&gt; The camera is not going to be used for taking photos or recording, just to switch on the front camera. When I go to the website using the phone browser the phone camera works once allow the prompt message. How can this work with a webview? In the html file has a Canvas and Video tag that displays webcam It doesn't record or take pictures it just shows you the camera view. Here is the html code &lt;canvas id="inCanvas" width="500" height="500" style="display:none"&gt;&lt;/canvas&gt; &lt;video id="inputVideo" width="100" height="100" autoplay loop &gt;&lt;/video&gt; It work with webcam but not with webview in android.
tagged with: android
tagged with: webview
score: 7
linked to: http://stackoverflow.com/q/8581081
upvote count: 7
has answer: http://stackoverflow.com/a/28024593
type: Question
tagged with: camera
tagged with: javascript
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/a/27873287
has comment: http://stackoverflow.com/comment/44148808
has comment: http://stackoverflow.com/comment/44148752
type: Answer
has comment: http://stackoverflow.com/comment/44148854
accepted answer of: http://stackoverflow.com/q/27873269
has comment: http://stackoverflow.com/comment/44148837
has comment: http://stackoverflow.com/comment/44148782
answers question: http://stackoverflow.com/q/27873269
has comment: http://stackoverflow.com/comment/44148906
has body: You are setting an object, not the source of the image img.src = contact_green;; needs to be img.src = contact_green.src; And you are not setting the image, but the button. showHover(this); needs to be showHover($(this).find("img")[0]); and since you are using jQuery $(window).load(preloader);
has comment: http://stackoverflow.com/comment/44148742
has comment: http://stackoverflow.com/comment/44148775
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/27829700
downvote count: 0
possible better answer: http://stackoverflow.com/a/27830009
tagged with: javascript
has comment: http://stackoverflow.com/comment/44065572
has answer: http://stackoverflow.com/a/27830009
favorite count: 0
score: 2
upvote count: 2
has body: If you look at this code: function supportAggregate(Meanio) { Meanio.prototype.aggregated = function(ext, group, callback) { // Aggregated Data already exists and is ready if (Meanio.Singleton.config.clean.aggregate === false){ return callback(''); } if (aggregated[group][ext].data) return callback(aggregated[group][ext].data); // No aggregated data exists so we will build it sortAggregateAssetsByWeight(); // Returning rebuild data. All from memory so no callback required callback(aggregated[group][ext].data); }; Meanio.prototype.aggregatedsrc = function(ext, group, callback) { // Aggregated Data already exists and is ready if (Meanio.Singleton.config.clean.aggregate !== false){ if(ext==='js'){ if(group==='header'){ return callback(['/modules/aggregated.js?group=header']); }else{ return callback(['/modules/aggregated.js']); } }else if(ext==='css' &amp;&amp; group==='header'){ return callback(['/modules/aggregated.css']); } return callback([]); } if (aggregated[group][ext].src) return callback(aggregated[group][ext].src); // No aggregated data exists so we will build it sortAggregateAssetsByWeight(); // Returning rebuild data. All from memory so no callback required callback(aggregated[group][ext].src); }; // Allows rebuilding aggregated data Meanio.prototype.rebuildAggregated = function() { sortAggregateAssetsByWeight(); }; Meanio.prototype.Module.prototype.aggregateAsset = function(type, asset, options) { options = options || {}; if (!options.inline &amp;&amp; !options.absolute &amp;&amp; !options.url) { asset = path.join(Meanio.modules[this.name].source, this.name, 'public/assets', type, asset); } Meanio.aggregate(type, asset, options, Meanio.Singleton.config.clean); }; Meanio.onModulesFoundAggregate = function(ext, options) { var config = Meanio.Singleton.config.clean; var aggregator = new Aggregator(options, false, config); for (var name in Meanio.modules) { aggregator.readFiles(ext, path.join(process.cwd(), Meanio.modules[name].source, name.toLowerCase(), 'publ…
has title: Can a javascript function be a class and an instance of another object?
has answer: http://stackoverflow.com/a/27829917
tagged with: mean.io
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44065387
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27829917

http://stackoverflow.com/q/27823908
accepted answer: http://stackoverflow.com/a/27956033
has title: Sitecore Pipeline Upload Processor
type: Question
downvote count: 0
tagged with: upload
tagged with: javascript
has comment: http://stackoverflow.com/comment/44060340
favorite count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44059267
has body: I'm using UploadProcessor to block specific file uploading into MediaLibrary. Everything is working good and I can see the alert Sitecore's message. But, Sitecore's error message is not really user-friendly "One or more files could not be uploaded. See the Log file for more details" So, I'd like to add extra alert box for users. Below is my code, but the javascript is not working. Some people want me to use "SheerResponse", but Sitecore Document mentions that The uiUpload pipeline is run not as part of the Sheer event, but as part of the form loading process in response to a post back. This is because the uploaded files are only available during the “real” post back, and not during a Sheer UI event. In this sense, the uiUpload pipeline has not been designed to provide UI. In order to provide feedback to a User, the processor should resort to some trick which emits the JScript code. http://sdn.sitecore.net/Articles/Media/Prevent%20Files%20from%20Uploading/Pipeline%20upload.aspx Do you have any idea how to implement alert box??
tagged with: sitecore
has comment: http://stackoverflow.com/comment/44062611
linked to: http://stackoverflow.com/q/27782405
type: AnsweredQuestion
score: 3
tagged with: alert
has answer: http://stackoverflow.com/a/27956033
upvote count: 3
has comment: http://stackoverflow.com/comment/44055883

http://stackoverflow.com/comment/44164748
type: QuestionComment
has text: Why not remove the stopPropagation and leave it propagate ? You only need that the cssrenderer is a child (or descendant) of the element where you set your canvas
comment on: http://stackoverflow.com/q/27878587
score: 0
type: Comment

http://stackoverflow.com/comment/44211554
type: QuestionComment
score: 0
has text: Do you have some animation with these classes? If yes, please update it with your full animation duration. If not, I don't get what you mean by completely finished. It will run line by line, executing each add/remove class.
comment on: http://stackoverflow.com/q/27906131
type: Comment

http://stackoverflow.com/comment/44071044
type: QuestionComment
comment on: http://stackoverflow.com/q/27832486
score: 0
has text: This is inside an Ionic app, so it's a bit of work to extract the code, but your suggestion worked - I don't fully understand why. If you post it as an answer I'll accept it.
type: Comment

http://stackoverflow.com/comment/44113976
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27854973
has text: @Dave Velocity is a vector. It has a magnitude and a direction. In two dimensions, that alternatively means that it has an X component and a Y component. It's not just a single number.

http://stackoverflow.com/comment/44060468
comment on: http://stackoverflow.com/q/27826877
type: Comment
type: QuestionComment
has text: All we asked for was the higher level problem. You took that far too personally!! Instead of getting a solution, you dug in your heels. raed what an X-Y problem is, this is a classic case
score: 0

http://stackoverflow.com/comment/44231023
has text: There is some problem with jquery mobile and iscroll. When I scroll it should not detect clicking. It is working great if I use readonly list, but when it is button list it is not performing good. It is not smooth scrolling. I have removed jquery css lines which are defining button states and it is not showing change, but the javascript is still detecting it. I would like to disable click detection while scrolling over button list in listview. I think it would solve the problem. When i begin scrolling with finger it is not smooth and when I release finger it becomes smooth until it stops.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27809330
score: 0

http://stackoverflow.com/comment/44149487
comment on: http://stackoverflow.com/a/27873703
has text: @PatrickRoberts According to the [docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.offsetParent) it may be `null`, assuming it's a `HTMLElement` of course.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44094836
type: AnswerComment
score: 2
type: Comment
comment on: http://stackoverflow.com/a/27845475
has text: question wasn't `how to prevent cache`. You haven't answered what was asked

http://stackoverflow.com/comment/106995131
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27963126
has text: @n00dl3 I have an idea of what is going on. If the iframe finishes loading its `src` before the parent executes `/assets/js/build.js`, the handler won't be attached before the `load` event, and thus won't fire. Moving the script inline must have made it execute earlier.

http://stackoverflow.com/comment/44037900
type: Comment
has text: Use first method as you were using and then replace double quotes by following way. search_val = search_val+"\""+div_val_arr[j].replace(" ","")+"\""; search_val=search_val.replace("\"\"","\",\"");
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27814715

http://stackoverflow.com/q/27818618
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27818644
accepted answer: http://stackoverflow.com/a/27818644
has body: For example, I am executing "index.html" Something like this: var filename = $.getFileName(); alert(filename); Is it possible to get "index.html" as result in alert?
has title: How to find out the file name with jQuery?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44042968
type: Question
linked to: http://stackoverflow.com/q/13317276

http://stackoverflow.com/comment/44219193
comment on: http://stackoverflow.com/a/27909899
type: Comment
has text: Definitely a good idea, just didn't want to change code that wasn't relevant to the answer. I would take it a step further and generate a plain text html string and insert/empty all in one step with .html.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27936613
answer count: 3
has title: Converting an to a button onclick
has body: I'm following along with a jquery tutorial that gets initialized with a standard href text link. I have everything working. As the final step, I want to remove the text link and replace it with a button using its click event. Here is my code as it exists right now: //this is the line that I want to replace with a button Log In // notice how that previous line somehow invokes this next section. // this is the part that I don't understand how to do with a button Username: Password Sign in Forgot your password? So, I set up a very simple button, but I have no idea what to put in the onclick event handler. If this were a simple URL link, no problem. I would just write a jquery function (or even just a js function). But in the context of this code, I have no idea how to invoke it. I'm a little out of my depth with this one. Can someone point me in the right direction? Thanks! EDIT: There seems to be some confusion with what I am trying to accomplish, so let me explain. In the existing code, the href on the first line somehow invokes the code contained in the div with the id="login-box" on the next line. I want to achieve the same effect, just with a button instead of a text-based href. Unfortunately, I have never seen code written this way. It works correctly with the href, but I would prefer a button for aesthetic purposes. I tried this, but there is no response, other than from the console: $('#login-form').on('click',function(){ console.log("here"); location.href='#login-box'; }); Let me be clear: I know how to write a button that takes a user to a new web page. This is not taking a user to a new web page. It's a callback to the same html code invoking a different section of it. That's why it is confusing.
has answer: http://stackoverflow.com/a/27936718
has comment: http://stackoverflow.com/comment/44270146
has answer: http://stackoverflow.com/a/27936954
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44270128
has comment: http://stackoverflow.com/comment/44270177
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27936954
type: Question
linked to: http://stackoverflow.com/q/10257551
possible better answer: http://stackoverflow.com/a/27936676
has comment: http://stackoverflow.com/comment/44270193
has answer: http://stackoverflow.com/a/27936676
has comment: http://stackoverflow.com/comment/44270115
score: 0

http://stackoverflow.com/a/29727570
score: 1
has body: You need to wrap the editor initialization like: $(function () { var editor = new MediumEditor('.editable'); }); Otherwise the editable div is not there (DOM not ready) when you init the editor. Or you can put it in the rendered() function in your template like: Template.TEMPLATENAME.rendered = function() { var editor = new MediumEditor('.editable', {}); }; Both tested with meteor 1.1.0.2
downvote count: 0
answers question: http://stackoverflow.com/q/27807762
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44023552
has text: Show me the result in the success call of `console.log(data);`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27806526

http://stackoverflow.com/a/27868548
has comment: http://stackoverflow.com/comment/100456836
accepted answer of: http://stackoverflow.com/q/27864720
has comment: http://stackoverflow.com/comment/75454041
upvote count: 215
score: 204
has comment: http://stackoverflow.com/comment/46040303
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27864720
has body: UPDATE Since new release, it's possible to pass props directly via the Route component, without using a Wrapper. For example, by using render prop. Component: class Greeting extends React.Component { render() { const {text, match: {params}} = this.props; const {name} = params; return ( <React.Fragment> Greeting page {text} {name} </React.Fragment> ); } } Usage: <Greeting text="Hello, " {...props} />} /> Codesandbox Example OLD VERSION My preferred way is wrap the Comments component and pass the wrapper as a route handler. This is your example with changes applied: var Dashboard = require('./Dashboard'); var Comments = require('./Comments'); var CommentsWrapper = React.createClass({ render: function () { return ( <Comments myprop="myvalue"/> ); } }); var Index = React.createClass({ render: function () { return ( Some header <RouteHandler/> ); } }); var routes = ( <DefaultRoute handler={Dashboard}/> ); ReactRouter.run(routes, function (Handler) { React.render(<Handler/>, document.body); });
has comment: http://stackoverflow.com/comment/57111157
has comment: http://stackoverflow.com/comment/122550664
has comment: http://stackoverflow.com/comment/129866222
type: Answer
has comment: http://stackoverflow.com/comment/52857427
has comment: http://stackoverflow.com/comment/95163177
has comment: http://stackoverflow.com/comment/114996303
has comment: http://stackoverflow.com/comment/63233331
has comment: http://stackoverflow.com/comment/71605374
has comment: http://stackoverflow.com/comment/46212898
has comment: http://stackoverflow.com/comment/71647604
has comment: http://stackoverflow.com/comment/86041829
has comment: http://stackoverflow.com/comment/63641504
downvote count: 11

http://stackoverflow.com/comment/44166816
has text: Actually, OP wants a set to contain an array.
comment on: http://stackoverflow.com/a/27882484
score: 0
type: Comment
type: AnswerComment

urlfetch
tags question: http://stackoverflow.com/q/27915571
tag name: urlfetch
type: Tag

http://stackoverflow.com/comment/44140642
comment on: http://stackoverflow.com/q/27869083
type: QuestionComment
has text: are you on mac or linux? I got it worked for mac though.
score: 0
type: Comment

http://stackoverflow.com/comment/45652158
comment on: http://stackoverflow.com/a/28679166
score: 0
type: AnswerComment
has text: I was zooming and panning a little bit, then the layer did appear, but distorted. So I thought it must be related to CSS(the `max-width` is often the source of map-related issues, so I only needed to look if it has been set somewhere)
type: Comment

http://stackoverflow.com/q/27881495
has comment: http://stackoverflow.com/comment/44165928
has body: I have a small question about a script I found and edited. Originally, the script was getting the value from a single input with a specific id. What I need is to send a specific value from multiple divs (those divs are dynamically created from a variable with multiple objects - function colors()). But since it is an itteration, it cannot generate multiple id's for the div in question (actually it could by generating the name of each object as div id - but then the function wouldn't know where to get the values from, am I wrong here?). To be more clear, this is the javascript code: So again, how can I modify the script in order to send the value to the changeColor() function of each generated div in the colors() function whenever one of those divs are clicked?
has answer: http://stackoverflow.com/a/27881683
accepted answer: http://stackoverflow.com/a/27881683
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44164970
has title: Javascript - Passing value to function from multiple divs with same id
score: 0
has comment: http://stackoverflow.com/comment/44164648
tagged with: function
answer count: 1
tagged with: variables
tagged with: jquery
has comment: http://stackoverflow.com/comment/44164622
type: AnsweredQuestion

http://stackoverflow.com/comment/44177480
comment on: http://stackoverflow.com/q/27888274
type: Comment
type: QuestionComment
score: 2
has text: I don't think I've got your question right. What are you trying to achieve?

http://stackoverflow.com/comment/44258748
comment on: http://stackoverflow.com/a/27912011
type: AnswerComment
score: 0
type: Comment
has text: I just i that, but inadvertently made the circle align with the bottom image/text vertically. :(

http://stackoverflow.com/q/27955121
type: Question
has answer: http://stackoverflow.com/a/43820040
has answer: http://stackoverflow.com/a/40234895
answer count: 2
has body: Exactly as it says. I'm attempting to save some data an Express session, and Express is seemingly treating each AJAX request as a separate session, thus not saving my data. On the client $.ajax({ url: '/orders', method: 'post', data: { item: item } }); On the server router.post('/orders', function(req, res) { var sess = req.session, order = sess.order || [], item = req.body.item || '', quantity = req.body.quantity || 1; if (!item) return res.status(404).end(); if (order[item]) { order[item] += quantity; } else { order[item] = quantity; } //save our order to the session req.session.order = order; req.session.save(); console.log(req.session.order); // verified that req.session.order is set return res.status(200).end(); }); This is NOT a CORS request - it's me hitting my local server from a locally running client.
has comment: http://stackoverflow.com/comment/67731719
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/44305222
favorite count: 0
has comment: http://stackoverflow.com/comment/44305291
tagged with: node.js
score: 2
upvote count: 2
has title: Express Session not saving when using $.ajax({});
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44305257
tagged with: javascript
has comment: http://stackoverflow.com/comment/44305739
tagged with: express

http://stackoverflow.com/comment/44041702
has text: IDs are implemented via a fast lookup dictionary in browsers, so it only stores a single DOM element for each ID. This means jQuery ID selectors can only *ever* select the first matching element. Use class instead of IDs for multiple matches.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27817782
score: 0

http://stackoverflow.com/q/27841664
has comment: http://stackoverflow.com/comment/44103215
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/27842760
has comment: http://stackoverflow.com/comment/44088873
has answer: http://stackoverflow.com/a/27842769
has answer: http://stackoverflow.com/a/27842760
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44087334
tagged with: javascript
tagged with: google-maps-api-3
answer count: 2
has comment: http://stackoverflow.com/comment/44087284
score: 2
has comment: http://stackoverflow.com/comment/44103237
favorite count: 0
accepted answer: http://stackoverflow.com/a/27842769
tagged with: google-places-api
has comment: http://stackoverflow.com/comment/44088933
has comment: http://stackoverflow.com/comment/44088175
has body: I have a google maps search field. The input goes to the google places API and I get a result and do a zoom to the boundaries of that place. If the user searches for a country like Norway the map will zoom and center like this: https://www.google.de/maps/place/Norwegen/@64.5783089,17.888237,5z/data=!3m1!4b1!4m2!3m1!1s0x461268458f4de5bf:0xa1b03b9db864d02b but I have the requirement to place a marker into the center so the user sees where his search took him. In the Norway example this would result in a marker being placed in the middle of the screen, but outside of Norway. Is there any possibility to place a marker into a country? EDIT The place json if I search for Norway: { "address_components": [ { "long_name": "Norway", "short_name": "NO", "types": [ "country", "political" ] } ], "adr_address": "Norway", "formatted_address": "Norway", "geometry": { "location": { "k": 60.47202399999999, "D": 8.46894599999996 }, "viewport": { "Ea": { "k": 57.9711417, "j": 71.1854762 }, "wa": { "j": 4.626684800000021, "k": 31.149789199999987 } } }, "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png", "id": "c94d4f99cf5b1f973f837eb189e0cfff6b91fab0", "name": "Norway", "place_id": "ChIJv-VNj0VoEkYRK9BkuJ07sKE", "reference": "CnRpAAAANAQEnqw1T_JMzZwRKpmAX1Yz7vZ83m1zIb20hhZVPnSrTHQN1nELF5mq73UIhsU5HpsvQV3KZWyIaEBu-WoCI0R10koCHxf3zV6FsWeS0d_GsY-rK9a6i4z0MKBSZVNTywLbZBKDIuoiZEIldqmMjxIQ94Ks-CUSOr9ciS0K8TLnmRoUTp5kU7pNMCjEfDZGde6GvYtDLGU", "scope": "GOOGLE", "types": [ "country", "political" ], "url": "https://maps.google.com/maps/place?q=Norway&ftid=0x461268458f4de5bf:0xa1b03b9db864d02b", "html_attributions": [] } google recognizes it as a country and the viewport is used for the bounds, but geometry.location is in Sweden.
type: AnsweredQuestion
has title: Put marker into country from country name
upvote count: 3

http://stackoverflow.com/q/27851772
tagged with: iframe
has comment: http://stackoverflow.com/comment/44107692
type: Question
accepted answer: http://stackoverflow.com/a/27851877
tagged with: fill
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: Located outside the iframe, input into, what value is sent. iframe outside &lt;input id="a_input_id" type="text"&gt; iframe within &lt;a href="javascript:;" class="special_field_link"&gt;@r.SpecialField&lt;a&gt; Javascript Code;(iframe in working) &lt;script&gt; $(function(){ $(".special_field_link").click(function(){ $("#a_input_id").val($(this).text()); }); }); &lt;/script&gt; https://i.sstatic.net/nnjWH.jpg
tagged with: input
has answer: http://stackoverflow.com/a/27851877
type: AnsweredQuestion
has title: Send input data outside the iframe with Jquery

http://stackoverflow.com/comment/44111414
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27853668
has text: are your using asp.net validation control or jquery validation?
score: 0

http://stackoverflow.com/comment/44291053
type: QuestionComment
has text: A tooltip is an [InfoWindow](https://developers.google.com/maps/documentation/javascript/infowindows). More info [here](https://developers.google.com/maps/articles/phpsqlsearch_v3) about querying a database.
comment on: http://stackoverflow.com/q/27940287
score: 0
type: Comment

http://stackoverflow.com/comment/44056778
comment on: http://stackoverflow.com/q/27825506
type: Comment
type: QuestionComment
has text: _“I have no idea what value lastPage is getting”_ – well then disable the redirect, and log that value to console – D’oh!
score: 1

http://stackoverflow.com/q/27906867
upvote count: 10
tagged with: eclipse
has answer: http://stackoverflow.com/a/28006239
answer count: 4
has answer: http://stackoverflow.com/a/37360479
tagged with: eclipse-plugin
has body: I have a large code writing within define(...) as the following format - define(['angular'], function(angular) { function foo () { console.log("Hi") ; } function foo2 () { console.log("Hi") ; } function foo3 () { console.log("Hi") ; } } ) The Eclipse is missing all the outline view output for this format , mean - showing nothing . How to make it supporting this format , mean - direct me to all function and variables declaration ? Here my current outline view is attached -
favorite count: 0
tagged with: angularjs
type: Question
score: 9
has answer: http://stackoverflow.com/a/27966903
tagged with: requirejs
has title: Eclipse - supporting outline view with require.js define(...)
has answer: http://stackoverflow.com/a/31930679
downvote count: 1
has comment: http://stackoverflow.com/comment/50156908
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/44235291
has text: @ Ved this is the pastebin for javascript : http://pastebin.com/ruY5bhhG and for html :http://pastebin.com/sNxK2K4i
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27918043

http://stackoverflow.com/a/27899398
score: 0
type: Answer
has body: This will work once due to the security issues $(function() { $('#btnOpenTab').on('click', function(){ openTab('http://google.com.vn', 'GG'); }); }); function openTab(url, tabNm) { var mTab = window.open("", tabNm); mTab.document.write(' Please wait... '); mTab.document.close(); } It failed to run twice because once the page loads it is no longer same origin. I tried with an iFrame, but Google blocks that too now
has comment: http://stackoverflow.com/comment/44198948
answers question: http://stackoverflow.com/q/27898232
has comment: http://stackoverflow.com/comment/44200017

http://stackoverflow.com/comment/44384878
score: 0
comment on: http://stackoverflow.com/q/27935871
type: Comment
type: QuestionComment
has text: Sincerely wish there was a way to determine, which piece of down syndrome garbage down-voted this

http://stackoverflow.com/q/27810012
accepted answer: http://stackoverflow.com/a/27810135
answer count: 1
downvote count: 0
tagged with: javascript
has body: I am learning Node.js and was looking at the Promise module. I am very new at this so please bare with bad code conventions and stuff. I am trying to build a REST Client API using restify. I have attached my Client Code below: Here is my Client: // local functions function loadResult(err, req, res, obj) { //console.log(err, req, res, obj); var result = { 'err': err, 'text': obj }; console.log(result); return result; } function getClient() { if (client) { return client; } else { client = restify.createJsonClient(options); return client; } }; function RestClient(headers) { if (headers) { global_headers.Authorization = headers.Authorization || global_headers.Authorization; options.headers = global_headers; } }; RestClient.prototype.getClient = getClient; RestClient.prototype.doGET = function doGET(path) { return new Promise(function(resolve) { client.get(path, loadResult); }).then(function(result) { console.log("before final return:" + result); return result; }); }; // exports module.exports = RestClient; In the console when I run the following lines: var Rest = require('./testRest.js'); var restClient = new Rest(); var client = restClient.getClient(); var data = restClient.doGET('/hello/mark'); I can see the result printed just once on the console. But the Data is just what I believe a Promise. Is there a way for me to get the result in data? Also trying to figure out why the result never got printed the second time. P.S.: I tried using Promise.promisifyAll(require('restify')) but it kept throwing some error saying fn is not a function which force use Promise in this way.
favorite count: 0
tagged with: promise
tagged with: node.js
has title: Returning values from Promise(Bluebird) in Node.js
score: 2
type: AnsweredQuestion
tagged with: bluebird
has comment: http://stackoverflow.com/comment/44029314
has answer: http://stackoverflow.com/a/27810135
upvote count: 2
tagged with: restify
type: Question
has comment: http://stackoverflow.com/comment/44028840
has comment: http://stackoverflow.com/comment/44029080

http://stackoverflow.com/comment/52191706
type: Comment
score: 3
comment on: http://stackoverflow.com/a/27954171
type: AnswerComment
has text: You could also use FixedDataTable so that it's never really creating more components than you can see on screen: https://facebook.github.io/fixed-data-table/

selenium
tags question: http://stackoverflow.com/q/27839766
tags question: http://stackoverflow.com/q/27865614
tags question: http://stackoverflow.com/q/27954723
tags question: http://stackoverflow.com/q/27904261
tags question: http://stackoverflow.com/q/27941510
tags question: http://stackoverflow.com/q/27932356
tag name: selenium
tags question: http://stackoverflow.com/q/27866147
tags question: http://stackoverflow.com/q/27804915
tags question: http://stackoverflow.com/q/27934166
tags question: http://stackoverflow.com/q/27832266
tags question: http://stackoverflow.com/q/27910495
tags question: http://stackoverflow.com/q/27841988
tags question: http://stackoverflow.com/q/27921129
tags question: http://stackoverflow.com/q/27813251
tags question: http://stackoverflow.com/q/27954557
tags question: http://stackoverflow.com/q/27928793
tags question: http://stackoverflow.com/q/27809539
type: Tag
tags question: http://stackoverflow.com/q/27838606

http://stackoverflow.com/a/69570564
upvote count: 7
downvote count: 1
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/127918600
has body: use my js function ! it can check JPG,PNG,BMP and so on. /** * @author PiaoZhenJia */ function base64FileHeaderMapper(fileBase64) { let fileHeader = new Map(); //get the first 3 char of base64 fileHeader.set("/9j", "JPG") fileHeader.set("iVB", "PNG") fileHeader.set("Qk0", "BMP") fileHeader.set("SUk", "TIFF") fileHeader.set("JVB", "PDF") fileHeader.set("UEs", "OFD") let res = "" fileHeader.forEach((v, k) =&gt; { if (k == fileBase64.substr(0, 3)) { res = v } }) //if file is not supported if (res == "") { res = "unknown file" } //return map value return res; }
answers question: http://stackoverflow.com/q/27886677

http://stackoverflow.com/comment/44314526
has text: Sorry I forgot to write it TypeError: Cannot read property 'ended' of undefined
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27959205
type: Comment

http://stackoverflow.com/comment/44318996
score: 0
type: Comment
has text: $.noConflict() or jQuery.noConflict() help in those situation where we are using $ and jQuery both, you are adding two different plugins and it might be possible that one of these is using $ and other one jQuery instead of $. It's true that both work in same manner but if both are used then a conflict can occur. Apart from it Change the positions also.
type: AnswerComment
comment on: http://stackoverflow.com/a/27962857

http://stackoverflow.com/a/27946973
has body: I'd need to know more about your use case to be definitively helpful, but from what I'm hearing I think you should consider reorganizing the data. I would organize the data so a document represents a single measurement of a single parameter from a single device at a single moment of time: { "_id" : ObjectId(...), "device_id" : 1, "parameter" : "parameter_one", "measurement" : { // measurement object - whatever this looks like }, "date" : ISODate(...) } To find the equivalent of the last few hundred entries of a device's measurement array, index { "device_id" : 1, "date" : -1 }, then sort by descending date and use limit: db.measurements.find({ "device_id" : 1 }, { "date" : -1 }).limit(691) It's hard to know if this is a useful change for you from what you've described of the use case, though. Why don't you know what a given device measures? What are you doing with the mystery measurements that a device may or may not produce? What is the use going to be of retrieving the last few hundred entries for a mystery parameter for a specific device? I might be able to improve the answer with more information like this. You may end up having to query for the parameters captured by a given device and then using that information to query for the information that you want. At the least, the structure you use above is troubled because it involves multiple arrays growing without bound. This is bad because growing the arrays will cause the document to have to be moved on disk a lot. Forget about indexing the arrays - the performance will be terrible.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44302028
accepted answer of: http://stackoverflow.com/q/27917307
score: 0
answers question: http://stackoverflow.com/q/27917307
type: Answer
has comment: http://stackoverflow.com/comment/44302080

http://stackoverflow.com/a/27820231
answers question: http://stackoverflow.com/q/27819835
score: 5
type: AcceptedAnswer
upvote count: 5
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27819835
has body: make sure it's saved as a .js file, and that javascript syntax is active (ctrl+shift+p -> set-syntax -> javascript)
type: Answer

http://stackoverflow.com/q/27906965
downvote count: 0
tagged with: google-chrome
type: AnsweredQuestion
has body: Has anyone else noticed? Latest Chrome for iOS on iPhone with 8.1.2, the userAgent no longer has the crIOS string in it. Not sure why they got rid of it. It doesn't have "Mobile" in the string anymore either. I guess that's why one should not rely on userAgent... The userAgent I am seeing in Javascript is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10 Where did crIOS go?
score: 4
type: Question
tagged with: ios
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 4
has answer: http://stackoverflow.com/a/27906966
accepted answer: http://stackoverflow.com/a/27906966
has title: Chrome on iOS 8 useragent no longer include crIOS

http://stackoverflow.com/q/27956514
tagged with: coldfusion
has comment: http://stackoverflow.com/comment/44307691
score: 0
type: Question
has title: Facebook Registration Process
has comment: http://stackoverflow.com/comment/44308656
tagged with: javascript
has body: I have been looking for an answer to my Facebook Registration problem for over an hour now and ironically, I cannot seem to find a relevant answer. I am creating a Freelancing Review website that will utilize Facebook for the login process and hopefully the registration process as well. There is plenty of easy to find code on the login process but I am struggling with the registration process. I came across the following a URL (https://developers.facebook.com/docs/plugins/registration/v1.0) that described a Facebook Registration Plugin. However, this feature is deprecated and will be removed as of April 30, 2015 so this is not really a solution to my problem. The deprecation notice links another URL (https://developers.facebook.com/docs/facebook-login/v2.2) describing the Facebook Login feature. The problem with this is that if the user does not have a Facebook account, then the user is never prompted to create one after clicking the Facebook Login button. If the user has a Facebook account, it works great. Freelancers come from all parts of the world and I do not know how many of them have Facebook accounts. I would like to allow those particular Freelancers who do not have a Facebook account an easy way to create one without leaving my review website. Ideally, I would want to avoid redirecting them to Facebook to create an account even with a new tab window; I would like to use some JavaScript SDK, a ColdFusion based SDK, or even a PHP based SDK to get the Facebook Registration working. So in a nutshell, how do I allow Facebook Registration for new Facebook users on my website without redirecting them to Facebook itself now that the Facebook Registration Plugin has been removed? Thanks in advance for any information!
tagged with: facebook-graph-api
answer count: 0
type: UnansweredQuestion
tagged with: facebook
tagged with: php

http://stackoverflow.com/q/27898982
upvote count: 2
has title: javascript function doesn't call in internal page on link click yii CListView
tagged with: clistview
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27900407
type: Question
has body: i am using CListView in my one of form. i used CHtml::link in one of column. and its html is like this &lt;a class="text-dark" value="31" href="javascript:void(0)" title="You received a new message"&gt; and onclick of this link i called one javascript function following function $('a.text-dark').click(function() { var id = $(this).attr('value'); $.ajax({ type:'POST', url:'&lt;?php echo Yii::app()-&gt;createUrl('/mailbox/message/View') ?&gt;/id/'+id, success:function(data){ }, error:function(data){ alert('Your data has not been submitted..Please try again'); } }); }); My main issue is on first page it works perfect. function is called perfectly. but whenever i click on next button from pagination and click on this link. function is not called. Except One page any page doesn't call function. What is problem?
tagged with: yii
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27900407
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/44227530
type: QuestionComment
type: Comment
has text: The example at http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/spline-irregular-time/ expressed my exact problem. Thank you all!
comment on: http://stackoverflow.com/q/27902898
score: 0

angularjs-ng-repeat
tags question: http://stackoverflow.com/q/27953048
tags question: http://stackoverflow.com/q/27895904
tags question: http://stackoverflow.com/q/27926341
tags question: http://stackoverflow.com/q/27937606
tags question: http://stackoverflow.com/q/27850469
tags question: http://stackoverflow.com/q/27911055
type: Tag
tags question: http://stackoverflow.com/q/27936572
tags question: http://stackoverflow.com/q/27845670
tags question: http://stackoverflow.com/q/27893950
tags question: http://stackoverflow.com/q/27958163
tags question: http://stackoverflow.com/q/27813079
tags question: http://stackoverflow.com/q/27862197
tags question: http://stackoverflow.com/q/27870654
tag name: angularjs-ng-repeat
tags question: http://stackoverflow.com/q/27838027
tags question: http://stackoverflow.com/q/27942011
tags question: http://stackoverflow.com/q/27848139
tags question: http://stackoverflow.com/q/27952772
tags question: http://stackoverflow.com/q/27830310
tags question: http://stackoverflow.com/q/27959156
tags question: http://stackoverflow.com/q/27865804

http://stackoverflow.com/comment/44256183
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27929376
has text: @KoenHoeijmakers Actually, according to [the documentation](http://api.jquery.com/jquery.ajax/) `data` can be an object, a string, or an array.

http://stackoverflow.com/q/27843746
tagged with: jquery
has title: onblur event on table td
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44092527
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27844921
upvote count: 1
has comment: http://stackoverflow.com/comment/44092499
score: 1
has answer: http://stackoverflow.com/a/27846089
type: Question
linked to: http://stackoverflow.com/q/12486399
has body: I am using the code below to populate data using data table. I want to edit data on one of the column and after editing I have to validate the value using onblur event. I tried calling onblur event on td element but didn't get it . Any help to achive this is greatly appreciated. Part Number Quantity <c:forEach items="${uploadData.partsList}" var="part"> <c:out value="${part.partNumber}" /> <c:out value="${part.quantity}"/> </c:forEach>
has answer: http://stackoverflow.com/a/27848066
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27854481
has comment: http://stackoverflow.com/comment/44112925
has comment: http://stackoverflow.com/comment/44112967
has body: $(document).ready(function() { $("#checkbox").click(function() { if ($(this).is(":checked")) { $("#dropdown").prop("disabled", true); } else { $("#dropdown").prop("disabled", false); } }); }); http://jsfiddle.net/3opdcf8c/1/
upvote count: 2
has comment: http://stackoverflow.com/comment/44112585
has comment: http://stackoverflow.com/comment/44113101
type: Answer
has comment: http://stackoverflow.com/comment/44112840
answers question: http://stackoverflow.com/q/27854446
has comment: http://stackoverflow.com/comment/44113930
has comment: http://stackoverflow.com/comment/44112986
score: 2
downvote count: 0

http://stackoverflow.com/comment/44179755
comment on: http://stackoverflow.com/q/27888595
type: Comment
type: QuestionComment
score: 0
has text: Can you post an example? [This](http://jsfiddle.net/6u1c7e3j/) example based on what you posted works fine for me.

http://stackoverflow.com/comment/44232650
type: AnswerComment
has text: Search &nbsp;
type: Comment
comment on: http://stackoverflow.com/a/27917015
score: 0

http://stackoverflow.com/comment/44154207
type: Comment
type: AnswerComment
score: 0
has text: Accepting this answer as the most descriptive. As for my problem, it was resolved when I wrote this code outside of one of my functions
comment on: http://stackoverflow.com/a/27872284

http://stackoverflow.com/q/27852767
has answer: http://stackoverflow.com/a/27852821
tagged with: jquery
favorite count: 0
has title: Values are float numbers but still `NaN`
has answer: http://stackoverflow.com/a/27852880
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44109754
has comment: http://stackoverflow.com/comment/44109556
has comment: http://stackoverflow.com/comment/44109641
score: 1
upvote count: 1
type: Question
has body: I keep getting a Nan, is there some missing part in my code? The values that I have are pure float numbers, like, 79.00, 12.00 etc. Besides, I have written a long version of this code before, and I get the right answer but when I changed it to this shorter one, it gives me a NaN long-version of the code function tblcheckboxes(){ var a, b, c ... v = 0; if ($('#tcbx1').is(":checked")) { a = parseFloat($("#tcbx1").val(), 10); } if ($('#tcbx2').is(":checked")) { b = parseFloat($("#tcbx2").val(), 10); } if ($('#tcbx3').is(":checked")) { c = parseFloat($("#tcbx3").val(), 10); } ... ... ... if ($('#tcbx23').is(":checked")) { v = parseFloat($("#tcbx23").val(), 10); } var total = a + b + c ... + v; $('.txt7').val(total.toFixed(2)); } $(document).ready(function(){ $('#tcbx1').click(function(){ tblcheckboxes(); }); $('#tcbx2').click(function(){ tblcheckboxes(); }); $('#tcbx3').click(function(){ tblcheckboxes(); }); ... ... ... $('#tcbx23').click(function(){ tblcheckboxes(); }); }); currently codes function tblcheckboxes() { var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v = 0; var vars = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v]; // store in an array for easier access var total = 0; // initialize total so it can be added while looping through the elements for(var x = 1; x &lt;= 23; x++) { if($("#tcbx" + x).is(":checked")) { vars[x - 1] = parseFloat($("#tcbx" + x).val(), 10); } total = parseFloat($(total).val(), 10) + vars[x - 1]; } $(".txt7").val(total.toFixed(2)); } $(document).ready(function() { for(var i = 1; i &lt;= 23; i++) { $("#tcbx" + i).click(function() { tblcheckboxes(); grandtotal(); }); } }); $(":checkbox").on("change", function() { //change input #grandtotal value according check/uncheck checkboxes $(".txt7").val(function() { //declare a variable to keep the sum of the values var sum = 0; //using an iterator find and sum the values of checked checkboxes $(":checkbox:checked").each(function() { sum = parseFloat($(sum).va…
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/44109569
has answer: http://stackoverflow.com/a/27852931
downvote count: 0

http://stackoverflow.com/a/27903815
has comment: http://stackoverflow.com/comment/44228481
has comment: http://stackoverflow.com/comment/44229650
has comment: http://stackoverflow.com/comment/44212363
has comment: http://stackoverflow.com/comment/44228615
has comment: http://stackoverflow.com/comment/44209585
has comment: http://stackoverflow.com/comment/44228664
has comment: http://stackoverflow.com/comment/44229117
score: 4
answers question: http://stackoverflow.com/q/27903747
type: Answer
has comment: http://stackoverflow.com/comment/44232531
upvote count: 4
has comment: http://stackoverflow.com/comment/44228928
has body: This: host : "http://192.168.6.120/", should be: host : "192.168.6.120",.
downvote count: 0

http://stackoverflow.com/comment/60222326
type: Comment
comment on: http://stackoverflow.com/a/27959429
score: 0
has text: +1. Was searching where to get the API key and found this: http://stackoverflow.com/a/21866500/440646. How does anyone get to know that only this key works?
type: AnswerComment

http://stackoverflow.com/a/27936006
downvote count: 0
has comment: http://stackoverflow.com/comment/44269335
has body: You need to throw and object (with name and message properties) instead of a string to generate a custom exception: function abc(sender, args) { alert('ex2'); throw { name: 'YourErrorName', message: 'YourErrorMessage' }; alert(''); } Here is a sample of how to raise the event and catch the exception which contains your name and message values: function triggerError(){ throw { name: 'YourErrorName', message: 'YourErrorMessage' }; }; (function cathError(){ try { triggerError(); } catch(e){ console.log(e.message); console.log(e.name); } }()); Check out this codepen to see it working.
upvote count: 2
has comment: http://stackoverflow.com/comment/44269338
answers question: http://stackoverflow.com/q/27935497
type: Answer
score: 2

http://stackoverflow.com/comment/47593207
has text: Don't understand the upvotes here - ` ` obviously is a HTML5 element that does not need an identifier. Furthermore, four of the same selectors in a row could easily be chained for cleaner code.
comment on: http://stackoverflow.com/a/27842231
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44087448
score: 0
type: Comment
type: QuestionComment
has text: ` ok ` Oops sory, i was setting it in HTML tab, i'm trying js tab now
comment on: http://stackoverflow.com/q/27841400

http://stackoverflow.com/comment/44192007
has text: You're trying to focus on multiple objects on `ready()`. Also it's hard to tell without seeing what you've got for HTML code.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27895544
type: QuestionComment

http://stackoverflow.com/comment/87992095
type: AnswerComment
has text: @mondjunge for the default skin, the CKEditor builder does an optimization and inlines javascript logic into `ckeditor.js` - that's why you don't see this file in a built package.
type: Comment
comment on: http://stackoverflow.com/a/27885856
score: 1

http://stackoverflow.com/a/27852203
answers question: http://stackoverflow.com/q/27843047
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
has body: if you use the @ binding, you might have to use $watch like this: $scope.$watch(function(){ return attrs.hasFocus; }, function(val) { $scope.hasFocus = val; }); if that doesn't work, or if you prefer two-way binding with =: &lt;menu has-focus="true" &gt;&lt;/menu&gt; and .directive('menu', function() { restrict : 'E', templateUrl : 'partials/menu-left.html', replace : true, scope : { hasFocus : '=' }, link : function( $scope, element, attrs ) { // $scope.hasFocus holds true/false } }) I think two-way binding is better especially with booleans because if you only need it to control how the DOM looks, you might not even need to watch for a change, you'd just have to plug in $scope.hasFocus into the DOM somewhere (ng-show, ng-switch, etc.) EDIT: yes, I just noticed your template, so if you use two-way binding (=) you don't need the watch
score: 2
accepted answer of: http://stackoverflow.com/q/27843047

http://stackoverflow.com/a/27941554
type: Answer
answers question: http://stackoverflow.com/q/27941401
score: 0
has body: Add id attribute to your input.

http://stackoverflow.com/q/27836196
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44077114
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27836539
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Limit the minimum size of html5 video
type: AnsweredQuestion
has body: I have the following html on a html5 video: &lt;video id="video1" autoplay&gt; &lt;source src="static/video/5986637.mp4" type="video/mp4"/&gt; Your browser does not support the video tag. &lt;/video&gt; css: video { width: 100% !important; height: auto !important; position:fixed; } I want to keep the width and height in such css until the height of the video is smaller than a certain value. After smaller than a certain value, the height will remain unchanged while the width will still keep 100%. So what I should do in CSS/Javascript? Thanks.
accepted answer: http://stackoverflow.com/a/27836539
score: 1

http://stackoverflow.com/comment/44117970
score: 0
type: Comment
has text: you can put it right under the script tag, the content of a noscript tag is displayed if a user has javascript deactivated, so it makes no sense to have it inside a script tag, got it ?
type: AnswerComment
comment on: http://stackoverflow.com/a/27841818

http://stackoverflow.com/a/27882593
has body: What you're looking for is actually very simple – recursion. The below code checks if all numbers are larger than or equal to 2 and will return false on first non-matching number. var x = { b: 5, c: { d: 3, e: [1, 2, 3], f: function() {} }, g: function() {} }; var recurse = function(a) { var s = true; for (prop in a) { switch (typeof a[prop]) { case "number": //Check for conditions here console.log("found number " + a[prop]); if (a[prop] &lt; 2) { return false; } break; case "object": if (a[prop] !== null) { s = s &amp;&amp; recurse(a[prop]); } break; default: break; } } return s; } recurse(x);
has comment: http://stackoverflow.com/comment/44166986
score: 0
answers question: http://stackoverflow.com/q/27882448
has comment: http://stackoverflow.com/comment/44166959
type: Answer

http://stackoverflow.com/comment/44207540
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27904102
has text: just so i can understand better ... you have an html editor ... and when you hit save you want the content of that editor to be stored as an html page ? where you visitors can open ?

http://stackoverflow.com/comment/44316782
has text: There are no errors in the console. It's simply not swapping the image for the default.png - rather, it leaves the original src in the element.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27961650
score: 0

http://stackoverflow.com/q/27925357
downvote count: 0
tagged with: jquery
tagged with: callback
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44281762
has comment: http://stackoverflow.com/comment/44282917
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44248027
has comment: http://stackoverflow.com/comment/44282672
answer count: 0
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/4368946
type: Question
tagged with: conditional-statements
has title: Multiple functions with one callback jQuery - without setTimeout
has comment: http://stackoverflow.com/comment/44277880
tagged with: javascript
has comment: http://stackoverflow.com/comment/44276089
has body: The problem: I need a single callback after executing three functions of the form $(#myid).load() But I can't get this to work without using setTimeout() While my knowledge of jQuery promises / deferreds is, to be charitable, limited I believe the solution is in a simple use of jQuery's $.when().then() functionality as advertised on Javascript Callback and multiple ajax Request single callback jQuery Here's my code: $.when( SetSelect('AJAXSetSelect.asp',valTable,'RECALBodySum'), SetSelect('AJAXSetSelect.asp',valTable,'RECALCol1'), SetSelect('AJAXSetSelect.asp',valTable,'RECALRow1') ) .then( function() { // success setTimeout(function(){ $("#OutputAdvanced").load("/_RECAL/Modes/AdvancedCrosstab.asp", { "RECALtable":$('#RECALtable').children().val(), "RECALCol1":$('#RECALCol1').children().val(), "RECALRow1":$('#RECALRow1').children().val(), "RECALBodySum":$('#RECALBodySum').children().val() } ); // close load }, 500) // why do we need 500 ms delay? , // finished "success" fn, now "failure fn function () {SF('failure'); // this is actually a simple alert } // failure ); // close then In summary the code makes three AJAX calls, each populating one SELECT box. When they're complete it populates the area #OutputAdvanced, depending on the values of the three SELECTs. I had thought that the whole point of the $.when().then() construct is that code within the then() is only run once the when() is complete. I shouldn't have to introduce a delay with setTimeout. I've built a jsFiddle, but this is only a synchronous example and wasn't illuminating enough for me. I'm also aware of frameworks such as asyncJS, but I believe that it's over the top for what I want to achieve. It didn't work in my specific example, and I really want to understand what I'm missing to build on my expertise - not just "solve the problem" - I did this using setTimeout. UPDATE 1 14 Jan - following research: The last jQuery example at api.jquery.com/jQuery.when/ is as follows: $.when( $.ajax( "/page1.php" …
has comment: http://stackoverflow.com/comment/44276039
has comment: http://stackoverflow.com/comment/44251749

http://stackoverflow.com/a/27932827
upvote count: 4
answers question: http://stackoverflow.com/q/27932791
score: 4
downvote count: 0
has body: Try calling syntax: &lt;function_name&gt;(&lt;arguments&gt;), so in your case: x() or: alert(x()) to display the output.
type: Answer

http://stackoverflow.com/q/27884222
downvote count: 1
has title: Combine all paragraphs to make a single paragraph
has comment: http://stackoverflow.com/comment/44170886
has answer: http://stackoverflow.com/a/27884287
has comment: http://stackoverflow.com/comment/44171643
has comment: http://stackoverflow.com/comment/44170803
has answer: http://stackoverflow.com/a/27884579
has comment: http://stackoverflow.com/comment/44170489
tagged with: dom
possible better answer: http://stackoverflow.com/a/27884287
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44170584
tagged with: javascript
tagged with: jquery
score: 1
has comment: http://stackoverflow.com/comment/44170548
favorite count: 0
has body: I have a requirement, I get many something inside #postrightcolumn. I would like to combine all paragraphs into single one. Here an example:- line 1 line 2 I would like to turn it: line 1 line 2 Here is jQuery I'm using which doesn't help: I need to know how to call a function in each single loop ends so that I can display combined paragraph.
type: Question
accepted answer: http://stackoverflow.com/a/27884579
has comment: http://stackoverflow.com/comment/44170135
has comment: http://stackoverflow.com/comment/44170465
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44170492
has comment: http://stackoverflow.com/comment/44170927
has comment: http://stackoverflow.com/comment/44170537
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/27884401

http://stackoverflow.com/comment/44293318
score: 0
comment on: http://stackoverflow.com/a/27949176
type: Comment
has text: `iframe` elements don't have JavaScript ; ).
type: AnswerComment

http://stackoverflow.com/comment/44182940
comment on: http://stackoverflow.com/q/27890619
has text: Please try what Paul suggested below.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27819399
tagged with: jquery
has comment: http://stackoverflow.com/comment/44045367
has comment: http://stackoverflow.com/comment/44045138
has comment: http://stackoverflow.com/comment/44046452
has comment: http://stackoverflow.com/comment/44045196
has comment: http://stackoverflow.com/comment/44046397
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I'm creating a website which needs to be responsive, no problem here as I know how that's being done, but I also need to change the display based on the size of the screen, and this must be done dynamiccly and thus I cannot use media queries (I think). I'm open to all options: pure css, html, javascript, jQuery, ... I have a website which looks like the the following: This is looking already good, now, when I resize the window to make it smaller, the background will dissapear, and this is achieved based on a CSS3 media query: #OfficeUI { min-height: 52px; background: url('../Images/Application/Backgrounds/Circuit.png') no-repeat scroll right top rgba(0, 0, 0, 0); color: #444; font-family: 'Segoe UI'; font-size: 0.75em; overflow: hidden; } @media screen and (max-width: 497px) { #OfficeUI { background-image: none; } } So far, so good, but now the real problem does show up. When I resize the window to a very small portion of what it is right now, the website does behave like this: In this particular case, the text 'Inbox - user...' is moving over the icons. What I would like to have here is that the area of the icons is made smaller, meaning that the most right icon will not be showed anymore. If I further resize the window, the area can shrink again so again an icon is removed. But the problem here is that I don't have any control over the content which is displayed, there might be 6 icons and there might a very long title, or vice versa. The only idea I can up with, not implemented in a solution is the following (jQuery): Calculate the width of the Window. Calculate the width of the title area. Calculate the width of the icons area. On resizing the window, I would implement them something like this: If the size of the icons area and the size of the title area is larger than the window size, then shrink the icons area with a specified amount of pixels (predefined) so that 1 image is removed and repeat that on every resize. The only problem that I do have with this sol…
tagged with: css
has comment: http://stackoverflow.com/comment/44045248
has comment: http://stackoverflow.com/comment/44045737
has comment: http://stackoverflow.com/comment/44044675
type: Question
has title: Making the content adapt when changing the screen size
tagged with: javascript
has answer: http://stackoverflow.com/a/27820718
has comment: http://stackoverflow.com/comment/44044556
has comment: http://stackoverflow.com/comment/44045272
has comment: http://stackoverflow.com/comment/44045807
score: 0
has comment: http://stackoverflow.com/comment/44044598
answer count: 1

http://stackoverflow.com/q/27930037
accepted answer: http://stackoverflow.com/a/37101195
answer count: 2
has comment: http://stackoverflow.com/comment/46629708
tagged with: javascript
has comment: http://stackoverflow.com/comment/44271490
has answer: http://stackoverflow.com/a/37101195
has body: I know this is not going to be foolproof because an offset isn't specific to a timezone, but with location data it seems like it would be possible to make an educated guess. Basically, I would like to be able to take an object similar to this: { offset: -5, location: 'America' } ...and get back either a single or multiple matching time zones, which would be: ['America/Montreal', 'America/New_York', ...] One solution I can think of is iterating through the zone data provided by moment-timezone, but that just doesn't seem like an elegant way to get this info. Any ideas?
favorite count: 0
has answer: http://stackoverflow.com/a/29066851
tagged with: timezone
has comment: http://stackoverflow.com/comment/44262004
upvote count: 4
has comment: http://stackoverflow.com/comment/44257573
tagged with: momentjs
type: AnsweredQuestion
downvote count: 0
has title: Guesstimate time zone from time offset with JavaScript and Moment.js
type: Question
possible better answer: http://stackoverflow.com/a/29066851
score: 4

http://stackoverflow.com/a/27812978
accepted answer of: http://stackoverflow.com/q/27812497
score: 2
answers question: http://stackoverflow.com/q/27812497
has body: Try var count = $.inArray($("[data-foo]").filter(".active").data("foo") , $.map($("[data-foo]"), function(el, i) { return Number(el.attributes["data-foo"].value) }).sort(function(a, b) { return a - b })); $(".count").html(count); var count = $.inArray($("[data-foo]").filter(".active").data("foo"), $.map($("[data-foo]"), function(el, i) { return Number(el.attributes["data-foo"].value) }).sort(function(a, b) { return a - b })); $(".count").html(count); // +1 ?
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/27957533
answer count: 1
accepted answer: http://stackoverflow.com/a/27957568
has body: My web application is built in Flask (DIY web framework for Python) and I would like to include my user's location on a map with our other assets. I have not built applications on either android or iPhone. I am unclear as to the scope of this task. stack: CentOS6, Python, Flask, Twilio, and anything the user's browser is capable of (?)
tagged with: android
has title: Is it possible for a web-based application to somehow access a smartphone's location ? And report back?
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/27957568
tagged with: javascript
tagged with: google-maps-api-3
tagged with: iphone

http://stackoverflow.com/a/27855102
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27854926
downvote count: 0
score: 1
has body: I understand now what you are trying to achieve, so please ignore what I wrote before. formElement.submit() and its jQuery equivalent very deliberately do not trigger an onsumbit event. Othwise there is the potential for infinite recursion. Therefore, you cannot execute $('form').submit(); and hope for an onsubmit handler to intercept. Your best bet is probably your "dirty" idea. Namely to trigger a click on a (hidden) type="submit" button.

http://stackoverflow.com/comment/44082430
type: Comment
has text: only if x > 5, make it 1. It could be 0.7, 0.8 or 1.8.
comment on: http://stackoverflow.com/q/27839272
score: 0
type: QuestionComment

sharepoint
tags question: http://stackoverflow.com/q/27853452
tags question: http://stackoverflow.com/q/27825888
tags question: http://stackoverflow.com/q/27841189
tag name: sharepoint
tags question: http://stackoverflow.com/q/27924899
tags question: http://stackoverflow.com/q/27940896
tags question: http://stackoverflow.com/q/27884795
tags question: http://stackoverflow.com/q/27896404
tags question: http://stackoverflow.com/q/27842010
tags question: http://stackoverflow.com/q/27911283
type: Tag

http://stackoverflow.com/q/27901567
type: UnansweredQuestion
score: 0
has body: I currently have a dropdown list... to finish blank sentences off. The problem I have is Uncaught TypeError: Cannot read property 'options' of null Here is a snippet of my HTML Question 3 A partnership is a business entity Please Select... sole trader members shareholders run limited company owned by two ore more people who carry a business collectively with a view to making a profit. JavaScript var dropDownList = { answers: ['sole trader', 'members', 'shareholders', 'run', 'limited company', 'owned'], checkAnswer: function() { var check = document.getElementById('selectionOne'); if(check.options == dropDownList.answers[5]) { console.log('The answer is right!'); } else { console.log('false') } } }; dropDownList.checkAnswer(); Could anyone please help me? Thank You
has answer: http://stackoverflow.com/a/27901710
upvote count: 1
tagged with: forms
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44202614
has comment: http://stackoverflow.com/comment/44202617
has comment: http://stackoverflow.com/comment/44202632
tagged with: javascript
has title: JavaScript Interacting with options
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/q/27863927
has comment: http://stackoverflow.com/comment/44130166
has comment: http://stackoverflow.com/comment/44130136
type: Question
has comment: http://stackoverflow.com/comment/44130782
has comment: http://stackoverflow.com/comment/44130078
has answer: http://stackoverflow.com/a/27994665
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27864195
has title: Does failing to load a remote javascript file stop javascript execution in any browsers?
has answer: http://stackoverflow.com/a/28083324
accepted answer: http://stackoverflow.com/a/28083324
has body: I've got a stand alone script file that I want to load from a 3rd party server: There's a small chance the remote script won't be there sometimes (404), and I want to be sure that including this script doesn't affect how my app operates, since my app doesn't require the script to be loaded to work (it's an analytics tracker of sorts) Can I include this script safely without it blocking or causing javascript errors in my app that stops other javascript from running? I was thinking of adding the async and defer attributes to make the script load lazily. Is this enough? My app needs to work on IE8 and above. Here's what I'm thinking right now:
favorite count: 0
has answer: http://stackoverflow.com/a/27864195
has comment: http://stackoverflow.com/comment/44137923
answer count: 4
has comment: http://stackoverflow.com/comment/44130255
score: 11
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27994544
upvote count: 11

http://stackoverflow.com/comment/44212710
score: 0
type: Comment
has text: @ShahidGhafoor — See the first line of my answer.
type: QuestionComment
comment on: http://stackoverflow.com/q/27905978

http://stackoverflow.com/comment/44209250
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27904836
has text: Learn to use the [`document object methods`](https://developer.mozilla.org/en-US/docs/Web/API/document) and then use [`JSON.parse`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on the JSON text to get a javascript object, then access as normal.

http://stackoverflow.com/comment/77803565
type: Comment
comment on: http://stackoverflow.com/a/40410661
score: 12
type: AnswerComment
has text: Using factory functions is a valid alternative to using classes that facilitates the creation of private/public methods. If a future reader does not find solutions using classes satisfactory, I think it will be valuable for them to know that they have an alternative that solves the problem.

http://stackoverflow.com/comment/44196151
comment on: http://stackoverflow.com/a/27897781
score: 0
type: AnswerComment
type: Comment
has text: Sorry to butt in here, but this is only an "anti-pattern" if your scripts aren't operating in what I would call a "responsible" way. Using modules, dependency management, event listeners, and watching for document ready (or the specific elements you need) will resolve this issue. Not only does it solve the issue of content not being ready, but it also promotes reusable, maintainable, future-proof code. The head is the right place for script tags, but they have to be written defensively.

http://stackoverflow.com/a/27880679
has comment: http://stackoverflow.com/comment/44162961
has body: There's nothing wrong with using a global variable when it's necessary. What's wrong is the overuse of global variables when passing the value (or reference) as a function parameter is more appropriate. That's not your case though since the click handler on $(.post-footer) is triggered independently and does not share variable scope with the click handlers of $(.title) It's not clear what you're trying to achieve with your code. But it's completely alright to use a global variable to mark which div was clicked the last. If that's what you're shooting for. I would just suggest declaring and defining the global variable first: var titleThis = null;
upvote count: 1
answers question: http://stackoverflow.com/q/27880516
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44182673
has text: If you get no output at all, then you did something wrong in following the instructions provided. You should at least get a console log statement that the app is listening on whatever port you set it to.
type: QuestionComment
comment on: http://stackoverflow.com/q/27890811
score: 1
type: Comment

http://stackoverflow.com/a/27905938
downvote count: 0
has comment: http://stackoverflow.com/comment/44211987
type: Answer
has body: Pass the original handler to off. Make sure you're passing the original and not a new anonymous function that just looks the same. This means you'll need to store it. var handler = function(event){ #1 }; $(document).on('keypress', handler); $(document).off('keypress', handler);
accepted answer of: http://stackoverflow.com/q/27905911
upvote count: 3
has comment: http://stackoverflow.com/comment/44211205
answers question: http://stackoverflow.com/q/27905911
score: 3
has comment: http://stackoverflow.com/comment/44211147
type: AcceptedAnswer

http://stackoverflow.com/a/27960767
has body: It's not possible to signal a particular php process as such, you have to take another system for help: unix socket - angular WS opens a socket, and sends its path to the job WS, waits on data available from the socket. Job WS writes into the socket once it is done. inotify - angular WS waits for file being created in some path message queue system (eg RabbitMQ) - angular WS subscribes to an event, which is triggered by job WS
answers question: http://stackoverflow.com/q/27960064
score: 0
type: Answer

http://stackoverflow.com/comment/44110917
comment on: http://stackoverflow.com/a/27853432
score: 1
has text: Arbitrarily using a regular expression to replace markup in a page using the innerHTML property is not a particularly good idea. It will remove every event listener added by *addEventListener* and may have other undesirable consequences.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27949872
downvote count: 0
has comment: http://stackoverflow.com/comment/44295888
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/44341657
upvote count: 1
type: Question
tagged with: mongodb
tagged with: javascript
has title: Filepicker Implementation Meteor
has body: I am currently trying to use filepicker on my Meteor project. I have been able to successfully show the pick a file button via front end, click, load the filepicker widget and upload a file. I am using the free storage with 5000 images. Filpicker confirms I have uploaded 30 files already. I am not sure how to get the URL and store it on my mongo DB. I am very new to development. I am using Coffee script. This is what I have: Initializing: Template.MyTemplate.rendered = () -&gt; filepicker.setKey("AouIUs8H6RnuPwHB5gqOyz") filepicker.constructWidget(document.getElementById('attachment')) Event Handler: Template.MyTemplate.events 'change #attachment': () -&gt; console.log "attachment changed" HTML &lt;div class="dataEntry"&gt; Your File &lt;input type="filepicker" id="attachment"/&gt; &lt;/div&gt; Not sure how to see the returned URL for the file and how to store it. I would much appreciate your support. As I mentioned I am new to this so if possible when in doubt don't assume I know. Thanks! - M

http://stackoverflow.com/q/27853781
type: Question
has answer: http://stackoverflow.com/a/27854242
has answer: http://stackoverflow.com/a/27854632
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44112487
has comment: http://stackoverflow.com/comment/44111447
has comment: http://stackoverflow.com/comment/44111839
score: 0
has comment: http://stackoverflow.com/comment/44111573
answer count: 3
has comment: http://stackoverflow.com/comment/44112314
tagged with: validation
has comment: http://stackoverflow.com/comment/44111653
has answer: http://stackoverflow.com/a/27854030
has body: I want a validation that only allows alphanumeric characters,backspace,delete,space and special characters which can change the text box value from Kyeboard.I have tried like $('#profile_pstate').on('keypress',function(e1){ var cntry_key = e1.which; if(cntry_key == 8 || cntry_key == 46 || cntry_key == 32 || (cntry_key &gt;= 48 &amp;&amp; cntry_key &lt;= 57) || (cntry_key &gt;= 65 &amp;&amp; cntry_key &lt;= 90)) { // For Backspace, Delete, Space, Numbers and Alphabets alert('success'); } }); But for the special characters how can I add them.If I add them manually they are not in a proper range like alphabets and numeric.Could you please suggest me a way to do it or even a correct way to do the validation.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44111815
has comment: http://stackoverflow.com/comment/44112536
has title: Validation to check whether the textbox value is changed or not

http://stackoverflow.com/comment/44276421
has text: this is not a homework , I use `$.each` to display all my object into the view. I need `result2` for condition , if `totaldays` is equal to `result2` , some of the `html` will display
type: AnswerComment
comment on: http://stackoverflow.com/a/27939970
score: 0
type: Comment

http://stackoverflow.com/a/27978673
upvote count: 1
answers question: http://stackoverflow.com/q/27884740
score: 1
downvote count: 0
has body: I agree with @saimeunt, you shouldn't be manipulating the DOM with jQuery like this. You should look at having a wrapper for adding modal templates to the DOM, and providing data. However, if you wanted to just make your code work, you can. Basically you want to delay the update to #txtNewInputFormula until after the next flush. 'click #btnEditInput': -&gt; formula = this.formula Tracker.afterFlush -&gt; $('#txtNewInputFormula').val(formula) return $('#txtNewInputName').val(name) $('#ddlNewInputType').val(this.inputType).change() $('#addInputModal').modal() return
type: Answer

http://stackoverflow.com/q/27805250
has answer: http://stackoverflow.com/a/28096646
tagged with: google-apps-script
answer count: 2
accepted answer: http://stackoverflow.com/a/28096646
downvote count: 0
possible better answer: http://stackoverflow.com/a/27805842
has answer: http://stackoverflow.com/a/27805842
favorite count: 0
has comment: http://stackoverflow.com/comment/44376072
type: AnsweredQuestion
score: 1
has body: I'm using this code to get a blob passed to a function: function submit(e){ var arrayBlob = e.parameter.arrayBlob; Logger.log("arrayBlob #2 = " + arrayBlob.getDataAsString()); This is the error I get: Execution failed: TypeError: Can not find getDataAsString function in the Blob object.'arrayBlob' How do I get the string value of this blob? Here is my code: function showList(folderID) { var folder = DocsList.getFolderById(folderID); var files = folder.getFiles(); var arrayList = []; for (var file in files) { file = files[file]; var thesesName = file.getName(); var thesesId = file.getId(); var thesesDoc = DocumentApp.openById(thesesId); for (var child = 0; child &lt; thesesDoc.getNumChildren(); child++){ var thesesFirstParagraph = thesesDoc.getChild(child); var thesesType = thesesFirstParagraph.getText(); if (thesesType != ''){ var newArray = [thesesName, thesesType, thesesId]; arrayList.push(newArray); break; } } } arrayList.sort(); var result = userProperties.getProperty('savedArray'); arrayList = JSON.stringify(arrayList); var arrayBlob = Utilities.newBlob(arrayList); Logger.log("arrayBlob #1 = " + arrayBlob.getDataAsString()); // Here it`s OK var mydoc = SpreadsheetApp.getActiveSpreadsheet(); var app = UiApp.createApplication().setWidth(550).setHeight(450); var panel = app.createVerticalPanel() .setId('panel'); panel.add(app.createHidden('arrayBlob', arrayBlob)); var label = app.createLabel("Selecione os itens desejados").setStyleAttribute("fontSize", 18); app.add(label); arrayList = JSON.parse(arrayList); panel.add(app.createHidden('checkbox_total', arrayList.length)); for(var i = 0; i &lt; arrayList.length; i++){ var checkbox = app.createCheckBox().setName('checkbox_isChecked_'+i).setText(arrayList[i][0]); Logger.log("arrayList[i][0] = " + arrayList[i][0]); Logger.log("arrayList[i] ====&gt; " + arrayList[i]); panel.add(checkbox); } var handler = app.createServerHandler('submit').addCallbackElement(panel); panel.add(app.createButton('Submit', handler)); var scro…
has comment: http://stackoverflow.com/comment/44377334
upvote count: 1
type: Question
tagged with: blob
tagged with: google-sheets
has title: Get String Value of Blob Passed to e.parameter in Apps Script
tagged with: javascript

http://stackoverflow.com/comment/44144919
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27871073
has text: Thank you so much works like a charm. I kinnda felt i had to do something with this.parentNode.parentNode but didn't know what exactly haha :D and btw since you called the parentNode twice then it's targeting the am i right? Thanks again
score: 0

http://stackoverflow.com/comment/44069494
comment on: http://stackoverflow.com/q/27831733
score: 4
has text: `extend` extends the object, it doesn't create a new instance. I think the only (and right) way to do this, is to create a new Animal, instead of copying the old animal.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44288618
score: 2
comment on: http://stackoverflow.com/q/27946859
has text: Exactly how did you do that? (The right way is `&copy;` or `&#169;`)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44027498
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27805246
score: 0
has text: @KimGysen I didn't define any events originally on the OrderView, however, once I discovered that the FormView wasn't responding to the click of the `submitButton` id (which is in the form-template), I experimented by seeing if the view surrounding the form-template (i.e.OrderView) was responding to the events, and, as I noted in the OP, it was. However, I didn't include that in the code for OrderView because I was just testing, it's not what I want. If an `id` in the form-template is clicked, I want to respond to it in the FormView (which renders the form-template). Clear now?

http://stackoverflow.com/comment/44206159
score: 0
type: AnswerComment
type: Comment
has text: I don't see Project facets in the tree of the project properties windows. I've searched a little and could not find anything specific. Do you know why might this happen?
comment on: http://stackoverflow.com/a/27903403

http://stackoverflow.com/q/27807668
tagged with: angularjs
type: Question
score: 0
answer count: 1
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/27808211
has title: Testing ng-change with Jasmine test?
has body: I am using this directive to delay the ng-change function from being called. I am forced to use Angular 1.2.4 so I don't have the option of using debounce. I just needed some help writing tests for this. I think I need to trigger the ng-change somehow in a Jasmine test, but can't figure it out. Here is what I have so far: describe('ng delay', function() { var html = '&lt;input type="text" ng-model="model" ng-change="change()" ng-delay="500" /&gt;'; beforeEach(inject(function($injector) { $compile = $injector.get('$compile'); $timeout = $injector.get('$timeout'); $scope = $injector.get('$rootScope').$new(); $scope.model = ''; $scope.change = function() { console.log('change'); }); })); it('should have a 500ms delay', function() { var elm = compileFunction(html, $scope), input = elm.find('input'); input.trigger('input'); }); }); The change function isn't being called, however. Just any thoughts on how to test this would be a real help.
tagged with: javascript
type: UnansweredQuestion
tagged with: jasmine

http://stackoverflow.com/q/27835400
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/44075599
accepted answer: http://stackoverflow.com/a/27835745
answer count: 3
has comment: http://stackoverflow.com/comment/79537217
downvote count: 0
favorite count: 0
has title: Call function after page was loaded in new tab
linked to: http://stackoverflow.com/q/2614520
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44075736
has body: After clicking on the button i need to open some link in new tab, and than after the page would be loaded, I need to programmatically perform some actions on this page (like clicking on proper GUI elements etc). For example this code should open in new tab http://stackoverflow.com and after that click on "Tags": Click Me! but the function document.getElementById('nav-tags').click() does not call.
has answer: http://stackoverflow.com/a/27835474
has comment: http://stackoverflow.com/comment/44075855
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27835745
upvote count: 3
possible better answer: http://stackoverflow.com/a/27835474
linked to: http://stackoverflow.com/q/4079280
has answer: http://stackoverflow.com/a/27835514
type: Question

http://stackoverflow.com/comment/44112925
comment on: http://stackoverflow.com/a/27854481
type: Comment
score: 0
has text: In select box read only will not work. so i had used disabled= true, Then i want to change it to disabled= false using jquery or java script.i had used document.getElementById("selectboxId").readOnly = false; and $("#selectboxId").prop("disabled", true); this is not working in my code
type: AnswerComment

http://stackoverflow.com/comment/44094910
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27845479
score: 2
has text: Properties on the prototype are **shared** by all instances. Properties you assign to `this` in the constructor are distinct. You can set function-valued properties in the constructor, and you can set non-function-valued properties on the prototype.

http://stackoverflow.com/comment/44032092
type: QuestionComment
type: Comment
has text: i need an output of subtotal = product1 + product2
comment on: http://stackoverflow.com/q/27812234
score: 0

http://stackoverflow.com/comment/44169783
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27876857
type: Comment
has text: did you talk about directive ??

http://stackoverflow.com/comment/44146915
type: Comment
type: QuestionComment
has text: No because if not handlebars will not compile id...
comment on: http://stackoverflow.com/q/27872193
score: 0

http://stackoverflow.com/a/27889019
type: AcceptedAnswer
has body: When you assign something to an array, like this tempArray[1] = ... you are actually mutating the array object. So, no matter how many times you mutate it, it is the same object. And when you do, stronglyAgree.push(tempArray); ... agree.push(tempArray); ... disagree.push(tempArray); ... stronglyDisagree.push(tempArray); ... na.push(tempArray); You are pushing a reference to the same array object to all the other array objects. Instead, create a new array object whenever you are pushing, like this stronglyAgree.push(tempArray.slice()); ... agree.push(tempArray.slice()); ... disagree.push(tempArray.slice()); ... stronglyDisagree.push(tempArray.slice()); ... na.push(tempArray.slice()); Now, a copy of the array is created everytime slice is called and the changes to tempArray will no more affect the arrays in the other arrays. Note: The array objects created by slice are shallow copied arrays. So, if tempArray has a mutable object and if it is mutated with the sliced object, the changes would still be reflected in other array objects.
type: Answer
upvote count: 4
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/27888968
answers question: http://stackoverflow.com/q/27888968

http://stackoverflow.com/q/27949549
has comment: http://stackoverflow.com/comment/44294347
downvote count: 1
type: Question
has title: why inputs preserve value in angular js
has comment: http://stackoverflow.com/comment/44294534
has comment: http://stackoverflow.com/comment/44294387
has comment: http://stackoverflow.com/comment/44294402
tagged with: javascript
has comment: http://stackoverflow.com/comment/44294167
score: -1
has comment: http://stackoverflow.com/comment/44294514
accepted answer: http://stackoverflow.com/a/27949910
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44294471
has body: i am working on angularjs. i have strange issue. i have 5 inputs i am updating these inputs using angularjs. problem is this when i am making manual changes in any input then angularjs is not updating these manual updated inputs. i am using inputs followings ways. &lt;input type="text" name="name" id="emp.name" value="{{employee.name}}"/&gt; and &lt;input type="text" id="emp.name" name="name" ng-model="employee.name"/&gt; but nothing works. anyone knows why after manuall modification angularjs not updating value of input Please see screenshot: The following code is where I am attempting to empty the data. $scope.$apply(function($scope){ $scope.showDetail = true; $scope.employee = {}; });
favorite count: 0
has comment: http://stackoverflow.com/comment/44294229
has answer: http://stackoverflow.com/a/27949910
has comment: http://stackoverflow.com/comment/44294361
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44294271
has comment: http://stackoverflow.com/comment/44294794
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44294603

http://stackoverflow.com/a/27935168
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27935108
has comment: http://stackoverflow.com/comment/44305969
upvote count: 2
has body: You can't have variables in HTML, You can do something like bellow Have a placeholder for year in your HTML. &lt;p class="text-muted"&gt;&amp;copy; {{YEAR}}. XTeam&lt;/p&gt; and update that placeholder using javascript window.onload = function(){ var date = new Date(); var para = document.getElementsByClassName('text-muted')[0]; para.textContent = para.textContent.replace('{{YEAR}}',date.getFullYear()); } DEMO
has comment: http://stackoverflow.com/comment/44343471

http://stackoverflow.com/q/27899989
tagged with: google-chrome
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45649820
score: 1
upvote count: 1
has body: I set up a google map with country overlay through fusion table layer functionality. Works perfectly here: http://codepen.io/anon/pen/ZYLPNO function loadMap() { var script = document.createElement('script'); script.type = 'text/javascript'; //script.src = 'http://maps.googleapis.com/maps/api/js?v=3.exp&amp;key=' + settings.api_key + '&amp;' + 'callback=initMap'; script.src = 'http://maps.googleapis.com/maps/api/js?v=3.exp' + '&amp;' + 'callback=initMap'; document.body.appendChild(script); } initMap = function() { var google = window.google || {}; var c_map = new google.maps.Map(document.getElementById('map-canvas'), { center: new google.maps.LatLng(30,0), zoom: 2, disableDefaultUI: true, mapTypeId: google.maps.MapTypeId.ROADMAP }); var world_geometry = new google.maps.FusionTablesLayer({ query: { select: 'geometry', from: '1N2LBk4JHwWpOY4d9fobIn27lfnZ5MDy-NoqqRpk', where: "Name IN ('Russia','France')" }, styles: [{ where: "Name = 'France'", markerOptions: { iconName: 'red_circle' }, polygonOptions: { fillColor: '#EB6841', fillOpacity: 0.3 } }, { where: "Name = 'Russia'", polygonOptions: { fillColor: '#00A0B0', fillOpacity: 0.5 } }], map: c_map, suppressInfoWindows: true }); google.maps.event.addListener(world_geometry, 'click', function(e) { document.location.href = document.location.protocol + '//' + document.location.host + '/countries/' + e.row.Name.value.toLowerCase(); }); }; loadMap(); #map-canvas, html, body { height: 200px; width: 300px; color: #000; font-family: 'Open Sans', sans-serif; z-index: 2; box-sizing: border-box; word-wrap: break-word; font-size: 20px; font-style: normal; font-weight: normal; height: 300px; line-height: 30px; box-shadow: 0px 3px 5px 0 #333 } &lt;div id="map-canvas"&gt;&lt;/div&gt; But the same code embeded into my site is working in Firefox (windows, mac, android), Safari (iOS, Mac), IE11 (Windows) but does NOT work on Chrome (Mac, Windows, Android). There are no javascript errors, map just displays without overlay. I even tried to…
type: Question
accepted answer: http://stackoverflow.com/a/28679166
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44203470
has comment: http://stackoverflow.com/comment/44203521
has title: Google Maps JS APi v3 fusion table layer is not working in Chrome
has comment: http://stackoverflow.com/comment/44203337
has comment: http://stackoverflow.com/comment/45651408
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/28679166
answer count: 1
has comment: http://stackoverflow.com/comment/45649896
favorite count: 0
has comment: http://stackoverflow.com/comment/44203403
has comment: http://stackoverflow.com/comment/45649390
has comment: http://stackoverflow.com/comment/44233684

http://stackoverflow.com/a/27895080
has comment: http://stackoverflow.com/comment/44198306
has body: You could simply move your database queries, to inside the callback of the hash, so that when the hash call back is ready it would then save it. var bcrypt = require('bcrypt'); app.post('/api/users', function(req, res) { bcrypt.genSalt(10, function(err, salt) { bcrypt.hash(req.body.password, salt, function(err, hash) { var newUser = new User({ email: req.body.email, name: req.body.name, password: hash }); newUser.save(function(err) { if(!err) { return res.send({ status: 'User created' }); } else { if(err.name == 'ValidationError') { res.statusCode = 400; res.send({ error: 'Bad Request' }); } else { res.statusCode = 500; res.send({ error: 'Internal Server Error' }); } } }); }); }); }); Or use the synchronous call of bcrypt.hashSync but synchronous is not good practice when trying to work with Node. But it could be like password: bcrypt.hashSync(req.body.password, salt) If I understand correctly what you're asking, you want to save the user, after the password is hashed?
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27894827
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27894827

http://stackoverflow.com/comment/44163287
has text: (I'm ignoring pre-loading initial data to prevent the appearance of an unpopulated template, which is a bit more advanced than where we seem to be at the moment.)
score: 0
comment on: http://stackoverflow.com/q/27880249
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44248584
comment on: http://stackoverflow.com/a/27844928
has text: I'm not sure what you mean by width. My screen size? I've added an image of your fiddle to illustrate my comments.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44039006
type: QuestionComment
comment on: http://stackoverflow.com/q/27816201
has text: There is couple ways of doing that. You can use some plugin or you can manually open popup and load FLASH via ajax call.
score: 0
type: Comment

http://stackoverflow.com/comment/44018979
type: Comment
has text: i will read about the removeClass function. i was not aware of it. Thank you
comment on: http://stackoverflow.com/a/27804895
score: 0
type: AnswerComment

http://stackoverflow.com/q/27904102
accepted answer: http://stackoverflow.com/a/27904453
favorite count: 0
has comment: http://stackoverflow.com/comment/44207810
tagged with: php
has comment: http://stackoverflow.com/comment/44207792
has comment: http://stackoverflow.com/comment/44208104
has comment: http://stackoverflow.com/comment/44207540
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/9758738
has title: How to save the content of a div to your site using php
downvote count: 1
has answer: http://stackoverflow.com/a/27904453
type: Question
has comment: http://stackoverflow.com/comment/44207664
upvote count: 0
has comment: http://stackoverflow.com/comment/44207698
tagged with: javascript
tagged with: jquery
score: -1
linked to: http://stackoverflow.com/q/3775281
tagged with: ob-get-contents
has comment: http://stackoverflow.com/comment/44207689
has comment: http://stackoverflow.com/comment/44207560
has body: I have developed a HTML editor using codemirror. I am now searching for a way to let users save the code what is inside the div to the site's server, so they can view their site. I searched on the internet and found this on the internet: &lt;?php // Start the buffering // ob_start(); ?&gt; Your page content bla bla bla bla ... &lt;?php echo '1'; // Get the content that is in the buffer and put it in your file // file_put_contents('yourpage.html', ob_get_contents()); ?&gt; Source: Save current page as HTML to server But now i am on a point: how can i save the content of the div into a html file on my server? I searched and found that on the line where it saids: "your page content bla bla bla bla" you have to use "", but it doesn't work. I am new to php so help is appreciated. Thanks in advance
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/a/27902668
type: Answer
answers question: http://stackoverflow.com/q/27889528
accepted answer of: http://stackoverflow.com/q/27889528
score: 0
type: AcceptedAnswer
has body: No it isn't I'm afraid. I often have to build APEX pages that work when Javascript is disabled and one of the limitations that imposes is: only 1 submit button per page. There is no way to get the Request value of the button that submits the page when Javascript is disabled, so if you have more than one they will be indistinguishable.

http://stackoverflow.com/comment/44268072
score: 0
comment on: http://stackoverflow.com/q/27935280
has text: @adamdc78 that result didn't come out for me, but its helpful thanks!
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27836760
has body: I think it would be better if you wrote it like this: $('.links li').each(function(d) { console.log("Width: "+$(this).width()) });
accepted answer of: http://stackoverflow.com/q/27836700
type: AcceptedAnswer
downvote count: 0
score: 6
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/27836700

http://stackoverflow.com/q/27931920
type: Question
has answer: http://stackoverflow.com/a/27932543
has comment: http://stackoverflow.com/comment/44263563
has comment: http://stackoverflow.com/comment/44261606
has comment: http://stackoverflow.com/comment/44261707
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44261747
has comment: http://stackoverflow.com/comment/44262190
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44264069
has comment: http://stackoverflow.com/comment/44262395
has comment: http://stackoverflow.com/comment/44263840
has comment: http://stackoverflow.com/comment/44262078
has comment: http://stackoverflow.com/comment/44261390
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/44264104
has title: jquery is not outputting
has comment: http://stackoverflow.com/comment/44261814
has comment: http://stackoverflow.com/comment/44262100
has comment: http://stackoverflow.com/comment/44261947
has comment: http://stackoverflow.com/comment/44261760
has body: Hi i am trying to output something from a php file with jquery.. the php file contains a if else statement and im able to output what is in the if part, but when the logic goes to the else part nothing is outputed. im getting confused. here is the jquery code: $(document).ready(function(){ $('#submitNewExam').click(function(e){ e.preventDefault(); var newExam = $('#newExam').val(); if ($.trim(newExam) != ''){ $.post('functions/addExam.php', { newExam: newExam }, function(data){ $('#notify').html(data); $('.alert').toggle(); }); } $('.add').toggle(); }); }); and the php code: include ('resources/addExamClass.php'); if(isset($_POST['newExam'])){ if(preg_match('/(&lt;|&gt;|"|%3c|%3e|%22)/', $_POST['newExam'])){ echo "illegal characters found !!!"; } else { $newExam = new addExam(); $newExam-&gt;CQuiz($_POST['newExam']); echo "correct"; } } if the preg_match match i can see in the developer tools/network that there is 200 ok and jquery gets the response. if preg_match doesnt macth i can see a 302 and then 404.
has comment: http://stackoverflow.com/comment/44262573

http://stackoverflow.com/comment/73321877
score: 0
has text: Did you put your actual password for your gmail as the value? I don't want to put my password anywhere, not even an environment variable
type: Comment
comment on: http://stackoverflow.com/a/27843898
type: AnswerComment

http://stackoverflow.com/comment/44096163
score: 0
has text: Not exactly sure what is or isn't working or what the goals are, or what you expect from this `resize`
type: Comment
comment on: http://stackoverflow.com/q/27846057
type: QuestionComment

http://stackoverflow.com/comment/44275038
type: Comment
type: QuestionComment
has text: Question is not clear about context, could you explain more about what you want achieve and code snippet.
comment on: http://stackoverflow.com/q/27939318
score: 0

http://stackoverflow.com/comment/44163326
type: Comment
comment on: http://stackoverflow.com/a/27879585
has text: Why don't you show how that would work and how the callers of the other functions would know when the other functions were done and how you'd propagate and handle errors from the initialization. I really don't think you should try to hide the async behavior from the caller. The caller needs to know when something is async so they can program accordingly.
type: AnswerComment
score: 0

http://stackoverflow.com/a/34400318
type: AcceptedAnswer
downvote count: 0
has body: I solved the problem with a single slider http://jsfiddle.net/5znhaabw/ onSlideNext: function (eSlide, iIndPrev, iIndCur) { var eSlideCur = eSlide.children(), eSlidePrev = eSlide.prev().children(); if (iIndCur == 0) { eSlidePrev = eSlide.siblings().last().prev().children(); eSlideCur = eSlide.siblings().last().children().add(eSlide.children()); }; eSlideCur.stop().css('opacity', 0).delay(350).animate({opacity: 1}, 300); eSlidePrev.stop().animate({opacity: 0}, 300); }, onSlidePrev: function (eSlide, iIndPrev, iIndCur) { var eSlideCur = eSlide.children(), eSlidePrev = eSlide.next().children(); if (iIndCur == eSlide.siblings().andSelf().length - 2 - 1) { eSlidePrev = eSlide.siblings().first().next().children(); eSlideCur = eSlide.siblings().first().children().add(eSlide.children()); }; eSlideCur.stop().css('opacity', 0).delay(350).animate({opacity: 1}, 300); eSlidePrev.stop().animate({opacity: 0}, 300); } I think you can use onSlideBefore()
type: Answer
accepted answer of: http://stackoverflow.com/q/27876429
score: 1
answers question: http://stackoverflow.com/q/27876429
upvote count: 1

http://stackoverflow.com/comment/44099562
type: QuestionComment
comment on: http://stackoverflow.com/q/27847616
has text: @pzeszko I see. That's an odd programing choice tbh. I know some sites like facebook flash messages at you via the title, and I've always found it weird. Adeneo has a good solution for this if you want to completely stop it. But still, interesting question :P
score: 0
type: Comment

http://stackoverflow.com/comment/44068113
type: QuestionComment
has text: I fixed your snippet to work ;-p
score: 0
comment on: http://stackoverflow.com/q/27831034
type: Comment

http://stackoverflow.com/q/27878267
has body: I am trying to create a google chart that has has a dashboard, much like: https://google-developers.appspot.com/chart/interactive/docs/gallery/controls , The issue I am having is that my data is the wrong format and I dont know why. Here is the code. I believe it has something to do with google.visualization.DataTable and google.visualization.arrayToDataTable Thank you for the help! PHP $result = $conn-&gt;query("SELECT date, ebay_sales, amazon_sales, ssllc_sales FROM stayingsharpllc_.sales WHERE date &gt; '2014-09-01' GROUP BY date ORDER BY date asc LIMIT 2;" ); $rows = array(); $table = array(); $table['cols'] = array( // Labels for your chart, these represent the column titles. /* note that one column is in "string" format and another one is in "number" format as pie chart only required "numbers" for calculating percentage and string will be used for Slice title */ array('label' =&gt; 'Date', 'type' =&gt; 'string'), array('label' =&gt; 'eBay Sales', 'type' =&gt; 'number'), array('label' =&gt; 'Amazon Sales', 'type' =&gt; 'number'), array('label' =&gt; 'SSLLC Sales', 'type' =&gt; 'number') ); /* Extract the information from $result */ foreach($result as $r) { $temp = array(); // the following line will be used to slice the Pie chart $temp[] = array('v' =&gt; (string) $r['date']); // Values of each slice $temp[] = array('v' =&gt; (int) $r['ebay_sales']); $temp[] = array('v' =&gt; (int) $r['amazon_sales']); $temp[] = array('v' =&gt; (int) $r['ssllc_sales']); $rows[] = array('c' =&gt; $temp); } $table['rows'] = $rows; // convert data into JSON format $jsonTable = json_encode($table); //echo $jsonTable; } catch(PDOException $e) { echo 'ERROR: ' . $e-&gt;getMessage(); } ?&gt; Here is the chart code // dashboard google.load('visualization', '1.0', {'packages':['controls']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawDashboard); // Callback that creates and populates a data table, // instantiates a dashboard, a ran…
type: Question
has answer: http://stackoverflow.com/a/29157679
has answer: http://stackoverflow.com/a/29150193
answer count: 2
tagged with: php
score: 0
tagged with: http://stackoverflow.com/tag/json
has title: Using PHP, JSON and google.visualization.DataTable to create a google dashboard chart
tagged with: google-visualization
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/a/28085224
answers question: http://stackoverflow.com/q/27918372
accepted answer of: http://stackoverflow.com/q/27918372
upvote count: 2
type: AcceptedAnswer
has body: Have you installed ace stream recently and included browser plugins? I have seen this error in chrome where the extension for AS Magic Player is enabled.
type: Answer
downvote count: 0
score: 2

http://stackoverflow.com/comment/44231909
has text: Are you doing `node test.js` then running `node test2.js`?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27916600
type: Comment

http://stackoverflow.com/comment/44107715
comment on: http://stackoverflow.com/q/27851747
type: QuestionComment
type: Comment
has text: I've tried with underscore but without success. I need tto change every null value in this array with empty string.
score: 0

http://stackoverflow.com/comment/44251123
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27926955
has text: This is not the proper way to work with angular. Why are you mixing jQuery with it? There should never be any DOM manipulation done in angular controller

http://stackoverflow.com/comment/44257404
type: AnswerComment
has text: I have added some images. Tell me if you need more info to understand the facts.
type: Comment
comment on: http://stackoverflow.com/a/27925949
score: 0

http://stackoverflow.com/comment/44238183
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27862988
has text: It's the latest, version 4.1.7.

http://stackoverflow.com/a/27930726
accepted answer of: http://stackoverflow.com/q/27930515
answers question: http://stackoverflow.com/q/27930515
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: As mentioned in my commment above, you do not need the first ajax request as you can get this information from the request headers (PHP Example below) from your AJAX request. To make sure that your website(s) have jQuery loaded you can run a check in your script and load it in dynamically. Using some code from this answer. See below for an example: // Anonymous "self-invoking" function (function() { // Load the script var script = document.createElement("SCRIPT"); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; script.type = 'text/javascript'; document.getElementsByTagName("head")[0].appendChild(script); // Poll for jQuery to come into existance var checkReady = function(callback) { if (window.jQuery) { callback(jQuery); } else { window.setTimeout(function() { checkReady(callback); }, 100); } }; // Start polling... checkReady(function($) { var url = "Url_to my server hosted on a different domain"; var data = {number:"1286", ip: ip_address}; $.ajax({ url: url, type: "POST", dataType: 'json', crossDomain: true, data: {data: data}, success: function (data) {console.log(JSON.stringify(data));}, error: function (xhr, error) {console.log("There was an error and data was not posted."); }); }); })(); To get the IP Address from your ajax request: (PHP) Source if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; }
score: 2
upvote count: 2

http://stackoverflow.com/a/27825970
answers question: http://stackoverflow.com/q/27825661
type: Answer
has body: It depends on how you want to structure your app I suppose. To me it makes sense, if you consider your entire website one app, to allow Angular to handle all the client endpoints, and use Python as a RESTful service. However, if you have any static content that you want to render server side outside of your SPA, then you could do that routing in Python.
score: 0

http://stackoverflow.com/comment/44278373
type: AnswerComment
score: 0
type: Comment
has text: @ng_developer Good! However be aware that the solution you picked is not the best in terms of best practices: you should not mix jQuery and angular code.
comment on: http://stackoverflow.com/a/27940951

http://stackoverflow.com/comment/44114691
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27855442
has text: No. we got a requirement like this. Is it possible to display the normal text-areas first and on clicking on the link "Show as editor" CKEditors will be shown?

http://stackoverflow.com/q/27872003
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27872056
has title: Add class when element reaches top of viewport
type: AnsweredQuestion
upvote count: 5
type: Question
score: 5
has answer: http://stackoverflow.com/a/27872056
has body: I am trying to add a class to the header when an element reaches the top of the viewport but I cannot seem to find out why it is not working. I have no errors and I have checked to see that jquery is fetching the offsets and it is. Any help would be great. I would also like to know how to extend this code to any number of section's rather than stating just 6. JS FIDDLE $(document).ready(function () { var project1 = $('section:nth-child(1)').offset(); var project2 = $('section:nth-child(2)').offset(); var project3 = $('section:nth-child(3)').offset(); var project4 = $('section:nth-child(4)').offset(); var project5 = $('section:nth-child(5)').offset(); var project6 = $('section:nth-child(6)').offset(); var $window = $(window); $window.scroll(function () { if ($window.scrollTop() &gt;= project1) { $("header").removeClass().addClass("project1"); } if ($window.scrollTop() &gt;= project2) { $("header").removeClass().addClass("project2"); } if ($window.scrollTop() &gt;= project3) { $("header").removeClass().addClass("project3"); } if ($window.scrollTop() &gt;= project4) { $("header").removeClass().addClass("project4"); } if ($window.scrollTop() &gt;= project5) { $("header").removeClass().addClass("project5"); } if ($window.scrollTop() &gt;= project6) { $("header").removeClass().addClass("project6"); } }); });
answer count: 1

http://stackoverflow.com/q/27831421
type: Question
has title: Iron Router Not Rendering Template in Yield
upvote count: 1
has comment: http://stackoverflow.com/comment/44076290
answer count: 1
tagged with: meteor
favorite count: 0
tagged with: iron-router
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27843041
score: 1
has comment: http://stackoverflow.com/comment/44088339
has body: So I love Meteor, but have had several issues with Iron Router. This time it seems I can't get Iron Router to render a template into the yield region. Initially everything renders fine, but when I click a link to go home ({{pathFor ...}} the URL changes, but nothing changes in the view. This is very weird since I have checked that it is calling the route and I have explicitly written and tested this.render('...') to try to force it to render the template I want (this does not work). Furthermore it renders properly once the page is reloaded with the changed URL (i.e. it renders the home page). Any help would be much appreciated. Thanks! Here is router.js(updated): Router.configure({ layoutTemplate: 'layout', loadingTemplate: 'loading' }); //Basic Routes Router.route('/',function(){ this.render('main'); },{name:"main"}); Router.route('/Board',function(){ this.render('board'); },{name:"board"}); Router.route('/Board/:chat',function(){ this.render('board'); },{name:"board.chat"}); //On before actions var OnBeforeActions = { loginRequired: function(){ if(!Meteor.userId()) { this.render('main'); }else{ this.next(); } }, mobileOrDesktop: function(){ if(findBootstrapEnvironment() != 'xs'){ this.render('chat',{to:'chat'}); }else{ this.render('chat'); } this.next(); } }; Router.onBeforeAction(OnBeforeActions.mobileOrDesktop, { only: ['board','board.chat'] }); Router.onBeforeAction(OnBeforeActions.loginRequired, { only: ['board','board.chat'] }); Router.onBeforeAction('loading'); //Bootstrap state helper function findBootstrapEnvironment() { var envs = ["xs", "sm", "md", "lg"], doc = window.document, temp = doc.createElement("div"); doc.body.appendChild(temp); for (var i = envs.length - 1; i >= 0; i--) { var env = envs[i]; temp.className = "hidden-" + env; if (temp.offsetParent === null) { doc.body.removeChild(temp); return env; } } return ""; } Here is my layout where the yield is: {{> navbar}} {{> notifications}} {{> yield}} {{> notifications}} {{> yield}} Loading... Here is…
tagged with: javascript
tagged with: render

http://stackoverflow.com/comment/44241689
has text: Can you please elaborate, What you have tried so far?
comment on: http://stackoverflow.com/q/27922345
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27867658
upvote count: 2
has comment: http://stackoverflow.com/comment/44137833
has comment: http://stackoverflow.com/comment/44137856
type: Question
has comment: http://stackoverflow.com/comment/44137897
has comment: http://stackoverflow.com/comment/44137828
tagged with: object
has comment: http://stackoverflow.com/comment/44137996
tagged with: arrays
has comment: http://stackoverflow.com/comment/44137806
has comment: http://stackoverflow.com/comment/44137836
tagged with: javascript
has answer: http://stackoverflow.com/a/35387295
linked to: http://stackoverflow.com/q/5048371
has comment: http://stackoverflow.com/comment/44137803
answer count: 2
downvote count: 0
has title: Javascript - how are array stored internally?
favorite count: 0
type: UnansweredQuestion
has body: In the fiddle - http://jsfiddle.net/vwwkf18c/ or below code snippet - var a = [3, 4]; var b = [6, 2]; var c = $.extend({}, a, b); alert(c[1]); //alerts 2 alert(a); //alerts array a contents alert(c); //does not return contents of c My questions - 1) After what has been alerted, we can infer that "c" is an object but not an array object. Please confirm. 2) Secondly it is said that internal representation of an array is an object literal, is that right? Which means that array "a" would be stored as given below - var a = { 0: 3, 1: 4 } Is it right? 3) How is a or b stored internally and how is it different from the internal representation of "c"?
has comment: http://stackoverflow.com/comment/44137911
score: 2
has answer: http://stackoverflow.com/a/27867718
has comment: http://stackoverflow.com/comment/44137888

http://stackoverflow.com/a/32388874
answers question: http://stackoverflow.com/q/27834217
score: 0
has body: found a probable solution, at least for firefox, it is using canvas and capturing it's stream and transmitting it using canvas.captureStream() // Find the canvas element to capture var canvasElt = document.getElementsByTagName("canvas")[0]; // Get the stream var stream = canvasElt.captureStream(25); // 25 FPS // Do things to the stream // E.g. Sent it to another computer using a RTCPeerConnection // pc is a RTCPeerConnection created elsewhere pc.addStream(stream);
type: Answer
has comment: http://stackoverflow.com/comment/110708974
has comment: http://stackoverflow.com/comment/102781302

http://stackoverflow.com/comment/44168750
type: QuestionComment
has text: @PM77-1 For example a user selects wednesday from the first week of january then the next recurring date should be the wednesday from the first week of february.
comment on: http://stackoverflow.com/q/27883478
score: 0
type: Comment

http://stackoverflow.com/comment/44308345
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27956857
has text: Often if a JS resource doesn't load then other javascripts don't properly run (even if they're not directly related), so it's worth checking out that one (the image you can probably ignore)
score: 0

http://stackoverflow.com/q/27923652
possible better answer: http://stackoverflow.com/a/27923811
type: Question
has body: I'm trying to loop through a date range and delay going to the next iteration by 1 second. Each time I run the following in either jsFiddle or Plunker the browser crashes. var current_date = new Date("01/13/2013"); var end_date = new Date("01/20/2013"); var end_date_time = end_date.getTime(); while (current_date.getTime() &lt; end_date_time) { setTimeout(function () { console.log(current_date); current_date.setDate(current_date.getDate()+1); }, 1000); } Could anyone point me in the right direction as to why this isn't working and how to fix it?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27923755
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27923755
score: 0
has title: JavaScript Looping through date range with a 1 second delay
has answer: http://stackoverflow.com/a/27923811

http://stackoverflow.com/comment/44074676
score: 0
type: AnswerComment
has text: The link you provided doesn't say anything about arithmetic operations.
type: Comment
comment on: http://stackoverflow.com/a/27833662

http://stackoverflow.com/comment/72422497
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/42648141
has text: Oh I forgot you can release proxies too so this is not permanent.
type: Comment

http://stackoverflow.com/q/27904291
has answer: http://stackoverflow.com/a/27904791
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27917463
type: Question
has comment: http://stackoverflow.com/comment/44208542
has title: Transform nested array to D3 multiline time series
tagged with: d3.js
score: 0
answer count: 2
has body: I'd like to transform a nested JSON object for a time series D3 multiline chart. I'd like to transform this: [ { "utc_date": "2012-12-13T00:00:00.000Z", "data": { "view": { "count": 9061 }, "purchase": { "count": 254 } } }, { "utc_date": "2012-12-14T00:00:00.000Z", "data": { "view": { "count": 17232 }, "purchase": { "count": 539 } } }, { "utc_date": "2012-12-15T00:00:00.000Z", "data": { "view": { "count": 28783 }, "purchase": { "count": 936 } } }] to something like this (or better?) [ { "key": "view", "data": [ { "date": "2012-12-13T00:00:00.000Z", "count": 9061 }, { "date": "2012-12-14T00:00:00.000Z", "count": 17232 }, { "date": "2012-12-15T00:00:00.000Z", "count": 28783 } ] }, { "key": "purchase", "data": [ { "date": "2012-12-13T00:00:00.000Z", "count": 254 }, { "date": "2012-12-14T00:00:00.000Z", "count": 539 }, { "date": "2012-12-15T00:00:00.000Z", "count": 936 } ] } ] To be clear, "view" and "purchase" will not be known and are dynamic. So they shouldn't be hardcoded into the example. But still wondering if there is any D3.js method or chain of methods to transform this data?

http://stackoverflow.com/q/27950634
upvote count: 2
score: 0
downvote count: 2
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27950671
has answer: http://stackoverflow.com/a/27950917
has answer: http://stackoverflow.com/a/27950711
has comment: http://stackoverflow.com/comment/44296483
accepted answer: http://stackoverflow.com/a/27950917
has answer: http://stackoverflow.com/a/27950732
type: AnsweredQuestion
has body: so, html elements such as are sometimes referred as property, but sometimes they are referred as objects. i am kinda confused. are html elements properties of document object? or are they objects? or are they both at the same time? thanks. to make question meet quality standards i will add some random codes.
has title: html element - property of document object ? or an object?
type: Question
has comment: http://stackoverflow.com/comment/44296277
has comment: http://stackoverflow.com/comment/44296402
has comment: http://stackoverflow.com/comment/44296353
possible better answer: http://stackoverflow.com/a/27950671
tagged with: javascript
has comment: http://stackoverflow.com/comment/44296429

http://stackoverflow.com/comment/44303723
type: Comment
type: QuestionComment
has text: Yeap.. mine is around 150-170ms
comment on: http://stackoverflow.com/q/27952901
score: 0

http://stackoverflow.com/comment/44285009
comment on: http://stackoverflow.com/q/27944841
score: 0
has text: I assume you know how to create a link from index to showcase page. If you don't you really should go revisit and learn the basics. And for showing first showcase, from current functionality just invoke it's `.click` event.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44232320
type: Comment
comment on: http://stackoverflow.com/q/27904264
has text: Is there a different way of adding zeros to empty cells of a table on the html side without the use of javascript or jquery. I have tried using css, but that does not work either.
score: 0
type: QuestionComment

http://stackoverflow.com/q/27961628
score: 6
upvote count: 7
downvote count: 1
type: Question
tagged with: graph
tagged with: charts
tagged with: google-visualization
tagged with: javascript
tagged with: label
has body: I'm using Google Charts (Javascript) to render some charts on my web application. Now I simply want to add a text label on a specific position on the chart (bottom right). For whatever reason there is nothing to be found on the internet about the subject. An HTML overlay isn't gonna work as I also want the text to appear if I get the chart as an image with the following code: google.visualization.events.addListener(chart, 'ready', function () { var imgUri = chart.getImageURI(); $('#chart_img').attr('src', imgUri); });
has comment: http://stackoverflow.com/comment/62208494
favorite count: 0
has title: Add text element to Google Chart
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44125052
comment on: http://stackoverflow.com/q/27861372
score: 1
has text: Do you have write permissions on $mapname folder?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44309477
comment on: http://stackoverflow.com/q/27957178
has text: I think it would be helpful if you make a example of your caluclation: That should be the result if the user chooses Value: 600000 Bedrooms: 5 Reason: Buying
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44184128
score: 0
comment on: http://stackoverflow.com/a/27891459
type: AnswerComment
has text: @Oday thanks - it didn't appear on the main reference page for `String`.
type: Comment

http://stackoverflow.com/q/27827451
has title: Ember Assertion Failed: The response from a findQuery must be an Array, not undefined
has answer: http://stackoverflow.com/a/27829062
has body: As the title says, the error I am getting is: Error while processing route: index Assertion Failed: The response from a findQuery must be an Array, not undefined I checked every single SO answer (like this one or this one) I could find with similar error like mine and none of the solutions provided helped me solve my problem. I am learning Ember and trying to mess around with Ember Data RESTAdapter and RESTSerializer to fix up the JSON response from OMDB API. Most answers to the error I am getting suggest a malformed JSON (such as uncamelized property names) but I am pretty sure nothing is wrong with how I serialize the JSON in MovieSerializer.extractArray. I have tried adding the normalize method as well as normalizeHash but, as mentioned, I cannot find a property that is invalid or missing (id is there) that needs to be normalized. JSON received: { "Title": "Pulp Fiction", "Year": "1994", "Rated": "R", "Released": "14 Oct 1994", "Runtime": "154 min", "Genre": "Crime, Drama, Thriller", "Director": "Quentin Tarantino", "Writer": "Quentin Tarantino (story), Roger Avary (story), Quentin Tarantino", "Actors": "Tim Roth, Amanda Plummer, Laura Lovelace, John Travolta", "Plot": "The lives of two mob hit men, a boxer, a gangster's wife, and a pair of diner bandits intertwine in four tales of violence and redemption.", "Language": "English, Spanish, French", "Country": "USA", "Awards": "Won 1 Oscar. Another 63 wins &amp; 47 nominations.", "Poster": "http://ia.media-imdb.com/images/M/MV5BMjE0ODk2NjczOV5BMl5BanBnXkFtZTYwNDQ0NDg4._V1_SX300.jpg", "Metascore": "94", "imdbRating": "8.9", "imdbVotes": "1,039,031", "imdbID": "tt0110912", "Type": "movie", "Response": "True" } Serialized JSON (logged in the marked code portion bellow) { "movies": [ { "id": 1, "title": "Pulp Fiction", "year": "1994", "rated": "R", "released": "14 Oct 1994", "runtime": "154 min", "genre": "Crime, Drama, Thriller", "director": "Quentin Tarantino", "writer": "Quentin Tarantino (story), Roger Avary (story…
upvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24291477
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/27829062
type: Question
tagged with: api
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/22560929
tagged with: rest
tagged with: ember.js
score: 1

http://stackoverflow.com/q/27928155
score: 0
has comment: http://stackoverflow.com/comment/44253509
has comment: http://stackoverflow.com/comment/44253712
has comment: http://stackoverflow.com/comment/44256067
has comment: http://stackoverflow.com/comment/44253443
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44253663
has title: Angular Reloading Page on Href Occassionally
has body: I have a strange error going on in my app. I use ui.router for my routes like any normal angular app. I have some buttons here and there that link to other portions of the app: &lt;a href="Modules/test/main.asp#/info"&gt; Most of the time this works great, it changes routes and is fine. Sometimes though, it does a full page reload. The only portion that works every time is I have an ng-click that hits a function before change location, I shouldn't have to change routes via the controller each time if I don't want to reload though.
has comment: http://stackoverflow.com/comment/44255156
answer count: 0
has comment: http://stackoverflow.com/comment/44253463
type: Question
has comment: http://stackoverflow.com/comment/44254269
has comment: http://stackoverflow.com/comment/44253731
tagged with: javascript

http://stackoverflow.com/q/27832310
answer count: 2
downvote count: 0
tagged with: jquery
has body: I have a jQuery countdown script that goes like this: And the HTML code like this: days hours minutes seconds What I'm trying to do is basically put the countdown inside the HTML code. I tried to do it like this: + ' %H ' But that didn't work. What am I doing wrong? Here is my fiddle: http://jsfiddle.net/nmmevtht/
has answer: http://stackoverflow.com/a/27832487
favorite count: 0
has answer: http://stackoverflow.com/a/27832454
accepted answer: http://stackoverflow.com/a/27832454
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
upvote count: 1
possible better answer: http://stackoverflow.com/a/27832487
type: Question
has comment: http://stackoverflow.com/comment/44070483
has comment: http://stackoverflow.com/comment/44070682
has comment: http://stackoverflow.com/comment/44070615
tagged with: javascript
has title: jquery countdown inside span tags instead of printed directly

http://stackoverflow.com/comment/44043427
comment on: http://stackoverflow.com/q/27818620
type: Comment
type: QuestionComment
has text: When you pass `myFunction2` as an argument to something, it loses the reference to the object it belongs to. `this` now refers to the function itself, and not `someScopeScopedObject`, hence your problem :)
score: 0

http://stackoverflow.com/q/27924557
score: 0
has answer: http://stackoverflow.com/a/27924851
tagged with: web-applications
answer count: 1
has title: Cache manifest cache all files
has body: I have a problem with manifest cache in HTML 5. Here is my manifest file: CACHE MANIFEST # This manifest was generated by grunt-manifest HTML5 Cache Manifest Generator # Time: Tue Jan 13 2015 15:05:00 GMT+0100 (Central European Standard Time) CACHE: js/application.js js/pdf.js js/vendor.js js/vendor/jquery.min.js NETWORK: * SETTINGS: prefer-online I want cache only files in section "cache" in manifest.appcache . All others files like ajax request shouldn't be cached by browser. Now everythink is loaded from cache, when i refresh site. What i'm doing wrong?
type: UnansweredQuestion
tagged with: cache-manifest
tagged with: javascript
tagged with: application-cache
linked to: http://stackoverflow.com/q/367786
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27856226
tagged with: performance
type: Question
has body: I am adapting this D3 example by Rob Schmuecker. It is a DataNode tree with a lot of nice functionalities like panning, zooming and children toggling. I have removed all drag and drop functionality from it, since I don't need it. Otherwise, by code is pretty much the same as in the example (for now). I am expecting to use the node tree to be populated by hundreds, perhaps thousands of nodes. At 1000 nodes the browser freezes up a bit. Firefox lags a lot, and I have to stop the script. Chrome lags a bit less. The only thing I have tried so far is to create the graph with all children nodes hidden (add to oParent._children, instead of to oParent.children). Chrome deals with this approach quite well, but firefox fares little better. I intend to add quite things like hover effects and parent-child associations visuals etc, so I suspect that lag might become a larger problem. Anyone have any further recommendations or ideas on how to make the browser deal with the lag problem?
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27978348
accepted answer: http://stackoverflow.com/a/27978348
has title: Make D3js DataNode tree run faster
tagged with: d3.js
type: AnsweredQuestion

http://stackoverflow.com/q/27919753
has title: write and save a text file using javascript in webbrowser control
tagged with: c#
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44238461
has comment: http://stackoverflow.com/comment/44238517
has body: i am Developing a tool in windows form where i am using a webbrowser control Need help to write data from a javacript. basically i need to create a text file and save the file without the download prompt or user interface. file should be downloaded automatically. so far i have tried function saveTextAsFile(text) { var textToWrite = text; var fileNameToSaveAs = "new_text"; var textFileAsBlob = new Blob([textToWrite], {type:'text/plain'}); window.navigator.msSaveBlob(textFileAsBlob, fileNameToSaveAs); } this peace of code creates a file and ask for user to save the file i.e download prompt. How do i get this done automatically. In webBrowser control it asks for save dialog box. i want to prevent this. Basically whatever text the user selects in the webBrowser control and press a button copy the file with selected text is to be downloaded thank you
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44238438
answer count: 0
has comment: http://stackoverflow.com/comment/44238104
tagged with: windows-forms-designer
has comment: http://stackoverflow.com/comment/44237195
has comment: http://stackoverflow.com/comment/44238161
type: Question

http://stackoverflow.com/comment/44272911
score: 0
type: Comment
has text: i tried specifying the data-target attribute but i dont seem to get the result also, in fact i tried adding another data modal and when i click the image, the 1st modal will appear followed by the 2nd one...
type: AnswerComment
comment on: http://stackoverflow.com/a/27930401

http://stackoverflow.com/comment/44103740
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27841766
has text: That's pretty much the solution I am using now thank you, my collection returns a boolean if it is in the process of fetching.

http://stackoverflow.com/q/27957206
type: Question
score: 1
tagged with: mysql
has body: jQuery(document).ready(function(){ $("#qty1").change(function(e) { var quantity = $(this).val(); $.ajax({ url: 'pricegetter.php', type: 'POST', data: {quantity: quantity}, success: function(result) { $('#price').val(result); } }); }); }); code for pricegetter.php include("config.php"); $q = mysql_query("select rate FROM products WHERE qty= '".$_POST['quantity']."'"); if(mysql_num_rows($q)&lt;=0) echo "none"; else{ $r = mysql_fetch_array($q); echo $r["rate"]; } my radio button to fire the event &lt;input type='radio' value='".$row['qty']."' name='qty1' id='qty1'/&gt; ".$row['qty'] ." ".$row['unit'] /&gt; my value to be store by a text field. &lt;input type='text' name='price' id='price'/&gt; These above code are not working perfectly as expected. please help me to find the error. my php code is working perfectly separately, there is no syntax or field name error. The aim of my code is, when I select a qty1 radio button, it will give me the price associated with the qty for the particular product. [p.s. I am in my first step of the code. I don't know how to send two value as post action using jquery, so I only send the qty but it is not giving me the price. I will then try to provide productID through the jquery.]
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27957232
type: UnansweredQuestion
has title: change event of a radio button to get a value from mysql table, not working
upvote count: 1
tagged with: php

http://stackoverflow.com/a/27865685
has comment: http://stackoverflow.com/comment/44135057
has comment: http://stackoverflow.com/comment/44134934
type: Answer
score: 1
has body: Use .val() not .val to receive the value. val() is a function which can get or set the value for your field. Also you should use $(this) inside the eventhandler function, because in your code, the event is called by your select field, so you don't need to reselect it by id: $("#select_order").change(function(){ var call = true; switch(parseInt($(this).val())) { case 1: sortv = "database_percent"; sorto = "asc"; break; case 2: sortv = "database_percent"; sorto = "desc"; break; default: call = false; alert("Pick something"); break; } if(call) { $.ajax({ url: 'all_get_2.php?category=ethnicity', type: 'GET', dataType: 'JSON', data: {sortvalue: sortv ,sortorder:sorto}, success: function(data) { // your response handler here } }); } });
upvote count: 1
has comment: http://stackoverflow.com/comment/44134125
accepted answer of: http://stackoverflow.com/q/27865670
has comment: http://stackoverflow.com/comment/44134047
has comment: http://stackoverflow.com/comment/44134026
answers question: http://stackoverflow.com/q/27865670
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44134863

http://stackoverflow.com/q/27956266
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44309244
upvote count: 1
has comment: http://stackoverflow.com/comment/44307351
has comment: http://stackoverflow.com/comment/44307285
has comment: http://stackoverflow.com/comment/44307370
has title: Make fixed top element scroll with page (once the content reaches it)
has answer: http://stackoverflow.com/a/27956388
type: Question
has comment: http://stackoverflow.com/comment/44307390
linked to: http://stackoverflow.com/q/16670931
score: 1
has comment: http://stackoverflow.com/comment/44307320
has body: All the page content (red "Test" in my image) should be placed at top 100% (one should start scroll to see it) The top Header (Marked with black in my image) should be fixed to the page top. once the Content hits the header it should start scroll with the rest of the content. (I have no clue where to start with this problem... Can it be done without JavaScript?) Thanks in advance for your help everyone.
has comment: http://stackoverflow.com/comment/44307364
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27956388
favorite count: 0
has comment: http://stackoverflow.com/comment/44307348
has comment: http://stackoverflow.com/comment/44307411
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44309610
has comment: http://stackoverflow.com/comment/44307634
tagged with: css

acrobat
type: Tag
tags question: http://stackoverflow.com/q/27821884
tag name: acrobat
tags question: http://stackoverflow.com/q/27892454

drupal
tags question: http://stackoverflow.com/q/27884948
type: Tag
tags question: http://stackoverflow.com/q/27928924
tag name: drupal
tags question: http://stackoverflow.com/q/27894540
tags question: http://stackoverflow.com/q/27847533

http://stackoverflow.com/comment/44127708
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27862166
score: 0
has text: i think you already did it right, http://jsfiddle.net/b9qpnsy5/1/ this are the codes exactly copy from the top (except i changed the CoverPop cookies so it prompts everytime). So possible other place is wrong? do you globally register the click event handler for `` action element somewhere in ur codes?

google-analytics
tags question: http://stackoverflow.com/q/27934994
tags question: http://stackoverflow.com/q/27834551
tags question: http://stackoverflow.com/q/27903646
tags question: http://stackoverflow.com/q/27843572
tags question: http://stackoverflow.com/q/27821900
tags question: http://stackoverflow.com/q/27826833
tags question: http://stackoverflow.com/q/27814031
tag name: google-analytics
tags question: http://stackoverflow.com/q/27849597
tags question: http://stackoverflow.com/q/27845110
tags question: http://stackoverflow.com/q/27856230
tags question: http://stackoverflow.com/q/27900705
tags question: http://stackoverflow.com/q/27945501
type: Tag
tags question: http://stackoverflow.com/q/27910593
tags question: http://stackoverflow.com/q/27812109

http://stackoverflow.com/comment/109990720
score: 0
has text: See https://stackoverflow.com/a/62170934/5846045
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27837251

http://stackoverflow.com/q/27915167
tagged with: closures
has body: I am running into a problem people have posted before: JavaScript dynamic parameters But my code uses nodes rather than innerHTML assignments, so the existing SO post doesn't seem to apply to my code. I want to dynamically generate HTML buttons in a table. For each button, I want to call a function with parameters that depend on the button's index/position in the table. First I tried just using lambda functions with the variable over which I was incrementing. This didn't work, so I also tried dynamically named variables, meaning each button should be passing a differently named variable to deal with lazy-loading effects. But this didn't work either. You can see both versions of what I tried in the code below: This code I paste below is in a for-loop. In the following, I increase i by 1 each time. offset and jj are unchanged within the loop. var variableDynamic = i.toString(); window['variableName' + variableDynamic] = i + offset; upvote.onclick = function() { upVoteA(i + offset, jj); //upVoteA(window['variableName' + variableDynamic] , jj); }; upvote.innerHTML = "Upvote" Someone told me to look into closures, so following this recommendation: http://www.usepatterns.com/blog/javascript-closures I rewrote the onclick function declaration as: upvote.onclick = function() { var a = i + offset; var b = kk; function closeIt(){ upVoteA(a,b); } closeIt(); }; This still has the same effect that every button calls upVoteA with the same parameter, namely the last/highest value. I realize I could refactor my code to turn these into .innerHTML set statements and then I'd print the variable and it would be set as a printed statement instead of a lazily-loaded variable. But I'd like not to do that if possible. (apologies that it's not technically lazy loading, the name seems reasonably apt) Is there a way to make my code work? And why are the closures failing? I thought closures should preserve the environment they were created in, but that is not the case with my code. Which porti…
tagged with: javascript
has title: dynamically generated js buttons with closures to assign onclick function parameters
answer count: 1
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8041291
has answer: http://stackoverflow.com/a/27916026
score: 1
upvote count: 1
tagged with: dom
type: Question
downvote count: 0

http://stackoverflow.com/a/27852333
score: 0
has comment: http://stackoverflow.com/comment/44109087
type: Answer
has body: The regex you may need is: \$\w+
has comment: http://stackoverflow.com/comment/44120981
answers question: http://stackoverflow.com/q/27852184

http://stackoverflow.com/a/27935299
has body: There's indeed a strange problem with your code and I can't really explain why is this happening. Try this solution, works for me: var position = 0; function logo(img) { position = position == 0 ? 100 : 0; $(img).animate( { left: position }, 900, function () { logo(this) }); } http://jsfiddle.net/oqLakcbj/
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27934734
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/27934734

http://stackoverflow.com/comment/44153808
has text: I've noticed another thing in that the imports refer to 'packages' - when I downloaded Polymer it did not seem to contain the 'polymer-dialog-master' - downloaded that from GitHub but even correcting the imports and downloading it - still get the error :(
comment on: http://stackoverflow.com/q/27867845
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27820918
has title: A div height matching issue
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44047481
has body: I wrote some javascript to match the height of two columns and it is not working. I wanted to keep it as simple as possible but I don't understand exactly what the problem is. I am attaching the snippet of javascript as well as a link to the jsfiddle. Please let me know if you see anything wrong with my code. function matchColumHeights('.column1', '.column2') { var column1Height = $('.column1').height(); var column2Height = $('.column2').height(); if (column1Height &lt; column2Height) { $('.column1').height(column2Height); } else { $('.column2').height(column1Height); } } http://jsfiddle.net/hqypw5q2/1/
has comment: http://stackoverflow.com/comment/44047475
upvote count: 1
tagged with: css
has answer: http://stackoverflow.com/a/27820978
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44047645
accepted answer: http://stackoverflow.com/a/27820978
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/27871452
answers question: http://stackoverflow.com/q/27871373
type: Answer
has body: Try this: &lt;input value="" onkeypress="return onlyNumber(event)" /&gt; &lt;script type="text/javascript"&gt; function onlyNumber(e) { e = (e) ? e : window.event; var charCode = (e.which) ? e.which : e.keyCode; if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57)) { return false; } return true; } &lt;/script&gt;
score: 0

http://stackoverflow.com/a/27948359
score: 0
upvote count: 1
downvote count: 1
has body: It's always best to use a class for iterating through items. Id should only be used once (for accessing a unique element). See the following example. Jquery Code. $('div#questions ul li.answer').each(function() { console.log($(this).text()); }); Html. True True False False True
answers question: http://stackoverflow.com/q/27948230
type: Answer

http://stackoverflow.com/q/27955426
score: 0
has title: Mongoose & Bluebird - typical callbacks within promises?
has comment: http://stackoverflow.com/comment/44306259
has body: Is there a better way to resolve the outer callback without explicitly invoking it from within the then()? IE next(false) vs next(true). My current implementation doesn't "feel" correct. Or perhaps it is, and this is just the nature of writing it. AccountSchema .path('email') .validate(function (value, next) { this.constructor.findOneAsync({email: value}) .then(function (user) { if (user) { next(false); } next(true); }); }, 'The specified email address is already in use.');
type: UnansweredQuestion
tagged with: bluebird
answer count: 0
has comment: http://stackoverflow.com/comment/44306051
type: Question
tagged with: mongoose
tagged with: javascript

django
tags question: http://stackoverflow.com/q/27963673
tags question: http://stackoverflow.com/q/27835027
type: Tag
tags question: http://stackoverflow.com/q/27876744
tags question: http://stackoverflow.com/q/27827481
tags question: http://stackoverflow.com/q/27944785
tags question: http://stackoverflow.com/q/27928118
tags question: http://stackoverflow.com/q/27836147
tag name: django
tags question: http://stackoverflow.com/q/27835268
tags question: http://stackoverflow.com/q/27868602
tags question: http://stackoverflow.com/q/27897428
tags question: http://stackoverflow.com/q/27948775
tags question: http://stackoverflow.com/q/27844633
tags question: http://stackoverflow.com/q/27901929
tags question: http://stackoverflow.com/q/27856867
tags question: http://stackoverflow.com/q/27896780

http://stackoverflow.com/a/27854232
has comment: http://stackoverflow.com/comment/44112988
answers question: http://stackoverflow.com/q/27853236
has comment: http://stackoverflow.com/comment/44112529
type: Answer
has comment: http://stackoverflow.com/comment/44112631
has comment: http://stackoverflow.com/comment/44112765
has comment: http://stackoverflow.com/comment/44112752
has comment: http://stackoverflow.com/comment/44112682
has comment: http://stackoverflow.com/comment/44112505
has body: Add below code in to your theme's functions.php : add_action( 'woocommerce_after_single_product_summary', 'custom_wc_upsell_rohil_display', 15 ); if (!function_exists('custom_wc_upsell_rohil_display')) { function custom_wc_upsell_rohil_display() { global $product; $upsells = $product-&gt;get_upsells(); if($upsells){ wp_enqueue_script( 'frontend-custom', get_template_directory_uri() . '/js/frontend-custom.js', array("jquery")); } } } Now create one .js file and name it frontend-custom.js and save it in to wp-content &gt; themes &gt; your current theme &gt; js.(So js would be stored in wp-content &gt; themes &gt; your-current-theme &gt; js &gt; frontend-custom.js) and add below code in that js file : jQuery(document).ready(function($) { $(".single_add_to_cart_button").click(function(){ alert("Up sell available"); }); }); That's it.Now when there is any upsell available to any product and user will click on add to cart button, an alert will pop up and then they will redirect to the cart. NOTE: It will work only on Single Product page.
score: 0
has comment: http://stackoverflow.com/comment/44112655

http://stackoverflow.com/a/27902677
has comment: http://stackoverflow.com/comment/44204957
has comment: http://stackoverflow.com/comment/44205526
has comment: http://stackoverflow.com/comment/44205305
score: 0
answers question: http://stackoverflow.com/q/27902485
has body: Try to change your JS code to the following: JS: $(window).scroll(function(e){ var el = $('#callback'); if ($(this).scrollTop() &gt; 200){ $('#callback').css({'top': '75px'}); /* Assuming 75 is the height of you navbar. */ } if ($(this).scrollTop() &lt; 200){ $('#callback').css({'top': '0px'}); } });
type: Answer

http://stackoverflow.com/comment/44189999
type: Comment
has text: Any pending AJAX requests will be aborted when the browser navigates away from the page.
type: QuestionComment
comment on: http://stackoverflow.com/q/27894448
score: 6

http://stackoverflow.com/q/27958511
type: Question
has body: I'm following a railscast tutorial #114 for endless scrolling but I don't use coffeescript. THe javascript provided does not work when calling the alert. What is the problem here? Thank you. $(document).ready(function(){ $(window).scroll -&gt; if $(window).scrollTop() &gt; $(document).height() - $(window).height() - 50 alert "near bottom" }); http://jsfiddle.net/fskx4jyr/ If this is a coffeescript problem, how would this code be used to working in just jquery? jQuery -&gt; if $('.pagination').length $(window).scroll -&gt; url = $('.pagination .next_page').attr('href') if url &amp;&amp; $(window).scrollTop() &gt; $(document).height() - $(window).height() - 50 $('.pagination').text("Fetching more products...") $.getScript(url) $(window).scroll()
tagged with: javascript
tagged with: jquery
has title: Jquery: railscast 114, alert not showing, is this because it's coffeescript?
has answer: http://stackoverflow.com/a/27958601
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/27958601
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/56765874
upvote count: 1
tagged with: coffeescript

http://stackoverflow.com/comment/44153207
type: Comment
has text: @PatrickRoberts—some don't like reusing variables, I get that. But then introducing a new variable from habit doesn't make a lot of sense either. Each to their own. ;-)
comment on: http://stackoverflow.com/a/27873756
type: AnswerComment
score: 0

http://stackoverflow.com/q/27853452
has comment: http://stackoverflow.com/comment/44153650
has comment: http://stackoverflow.com/comment/44153648
answer count: 0
has comment: http://stackoverflow.com/comment/44153649
type: UnansweredQuestion
tagged with: sharepoint-2013
type: Question
has body: After years of avoiding Sharepoint I finally have to work with the thing. Working through the learning process and even booking courses but I'm going to have some dumb questions relating to stuff I need to solve immediately... This one relates to manipulating documents on a sharepoint site from javascript on a separate web site. I'm getting my head around the rest api but am not sure whether this approach is right or what the error I'm seeing means. So... All I want to do is copy a word document to the same location with a new name. I think, from the docs and examples I've found that I need something like: http://mysites.blah.com/personal/me/_api/web/getfilebyserverrelativeurl('/personal/me/explore/doc1.docx')/copyto(strnewurl='/personal/me/explore/doc2.docx',boverwrite=false) the error I'm getting back from the POST is -2130575251, Microsoft.SharePoint.SPException The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again. So, I'm guessing that I'm missing an authentication element? In my favour (possibly) is that I only have to provide this for users on Win machines on same network who will have access to the SP location and files *EDIT The suggestion from @Vivek below suggests that I need to make it clear that this has to work from a page outside of the Sharepoint environment. That prompts me to wonder if x-domain issues are a problem...
has title: Sharepoint file management from Javascript
has comment: http://stackoverflow.com/comment/44153652
has comment: http://stackoverflow.com/comment/44153653
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44153651
tagged with: sharepoint

http://stackoverflow.com/a/27843763
answers question: http://stackoverflow.com/q/27824604
score: 0
type: Answer
has body: Thank you very much, from this answer I have worked out how to do it. var totalStageNumber = $('li').length; var currentStageNumber = $('li.completed').length + $('li.current').length; var progressBar = 100 / (totalStageNumber) * ((currentStageNumber) - 1) ; $('.number-total').text('' + totalStageNumber + ''); $('.number-current').text('' + currentStageNumber + ''); $('.simform .progress').css({'width':progressBar + '%'}); $('div.next').on('click', function(){ var currentStageNumber = $('li.completed').length + $('li.current').length; $('.number-current').text('' + currentStageNumber + ''); var progressBar = 100 / (totalStageNumber) * ((currentStageNumber) - 1); $('.simform .progress').css({'width':progressBar + '%'}); }); label label label / The Progress bar shows what boxes have been filled in and not what stage the user is on unlike the pagination I have turned this form http://tympanus.net/Development/MinimalForm/ into jquery

http://stackoverflow.com/comment/44113879
has text: @VincentPride note how he says "then all the code that *interprets* these configuration objects will go polymorphic and you will pay for this with performance": what that means is that code needs to use (interpret in their words) the object for its hidden class to matter. .splice, .push and so on don't use the object, they are "pass it around" methods.
type: Comment
comment on: http://stackoverflow.com/q/27821711
score: 1
type: QuestionComment

http://stackoverflow.com/a/27851103
accepted answer of: http://stackoverflow.com/q/27850756
answers question: http://stackoverflow.com/q/27850756
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44106646
has comment: http://stackoverflow.com/comment/44106521
has body: In the following I assume you are referring to about DOM events handlers. Does it have to be e or event. It doesn't matter. It could be ajdlahksjd for all we care. Is it appended as the last argument or can it also be the first? The event object will always be passed as first argument to the handler. Can you do this: function eventHandler(e, a, b, c, d){} Is e still referring to the event or is it d? It depends on how you bind the event handler. If you just assign it it will be e. If you already bind other values to the parameters, e.g. via .bind, it will be the first un-bound parameter. However, that doesn't really have anything to do with event handlers. The event handler itself will also get the event object as first argument. Or to make the above work you need to explicitly use the keyword event? event is not a keyword. You can name the parameter however you want to. What are the rules of thumb when it comes to declaring the event argument within a function in JavaScript? There is none. There is no magic statically inspection of your event handler. It's simply a function that accepts an argument, that's it. However, there is certainly a convention to name the parameter e or event, simply because it's reasonable name for a variable that represents an event object.
has comment: http://stackoverflow.com/comment/44106577
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44106305
has comment: http://stackoverflow.com/comment/44106464
has comment: http://stackoverflow.com/comment/44106274

http://stackoverflow.com/comment/44310660
score: 0
type: Comment
type: QuestionComment
has text: @Will, thanks, it should definitely be floor :-)
comment on: http://stackoverflow.com/q/27889198

http://stackoverflow.com/q/27857779
downvote count: 1
has answer: http://stackoverflow.com/a/27858099
has comment: http://stackoverflow.com/comment/44118416
has comment: http://stackoverflow.com/comment/44118428
has body: This program is working perfectly it load books.php data into div. There is a javascript code inside the loading page books.php but this javascript not running. How can I solve this problem? Books
has comment: http://stackoverflow.com/comment/44118577
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: web
favorite count: 0
has comment: http://stackoverflow.com/comment/44118773
has title: How to run javascript inside loading page that update the content without refreshing page. pls read details?
type: UnansweredQuestion
upvote count: 1
tagged with: php

http://stackoverflow.com/q/27869181
has answer: http://stackoverflow.com/a/27869374
answer count: 2
accepted answer: http://stackoverflow.com/a/27870099
tagged with: function
has comment: http://stackoverflow.com/comment/44144456
has comment: http://stackoverflow.com/comment/44141074
has title: Finding the difference btw two time inputs in javascript
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44140833
tagged with: time
has answer: http://stackoverflow.com/a/27870099
type: Question
has comment: http://stackoverflow.com/comment/44144681
type: AnsweredQuestion
has body: I am developing a webpage to collect information about a person's sleep. Specifically, I am required to find the difference in time between two user inputs which may or may not cross midnight. I am pretty new to programming in general so am trying to go on using just the skills I am familiar with, though would also like to know if there is an easier way! The code I have written is as follows: &lt;script type="text/javascript"&gt; function timeSec() { var btHours = document.getElementById('bedtimeHours').value; if (btHours == "") { btHours = 0; } var btMins = document.getElementById('bedtimeMins').value; if (btMins == "") { btMins = 0; } var btSleepTillMidnight = 0; var btSecTotal = (btHours*3600) + (btMins*60); document.getElementById('btSec').value = btSecTotal; if (btHours &gt; 12) { btSleepTillMidnight = 24*3600 - btSecTotal; } if (btHours &lt;= 12) { btSleepTillMidnight = ( -Math.abs(btSecTotal)); } var wtHours = document.getElementById('waketimeHours').value; if (wtHours == "") { wtHours = 0; } var wtMins = document.getElementById('waketimeMins').value; if (wtMins == "") { wtMins = 0; } var wtSecTotal = (wtHours*3600) + (wtMins*60); document.getElementById('wtSec').value = wtSecTotal; var diffSec = wtSecTotal + btSleepTilMidnight; document.getElementById('diffSec').value = diffSec; var diffHours = diffSec/3600; document.getElementById('diffHours').value = diffHours; } &lt;/script&gt; My HTML is as follows, and is pretty much designed to pinpoint errors during development: &lt;form method="post" action="" name="PSQI" id="PSQI"&gt; Bedtime: &lt;input type="number" name="bedtimeHours" id="bedtimeHours" min="0" step="1" max="24" value=""&gt; Hours &lt;input type="number" name="bedtimeMins" id="bedtimeMins" min="0" step="10" max="50" value=""&gt; Minutes &lt;br&gt; Waketime: &lt;input type="number" name="waketimeHours" id="waketimeHours" min="0" step="1" max="24" value=""&gt; Hours &lt;input type="number" name="waketimeMins" id="waketimeMins" min="0" step="10" max="…
possible better answer: http://stackoverflow.com/a/27869374

http://stackoverflow.com/q/27933312
possible better answer: http://stackoverflow.com/a/27933368
tagged with: javascript
has answer: http://stackoverflow.com/a/27933368
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/44264327
has answer: http://stackoverflow.com/a/27933403
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -2
accepted answer: http://stackoverflow.com/a/27933403
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/44264423
has title: Paint circle method JavaScript
has body: I am trying to find a way to draw a circle using JavaScript and redraw it while erasing the old circle. i got this code: &lt;html&gt; &lt;head&gt; &lt;style&gt; body { margin: 0px; padding: 0px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;canvas id="myCanvas" width="578" height="200"&gt;&lt;/canvas&gt; &lt;script&gt; var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var centerX = canvas.width / 2; var centerY = canvas.height / 2; var radius = 15; drawCircle(centerX,centerY,radius); drawCircle(150,150,25); function drawCircle(centerX,centerY,radius) { var canvas = document.getElementById('myCanvas'); context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle = 'black'; context.fill(); context.lineWidth = 5; context.strokeStyle = '#003300'; context.stroke(); }; &lt;/script&gt; The problem is that this two methods draw two circles instead of drawing one instead of the other. I am beginner in JS would appreciate help on making better way of drawing and erasing the circle Thanks

http://stackoverflow.com/q/27900943
type: Question
has answer: http://stackoverflow.com/a/27901004
accepted answer: http://stackoverflow.com/a/27901004
has body: I have two dates in DD/MM/YYYY HH:MM:SS format ,i want to compare two dates and throw an alert . I tried the below code,but it is not working. startdate = "14/12/2014 19:00:00"; enddate = "21/01/2015 19:00:00"; if(new Date(startdate) &gt; new Date(enddate)) { alert("End date cannot be less than start date"); }
has comment: http://stackoverflow.com/comment/44201527
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/44201522
upvote count: 2
answer count: 1
downvote count: 1
favorite count: 0
type: AnsweredQuestion
has title: javascript compare two dates and throw an alert
score: 1

http://stackoverflow.com/comment/75553127
type: AnswerComment
comment on: http://stackoverflow.com/a/37449679
type: Comment
has text: @Kunok It doesn't. This is a quick fix for development but you will still have to figure something out for production.
score: 3

http://stackoverflow.com/q/27808968
tagged with: jquery
has body: I´m trying to use $.mobile.changePage inside a popup anchor to change to another page but when I click the anchor inside the popup the page changes and then back to the previous page again. I tried this solution: changePage "jumps" back to old page using this: $(document).bind("mobileinit", function(){ $.mobile.pushStateEnabled = false; }); but it didn't work either. This is how I built my page: @Html.Partial("_Header", new WebApp.Models.HeaderModel() { Header = "Title" }) @Html.Partial("_ListViewWithFilter", Model) Sim Não @Html.Partial("_Footer") and this is my JS: It basically creates a listview and when you click any item it will open a popup. If you click the button on popup it should redirect you to the other page. At this moment jquery mobile redirects me to the other page and then backs to the previous page. Anyone have any ideia what may be happening?
has comment: http://stackoverflow.com/comment/44027831
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27809487
favorite count: 0
has title: JQuery Mobile changepage changes the page than go back to the previous page
type: AnsweredQuestion
score: 2
upvote count: 2
linked to: http://stackoverflow.com/q/14225021
has answer: http://stackoverflow.com/a/27809487
type: Question
tagged with: jquery-mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/44027428

http://stackoverflow.com/a/27865676
score: 0
answers question: http://stackoverflow.com/q/27860078
has body: Try this code Question 1 Which one of the following statements best describes the function of bookkeeping? A form of internal accounting providing finanical information at a time and in a format which makes it useable by management for the purpose of planning and controlling a business The mechanistic system of processing and recording the day-to-day financial transactions of a business The mechanistic system of processing and recording the day-to-day financial transactions of a business &lt;script type="text/javascript"&gt; function que1() { alert('test1'); } function que2() { alert('test2'); } function que3() { alert('test3'); } &lt;/script&gt; call function 'onclick' event of radio button
type: Answer

http://stackoverflow.com/comment/44103821
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27849804
score: 0
has text: I'd remove v1.8 and see how that does. If it fails, remove 1.10 instead. Some changes in 1.10 might break your plugins.

http://stackoverflow.com/q/27841324
has comment: http://stackoverflow.com/comment/52209252
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/52210118
score: 0
has comment: http://stackoverflow.com/comment/51773653
answer count: 1
has comment: http://stackoverflow.com/comment/51859573
tagged with: jquery
has answer: http://stackoverflow.com/a/27842500
accepted answer: http://stackoverflow.com/a/27842500
has comment: http://stackoverflow.com/comment/51859808
has body: I'm using PhotoSwipe lightbox in conjuntion with Slick carousel for a project, and I want to have the carousel autoplay while the photoswipe lightbox is not open, but when the lightbox is opened, I want the autoplay to stop. In the PhotoSwipe API they have a close and destroy event to listen for, but not an event for init or open. Has anyone found a good way to do this? Something like: $('#gallery').slick({ autoplay: true, dots: true, }); // ... Setup photoswipe... pswp.listen('open', function() { $('#gallery').slickSetOption('autoplay', false, false); }); pswp.listen('close', function() { $('#gallery').slickSetOption('autoplay', true, false); }); pwsp.init();
tagged with: photoswipe
has title: PhotoSwipe: Is there a way to attach an event handler to the 'init' event or when the plugin opens the lightbox?
type: AnsweredQuestion

http://stackoverflow.com/q/27804988
has body: I have this tzCheckbox, &lt;input type="checkbox" data-on="ON" data-off="OFF"/&gt; In the html output, I see this checkbox is hidden and a span element takes its place. I want to hook up to the click event of the checkbox. How can I do that? I tried these two, the functions were not being triggered. $('input:checkbox').bind('click',function(e)... $('input:checkbox').bind('change',function(e)... Tried this, this didn't work either. $('.tzCheckBox').bind('click',... Thanks
has title: How to hook up to click/change event on tzCheckbox?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27806995
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/44019359
has text: That's because <somestring> is a dom element.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27804384
score: 1

http://stackoverflow.com/a/27911418
answers question: http://stackoverflow.com/q/27911303
type: AcceptedAnswer
has body: In your controller, make you you inject $location as a service dependency and then add a then function which determines what happens when the server responds with a success app.controller('ctrlName', ['$scope', '$location', function($scope, $location){ $scope.processForm = function() { $http({ method : 'POST', url : 'todos', data : $.param($scope.formData), // pass in data as strings headers : { 'Content-Type': 'application/x-www-form-urlencoded' } // set the headers so angular passing info as form data (not request payload) }).then(function(response){ //successfully posted data $location.path('/'); }, function(response){ //error has occurred }) }; }])
type: Answer
accepted answer of: http://stackoverflow.com/q/27911303
score: 0

http://stackoverflow.com/comment/44290223
type: Comment
type: QuestionComment
has text: how does _with_ == ancient ? (new is likely a typo here)
score: 0
comment on: http://stackoverflow.com/q/27947660

http://stackoverflow.com/comment/44276015
type: AnswerComment
has text: but then I still end up with a hard-coded format or is there a way to format it for me? (for example: US has yyyy-mm-dd, most of Europe has dd-mm-yyyy etc.)
type: Comment
score: 3
comment on: http://stackoverflow.com/a/27939870

http://stackoverflow.com/a/27961675
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27961276
type: Answer
has body: This will do the trick: event.stopPropagation(); Docs. If you debug your code you'll see that the event is being called for each parent ul. Check this out: $("#ExpList ul li:has(ul)").click(function(event) { event.stopPropagation(); $(this).find('> ul') .toggleClass("hiddenChild") .toggleClass("displayChild"); }); And the HTML: Platform-1 Child-1 P-C-C-1 Fiddle. HTML considerations: I don't know if you can use a div wrapping the whole list, but I think it would make more sense doing it; You're using the id ExpList for all ul. This is not how we use an id. Instead, for selecting many elements use its own tag or a common class; I removed the onClick = openChild() which were present in all ul. It was throwin an error in your fiddle. JavaScript considerations: You don't have to mix a selector with a find this way $("#ExpList").find('li:has(ul)'). You can just use it on the same selector, as I did $("#ExpList ul li:has(ul)"); You don't need to search for all ul children($(this).children('ul')) since you'll have just one, I used this instead, which looks for just one: $(this).find('> ul'); As said before, the event.stopPropagation() does the trick. You don't need to trigger click event on all parent ul. In CSS, I just changed #ExpList to this #ExpList ul to work in the new structure. I hope it helps.
upvote count: 2
has comment: http://stackoverflow.com/comment/68332732
score: 2
answers question: http://stackoverflow.com/q/27961276

http://stackoverflow.com/comment/44216961
comment on: http://stackoverflow.com/q/27908399
score: 0
type: Comment
type: QuestionComment
has text: Why are you deleting all the triggers first? And why create the trigger in code?

http://stackoverflow.com/a/27961845
score: 0
has body: Here's a working fiddle; But your code was correct. IDK why the browser's telling you that. var Objcompany = {"companies":{"_total":1,"values":[{"id":527345,"name":"National Palace Museum"}]}} console.log(Objcompany.companies.values[0].id);
has comment: http://stackoverflow.com/comment/44317102
type: Answer
has comment: http://stackoverflow.com/comment/44317131
answers question: http://stackoverflow.com/q/27961766

http://stackoverflow.com/q/27844227
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/105797427
type: Question
upvote count: 9
tagged with: javascript
has answer: http://stackoverflow.com/a/27850048
has title: Select2: add new tag dynamically using code
score: 9
answer count: 3
has answer: http://stackoverflow.com/a/47699848
downvote count: 0
favorite count: 0
tagged with: jquery-select2
has answer: http://stackoverflow.com/a/37930107
has body: I'm using select2 for tagging and I have it setup such that a user can add new tags as well. The issue that I'm dealing with is validating the user entry and adding the sanitized tag to selection. To be more specific, when a user enters a space in a tag, i use formatNoMatches to display a js link to sanitize the tag and then add the tag programmatically. This code seems to run without errors but when sanitize is called all selections of the input are cleared. Any clues where i might be going wrong? var data=[{id:0,tag:'enhancement'},{id:1,tag:'bug'},{id:2,tag:'duplicate'},{id:3,tag:'invalid'},{id:4,tag:'wontfix'}]; function format(item) { return item.tag; } function sanitize(a){ $("#select").select2('val',[{ id: -1, tag: a }]); console.log(a); }; $("#select").select2({ tags: true, // tokenSeparators: [",", " "], createSearchChoice: function(term, data) { return term.indexOf(' ') >= 0 ? null : { id: term, tag: term }; }, multiple: true, data:{ results: data, text: function(item) { return item.tag; } }, formatSelection: format, formatResult: format, formatNoMatches: function(term) { return "\"" + term + "\" Is Invalid. Clear Invalid Charecters" } });

http://stackoverflow.com/comment/44276769
type: QuestionComment
has text: I can't do that, since I made up the `createDocument` function. It's not realy exists, and the question is - how can I implement it?
score: 0
comment on: http://stackoverflow.com/q/27940143
type: Comment

http://stackoverflow.com/comment/44056357
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27824952
has text: See http://stackoverflow.com/questions/27049342/asynchronous-access-to-an-array-in-firebase/27050749#27050749 and http://stackoverflow.com/questions/26604472/firebase-angularfire-child-asobject-give-properties-undefined/26673597#26673597
score: 0

http://stackoverflow.com/comment/44224258
type: AnswerComment
comment on: http://stackoverflow.com/a/27906637
score: 0
type: Comment
has text: Can't really help a lot without knowing how your parent/child relationships are set up

http://stackoverflow.com/q/27886405
has comment: http://stackoverflow.com/comment/44173908
accepted answer: http://stackoverflow.com/a/27886696
type: Question
score: -2
tagged with: javascript
upvote count: 0
answer count: 1
has title: Adding javascript to html file loaded by file_get_contents in php
favorite count: 0
has answer: http://stackoverflow.com/a/27886696
has comment: http://stackoverflow.com/comment/44173931
downvote count: 2
tagged with: php
type: AnsweredQuestion
has body: I am loading a html file by file_get_contents and make some changes over it and then echo it. I want to add a javascript code to the file but I don't know how to do it. Thanks in advance. &lt;?php $page = file_get_contents('http://www.example.com/index.html'); $doc = new DOMDocument(); $doc-&gt;loadHTML($page); $node = $doc-&gt;getElementById('something'); $node-&gt;parentNode-&gt;removeChild($node); echo $doc-&gt;saveHtml($doc), PHP_EOL; ?&gt;
has comment: http://stackoverflow.com/comment/44173990

http://stackoverflow.com/a/27960194
type: Answer
answers question: http://stackoverflow.com/q/27959208
downvote count: 0
score: 1
has body: If deleteDate and owner are observables you need to evaluate them using (). Also you should use === instead of = as === is used to compare equality and will also ensure that the types are the same. I.e. 1 === '1' will false whereas 1 == '1' is true.
upvote count: 1

http://stackoverflow.com/q/27921071
has body: The W3C specification states "Each object that implements the WindowTimers interface has a list of active timers." But I have never seen anywhere how to get to that list and inspect it Does that imply that it's implementation specific and not meant to be accessible? Or can you get to the list of active timers, inspect it to get the highest Id (as this is what I have seen implemented) or even tell how many of each Timeouts or Intervals are set at a given time? I have read several threads on a way to kill all Intervals (and/or Timeouts) and with answers about creating a blank new one and then removing up to that newly created timer. That is why I started researching: to remove any timer, but that assumes that timers are created incrementally. I was wondering: some specifications (for example, https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.setInterval) mentions creating intervalIDs but never specify in what way, and W3C speaks of handles rather than integer Ids. Also I understand that the list (for each object) is unique, so the timers (intervals and timeouts) must be aware of what they actually are.
type: UnansweredQuestion
tagged with: javascript-objects
tagged with: object-property
type: Question
upvote count: 2
tagged with: javascript
has title: How to get the "list of active timers" of a WindowTimer implemented object
favorite count: 0
score: 2
tagged with: timer
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/44070663
type: Comment
comment on: http://stackoverflow.com/a/27832404
has text: But wouldn't that just move the issue to a different file or folder? I already have it in a separate javascript file, i guess I should have mentioned that beforehand, sorry. And when you say different class, what exactly do you mean? I didn't think there were any classes in Javascript?
score: 0
type: AnswerComment

http://stackoverflow.com/q/27937606
type: Question
has comment: http://stackoverflow.com/comment/44272285
tagged with: angularjs-ng-repeat
score: 0
has answer: http://stackoverflow.com/a/27937860
tagged with: angularjs-directive
type: UnansweredQuestion
tagged with: angularjs-scope
has body: I am trying to load or open my first view using ui-view.I am not getting error but not able to show ciew here is my plunker http://plnkr.co/edit/kXJV11B0Bi8XV2nwMXLt (function() { 'use strict'; app.config(Routes); Routes.$inject = ['$stateProvider', '$urlRouterProvider']; function Routes($stateProvider, $urlRouterProvider) { // Default $urlRouterProvider.otherwise('/'); // Application $stateProvider .state('app', { url: '/', abstract: true, templateUrl: 'partial/firstpage.html' }); } })();
has title: how to load view in angular js using ui-view?
answer count: 2
has answer: http://stackoverflow.com/a/27937893
tagged with: javascript
tagged with: angularjs

http://stackoverflow.com/comment/44096927
type: Comment
comment on: http://stackoverflow.com/a/27845736
has text: did you try the `Tracker.autorun(function(){}):`?, the html its created and the objects, but seems like the first time the page load, the html its not there, so you need to put the "row" generator or whatever you are using inside a `Tracker.autorun`, to regenerate the template instance (sorry if im wrong). i think this piece of code should be inside auto run `sendFile($img, articlesArray);`, (i never use `edgee:slingshot package.`).
score: 0
type: AnswerComment

http://stackoverflow.com/a/27925473
type: Answer
has body: You could mock the Login service, then depending on a variable have it call the pass or fail functions. var failLogin; beforeEach(module(function ($provide) { failLogin = false; var mockLogin = { query: function(data) { return { $promise: { then: function(pass, fail) { if (failLogin) { fail('failure data'); } else { pass('pass data'); } } } } } } $provide.value('login', mockLogin); } it('should pass', function(){ LoginService.getActiveUser(); // should pass }); it('should fail', function(){ failLogin = true; LoginService.getActiveUser(); // should fail });
answers question: http://stackoverflow.com/q/27922925
score: 0

http://stackoverflow.com/comment/44300431
has text: That makes sense. I'm new to async and having trouble wrapping my head around it. I thought the point of .then was to wait until the query is finished and then do something with the result. Like I said, result[0] holds the object I'm trying to capture inside my callback function. Is it at all possible to make that object reachable outside of that function? I eventually want to pass it to a new template declaration.
score: 0
comment on: http://stackoverflow.com/a/27933686
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27804790
answers question: http://stackoverflow.com/q/27804574
has comment: http://stackoverflow.com/comment/44019387
score: 0
has body: Try using jquery instead; var height = $(window).height(); var width = $(window).width();
type: Answer
has comment: http://stackoverflow.com/comment/44020269

http://stackoverflow.com/q/27848608
has answer: http://stackoverflow.com/a/27849357
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44101503
tagged with: http://stackoverflow.com/tag/html
has title: How do I change HTML code after getting HTTP JSON response from Servlet
favorite count: 0
has comment: http://stackoverflow.com/comment/44101173
has comment: http://stackoverflow.com/comment/44101378
upvote count: 1
has comment: http://stackoverflow.com/comment/44101426
has comment: http://stackoverflow.com/comment/44102192
has body: I am running an Apache Tomcat Web Server with JSP/Servlets. I have a slideshow for my website that works off an html list of elements. I would like to populate this list with some JSON data that I parse after making a call to my Servlet. Normally I would do this in JQuery by changing the inner html of the list and adding each list item but I would like to use Angular JS instead. On a side note, I'm new to Angular JS. //Note: The list should look like this when all is said and done. $0.75 $3.00 The JSON Data returned by the Servlet looks like this {"items": [ { "quantity":"2", "price":"0.75", "name":"Ajax Super Deegreaser Lemon Dish Liquid 14 floz", "upc":"0003500044627", "category":"Cleaning Supplies" }, { "quantity":"2", "price":"3.00", "name":"Softsoap Hand Soap 56 floz", "upc":"0007418226991", "category": "Cleaning Supplies"} ] } This is my attempt at creating an app/controller to populate the list, unfortunately, halfway though I realized I couldn't figure out how to change the html/inner html of the list using angular. I have been following the W3 Schools tutorial on the subject but they weren't much help. //retrieves some random products for the slide show function getSlideshowProducts($scope,$http) { var items; $http({ url: "${pageContext.request.contextPath}/ItemServlet", method: "GET", params: {query: "random-item-list", count: "12"} }) .success( function(response) { items = angular.fromJson(response); } ); } Essentially I would like to figure out the proper way of getting each element of the JSON Array and doing something like the following...I'm used to going through the array using jquery and .each but with angular it's a bit confusing. {{x.price}}
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44103097
duplicate of: http://stackoverflow.com/q/9381926
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/27849357
tagged with: servlets
linked to: http://stackoverflow.com/q/9381926
type: Question

http://stackoverflow.com/a/76301284
has body: There is no need to test for any particular invalid character. Rather, make sure your content contains nothing but valid characters and deduce that there must be an invalid character otherwise. function applyInvalidCharacterFilter(password) { if (!password.match(/^[A-Za-z0-9\-_.:,;!@§\$%\/=?#]*$/)) { // The password contains illegal characters throw new Error('Das Passwort enthält unerlaubte Zeichen.'); } return 0; } You can add the above function to your list, and remove any specific tests of whether you have the '&amp;' character, as it would already have been caught. Also, I would recommend breaking your logic down into two steps. First, check whether the password is valid. You can treat all invalid passwords as having a strength value of zero and return an error message. Once proven valid, you can then assess the strength of a password and return a score.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27820724

http://stackoverflow.com/q/27858225
score: 0
linked to: http://stackoverflow.com/q/3559883
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/27858367
has comment: http://stackoverflow.com/comment/44119208
has answer: http://stackoverflow.com/a/27858433
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27859449
accepted answer: http://stackoverflow.com/a/27858367
possible better answer: http://stackoverflow.com/a/27858433
has title: Split url into tab in javascript
has comment: http://stackoverflow.com/comment/44119186
has body: input: "/desh/HRTY/THR/TDR/2015-01-09?passengers=STANDARD:1&amp;returnDate=2015-01-10&amp;max=0&amp;withThac=false" javascript: var params = {}; var paramDelim = link.indexOf('?'); var parmeters = link.substring(paramDelim + 1, link.length); var parts = parmeters.split('[&amp;=]'); output of my js code: 0: "passengers=STANDARD:1&amp;returnDate=2015-01-10&amp;max=0&amp;withThac=false" length: 1 i want to split my url into a map with key:value like this output: origin:THR destination:TDR goDate:2015-01-09 passengers:STANDARD:1 returnDate:2015-01-10 max:0 withThac:false My code not do exactly what i want in output, what is wrong ?
type: Question

http://stackoverflow.com/q/27908244
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/75877019
has body: I'm loading requirejs into a page like this: &lt;script src="components/requirejs/require.js" data-main="js/main"&gt;&lt;/script&gt; Then I have another requirejs code inside a function on an external script that I'm loading into the same page (because it's a widget that uses requirejs). The problem is that the second require is taking the config from the first one. It looks to me that there is a conflict on the global scope, which I do not understand since the requirejs code is encapsulated into a function. Any toughts? What is the best way to load requirejs twice into the same page wihtout messing things up?
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/19279196
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: requirejs
score: 2
has answer: http://stackoverflow.com/a/27909183
has title: requirejs conflict when loading twice in the same page
has answer: http://stackoverflow.com/a/27911512

http://stackoverflow.com/comment/44207105
score: 1
comment on: http://stackoverflow.com/q/27904002
has text: You're creating the model but not saving it to the DB.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27865335
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27866703
tagged with: javascript
has title: XSS in Javascript when sending encrypted data to server
favorite count: 0
tagged with: xss
tagged with: input
has answer: http://stackoverflow.com/a/27866703
has body: What is the best way of input sanitisation in Javascript when dealing with encrypted data? Lets say Bob enters the malicius code in the form instead of the regular message, my JS enrypts it with RSA and sends to server where the message waits for Alice to retrieve it. After decryption on Alice computer the malicious code steals some important secret from LocalStorage for example. Am I right the only way is to check if the message contains some bad code right after decryption? Maybe allow only alphanumeric charachters with some other basic ones to be allowed and when decrypted message contains anything else just stop script from running and erase the msg from memory?
tagged with: encryption

http://stackoverflow.com/q/27845284
tagged with: javascript
score: 0
tagged with: css
type: UnansweredQuestion
tagged with: scroll
has answer: http://stackoverflow.com/a/27850856
type: Question
has comment: http://stackoverflow.com/comment/44094687
has answer: http://stackoverflow.com/a/27845843
has title: One-page scroll problems
answer count: 2
has body: I am using a free wordpress theme (I know, that is part of the problem :). It is a one-page scrolling theme with a sticky header. The problem is that the links do not hit the top of the sections - they scroll past. I did use CSS to increase the size of the header. If this throws it off that much how do I correct it in the coding? site: http://whatsahead.com/closuremediatest/ (in the works) The oddest part is it is not even consistent on where it lands on that section. What could be causing this? CSS I edited: `.navbar-collapse { border-top: 1px solid transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset; overflow-x: visible; margin-left: 155px !important; padding-right: 15px; padding-left: 15px; background: #000; margin-bottom: 30px !important; margin-left: 195px !important; margin-top: 50px; max-height: 65px; } #navigation .navbar-nav { float: left; } #navigation .navbar-nav &gt; li &gt; a { font-family: "aleolight"; font-size: 20px; font-weight: normal; padding-bottom: 30px; padding-top: 20px; } .navbar-default .navbar-nav &gt; .active &gt; a, .navbar-default .navbar-nav &gt; .active &gt; a:hover, .navbar-default .navbar-nav &gt; .active &gt; a:focus { background-color: none !important; color: #b4d333 !important; } .navbar-default .navbar-nav &gt; li &gt; a:hover, .navbar-default .navbar-nav &gt; li &gt; a:focus { background-color: none; color: #b4d333 !important; } .navbar-default .navbar-nav &gt; .active &gt; a, .navbar-default .navbar-nav &gt; .active &gt; a:hover, .navbar-default .navbar-nav &gt; .active &gt; a:focus { background-color: transparent !important; } .navbar-default .navbar-nav &gt; li &gt; a { color: #fff; } .navbar-default .navbar-nav &gt; li &gt; a:before { background-color: transparent; background-image: url("http://whatsahead.com/closuremediatest/wp-content/uploads/2015/01/arrow-down.png"); background-position: 40% 40%; background-repeat: no-repeat; content: ""; display: block; height: 11px; left: 0px; position: absolute; margin-top:…

http://stackoverflow.com/q/27881727
type: Question
has comment: http://stackoverflow.com/comment/44174782
tagged with: javascript
tagged with: html-table
score: 0
answer count: 1
has body: I am asking to help me in following issue: I have a table created in Javascript by document.createElement('table') document.createElement('tr') document.createElement('td') The table is a web-calendar / organizer. So, I need the top row to display both dates and days in the cells. For now I have a code which displays only dates there. But how can I refer to the cells to put there names of days? I must say that ONLY native Javascript is available to use (no JS libraries or whatever)! If the table had been created by HTML code I'd have referred to its top row manually via data attribute. But I've got no idea about what should I do in the current situation. Any help will be appreciated!
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44165090
has answer: http://stackoverflow.com/a/27882136
has title: Javascript table / row select

http://stackoverflow.com/q/27947225
tagged with: arrays
answer count: 1
tagged with: angularjs
tagged with: d3.js
has body: I am trying to create a D3 Pie Chart with data of an API. The problem is that after the 'return' in .value of d3.layout.pie it will not generate the Pie with the different arrays (more than one array at least). I want all the count_downloads(arrays in different slices. The jsondata.uploads.length contains 50 array (or numbers). The data looks (in the console) like this: [10, 2, 34, 29, 57, 30, 35]. dataExample.json is just a placeholder, since that data is coming from the api. Thanks! (function() { var app = angular.module('nounTranslate', []); var json app.controller('apiController', function(){ var request_data = { url: 'oath.php', method: 'GET', data: { term: 'beer', site: 'http://api.thenounproject.com/' } }; var array = [] $.ajax({ url: request_data.url, type: request_data.method, data: request_data.data, dataType: "json" }).done(function(jsondata) { // HIER KOMT DE API DATA BINNEN //nieuwe (json)data zodat het niet conflict raakt json = jsondata; d3.json("dataExample.json", function (data) { setTimeout(function() { }, 600); for(i=0;i&lt;jsondata.uploads.length;i++){ jsonArrays = jsondata.uploads[i].count_download array.push(jsonArrays); // console.log(array); var pie = d3.layout.pie() .padAngle(.02) // Ruimte tussen de arcs .value(function(d) { // Vormt de data om naar de layout van de pie chart console.log(array); return parseInt(array); }) } var body = d3.select("body"); var div = body.append("div") .attr("id","chart") .attr("class","chart") // De omvang van de donut chart var width = 260, height = 260; // Maakt de donut chart rond var outerRadius = height / 2 - 10, innerRadius = outerRadius / 2, cornerRadius = 10; colors = d3.scale.category20c(); // Gebruikt een preset aan matchende kleuren //Geeft eigenschappen mee aan de arc (boog) vorm var arc = d3.svg.arc() .padRadius(outerRadius) .innerRadius(innerRadius); //Informatie weergaven arcs var infoHover = d3.select('#chart').append('div') .style('position', 'absolute') .style('padding', '0 25px') .style('opa…
has title: Generate D3 Pie Chart of api data
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27952027
score: 0
has comment: http://stackoverflow.com/comment/44294116
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44295117
accepted answer: http://stackoverflow.com/a/27952027

http://stackoverflow.com/q/27826833
type: Question
has comment: http://stackoverflow.com/comment/44061108
answer count: 1
tagged with: button
tagged with: javascript
tagged with: analytics
score: 0
has title: Google Analytics only counts first click
tagged with: tracking
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27829149
tagged with: google-analytics
has body: I'm trying to get GA to count every hit on a button. It's not working: only the first click is being counted. And I have to wait a very long time for another click from the same pc count again. Im using the universal code. Thx in advance

http://stackoverflow.com/comment/44156072
type: QuestionComment
comment on: http://stackoverflow.com/q/27876560
score: 1
has text: Please specify a proper example. Your example didn't match with fiddle. Where you want to click to close what?
type: Comment

http://stackoverflow.com/q/27927004
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27927063
has answer: http://stackoverflow.com/a/27927192
linked to: http://stackoverflow.com/q/359494
has comment: http://stackoverflow.com/comment/44251226
has comment: http://stackoverflow.com/comment/44251177
has answer: http://stackoverflow.com/a/27927086
type: AnsweredQuestion
has title: Evaluating radio buttons in JavaScript
has body: I'm new to JavaScript and I'm trying to use the if statement to evaluate the selected radio button. It didn't work, so I'm asking if it's because I did something wrong or because it's not possible in JavaScript. &lt;form name = "f1"&gt; &lt;input type = "radio" Name = "r1" Value = "Input" onClick="GetSelectedItem(this)"&gt;Input &lt;input type = "radio" Name = "r1" Value = "Output" onClick ="GetSelectedItem(this)"&gt;Output &lt;/form&gt; &lt;script&gt; var output = document.getElementById('output'); function GetSelectedItem(el) { output.innerHTML = el.value; if(output=="Input") *** do stuff *** /// else if( output=="output") ** do stuff2 *** } &lt;/script&gt;
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44251181
has comment: http://stackoverflow.com/comment/44251101
possible better answer: http://stackoverflow.com/a/27927086
accepted answer: http://stackoverflow.com/a/27927063
score: 0
answer count: 3

http://stackoverflow.com/comment/44206669
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27903655
has text: Which Object are we talking about?
score: 0

http://stackoverflow.com/q/27852670
has body: I have nested controllers and I'm using John Papa's style guide, so they are controller as. One controls the entire form for client validation and submit. The other controls a section of the HTML view that deals with location and is supposed to hide the STATE input for small COUNTRYs that don't have states, so no input should occur. COUNTRY is selected in a select tag. The dropdown is a JSON translation object from a factory and the English selection works. If certain countries are selected, the STATE input should hide / disappear. The first problem is that does not happen. I presume the user click on a country in the dropdown is outside $digest and have $timeout() to insert it, but it still doesn't work. I'm not using ng-click because 2 clicks occur - 1 to open the select, and another to make the selection. The second and related problem is that countrySelected is undefined in SelectCountryController, and I can't figure out why. If I hard code a country, it all works on page load, but it has never worked with a user click in the select dropdown. HTML TEST Language: {{ vm.langKey }} <p translate>COUNTRY TEST selected item is : {{vm.countrySelected}} STATE Angular/Javascript for the interior SelectCountryController (function() { 'use strict'; angular.module( 'residenceApp' ).controller( 'SelectCountryController', SelectCountryController ); //end of controller module SelectCountryController.$inject = [ '$translate', 'selectCountryTranslateFactory', '$timeout' ]; function SelectCountryController( $translate, selectCountryTranslateFactory, $timeout ) { var vm = this; vm.langKey = {}; vm.hideState = false; vm.countries = countries(); vm.hideState = hideStateSelector(); function countries() { vm.langKey = $translate.use(); //use() as a getter return selectCountryTranslateFactory.withLangChoice( vm.langKey ); } function hideStateSelector() { var countriesWithNoStates =[ "AI", "AG", "AW", "BS", "BB", "BM" ]; if( countriesWithNoStates.indexOf( vm.countrySelected ) > -1 ) { $…
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27852845
accepted answer: http://stackoverflow.com/a/27852845
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
has title: Nested controllers that don't select in a select tag dropdown to hide another input element
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/comment/44107163
type: AnswerComment
comment on: http://stackoverflow.com/a/27851235
type: Comment
score: 0
has text: That is not working when I put the $scope.left expression in the controller.

http://stackoverflow.com/q/27806252
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/44021514
accepted answer: http://stackoverflow.com/a/27806356
tagged with: arrays
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27806452
score: 0
answer count: 3
has title: How can I put JSON data into a jQuery/Javascript array for later use?
has body: I have some code like this: var data = // coming in from AJAX and confirmed working, don't need to wory about this... var row = // cloning an existing HTML structure in the DOM for (i = 0; i &lt; data.length; i++) { var rowclone = row.clone(); var orderLastChangedTime = new Date(data[i].createDate); var diffDays = Math.round(Math.abs((currentTime.getTime() - orderLastChangedTime.getTime())/(oneDay))); rowclone.find(".home-order-calc").text(diffDays); rowclone.find(".home-order-status").text(data[i].status); rowclone.find(".home-order-po-number").text(data[i].poNumber); rowclone.find(".home-order-number").text(data[i].orderId); rowclone.find(".home-order-last-changed").text(orderLastChangedTime); rowclone.find(".home-order-lines").text(data[i].itemsCount); rowclone.find(".home-order-cost").text(data[i].cost); var rowstatus = rowclone.find(".home-order-status").text(); rowstatus = rowstatus.toUpperCase(); openJSONitems = []; closedJSONitems = []; otherJSONitems = []; if (status[rowstatus] == "open") { openJSONitems.push(rowclone); } else if (status[rowstatus] == "closed") { closedJSONitems.push(rowclone); } else { otherJSONitems.push(rowclone); } console.log(openJSONitems); openJSONitems.appendTo("#home-table-orders"); } I am trying to create 3 new JavaScript arrays and array push data into them based on sort criteria from the JSON payload. Once they are sorted I want to hang on to them and attach them to the DOM on some user actions... what am I doing wrong?
has answer: http://stackoverflow.com/a/27806356
possible better answer: http://stackoverflow.com/a/27806331
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27806331
tagged with: http://stackoverflow.com/tag/json

list
type: Tag
tags question: http://stackoverflow.com/q/27837442
tags question: http://stackoverflow.com/q/27848772
tags question: http://stackoverflow.com/q/27880165
tag name: list
tags question: http://stackoverflow.com/q/27946611
tags question: http://stackoverflow.com/q/27833594

http://stackoverflow.com/q/27889800
linked to: http://stackoverflow.com/q/2440700
possible better answer: http://stackoverflow.com/a/27889927
linked to: http://stackoverflow.com/q/1985260
has answer: http://stackoverflow.com/a/27889927
has comment: http://stackoverflow.com/comment/44180614
has comment: http://stackoverflow.com/comment/44180803
type: Question
upvote count: 4
has body: Having the following array : var arr = [a,b,c,d,e]; I'm struggling to get a clean function that sorts the array based on a specified index, keeping at the same time the original order For example, sorting the array from index 3 (so here, from "d"), would give the following : [d,e,a,b,c] From index 2 : [c,d,e,a,b] etc... It might be obvious for some but I can't make it in my mind Help appreciated, thx in advance * Edit * Is a duplicate. Here is a good one. https://stackoverflow.com/a/7861200/102133
has comment: http://stackoverflow.com/comment/44180876
has answer: http://stackoverflow.com/a/27889903
answer count: 2
has comment: http://stackoverflow.com/comment/44180641
duplicate of: http://stackoverflow.com/q/1985260
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: sorting
score: 4
has comment: http://stackoverflow.com/comment/44180598
has comment: http://stackoverflow.com/comment/44180581
favorite count: 0
has comment: http://stackoverflow.com/comment/44180829
has comment: http://stackoverflow.com/comment/44180660
has comment: http://stackoverflow.com/comment/44182137
has title: Javascript arrays // reordering an array starting at a specified index while keeping the original order
accepted answer: http://stackoverflow.com/a/27889903
has comment: http://stackoverflow.com/comment/44180593
has comment: http://stackoverflow.com/comment/44181157
has comment: http://stackoverflow.com/comment/44180894
has comment: http://stackoverflow.com/comment/44180613
has comment: http://stackoverflow.com/comment/44180586
type: AnsweredQuestion

http://stackoverflow.com/q/27901433
type: AnsweredQuestion
downvote count: 0
type: Question
upvote count: 2
tagged with: c#
tagged with: asp.net-web-api
tagged with: javascript
tagged with: jquery
has body: I'm getting a Error : "POST {URL} 415 (Unsupported Media Type)" error And cannot figure out why it's happening. I'm trying to upload an excel file in JQuery using FormData. Here is the code: var formdata = new FormData(); var file = input.get(0).files[0]; formdata.append('content', file); var url = "/Phrase/Import/" + $('.exportPanel #Language').val() var ajax = $.ajax({ url: url, type: "POST", data: formdata, processData: false, contentType: false, success: function (data, textStatus, jqXHR) { //Do something. }, error: function (jqXHR, textStatus, errorThrown) { //Do something. } }); Here is the controller code: [Route("Import/{languageID}")] [HttpPost] public void ImportPhrases([FromUri]int languageID, [FromBody]Stream content) { _service.ImportPhrases(content, languageID); } I noticed that, according to Fiddler, the content type of the request is different to that of the response (not sure if this makes a difference?). Request: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Response: application/json; charset=utf-8 The JQuery above is being used in a different part of the system, but uses WCF instead of Web API (am in the process of changing from WCF to MVC/Web API), again I'm not sure if this makes a difference? Can anyone tell me what I'm doing wrong please? Many thanks.
answer count: 1
accepted answer: http://stackoverflow.com/a/27901558
favorite count: 0
has title: 415 Unsupported Media Type Using JQuery/FormData and Web Api
has answer: http://stackoverflow.com/a/27901558
score: 2

http://stackoverflow.com/a/27963462
has comment: http://stackoverflow.com/comment/44320795
has body: If you just asking for simple sorting then here is it HTML Js var myApp = angular.module('myApp', []); myApp.controller('DatesCtrl', ['$scope', function($scope) { $scope.identity = angular.identity; $scope.dates = [ new Date("2015-01-16T00:00:00"), new Date("2015-01-15T00:00:00"), new Date("2015-01-17T00:00:00") ]; }]); Example
upvote count: 2
answers question: http://stackoverflow.com/q/27963268
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44320565

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/27903725

http://stackoverflow.com/comment/44319630
type: Comment
type: QuestionComment
has text: How do I make it stop at the breakpoint like it has done in earlier versions of IE?
comment on: http://stackoverflow.com/q/27941713
score: 0

http://stackoverflow.com/q/27910783
has body: How can I move a file using the URL I get from the Camera? neither successCallback nor errorCallback is called by the function moveTo. Can anyone tell me what I am doing wrong and what a possible solution looks like? function successCallback(entry) { console.log("New Path: " + entry.fullPath); alert("Success. New Path: " + entry.fullPath); } function errorCallback(error) { console.log("Error:" + error.code) alert(error.code); } // fileUri = file:///emu/0/android/cache/something.jpg function moveFile(fileUri) { newFileUri = cordova.file.dataDirectory + "images/"; oldFileUri = fileUri; fileExt = "." + oldFileUri.split('.').pop(); newFileName = guid("car") + fileExt; // move the file to a new directory and rename it fileUri.moveTo(cordova.file.dataDirectory, newFileName, successCallback, errorCallback); } I am using Cordova version 4.1.2 Also installed the Cordova File Plugin
answer count: 1
accepted answer: http://stackoverflow.com/a/27928809
has comment: http://stackoverflow.com/comment/44254142
upvote count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has title: Cordova Move File using the file url
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27928809
tagged with: html5-filesystem
score: 4
tagged with: cordova

http://stackoverflow.com/comment/44016532
has text: No console errors, however `error.message` (which reflects Parse.com errors in processing the request) sends back `Voting Error: Object not found`. This error is in reference to an undefined `votingOn` in `query.get(votingOn)`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27803734

http://stackoverflow.com/comment/44033853
comment on: http://stackoverflow.com/q/27813359
score: 0
type: Comment
type: QuestionComment
has text: How to convert the base64 string to txt format?

http://stackoverflow.com/comment/44255095
type: AnswerComment
type: Comment
has text: you need to actually move the element. You may find it simpler to used the [`.position`](http://api.jquery.com/position/) method to align the image and text with the `ui.handle` element
comment on: http://stackoverflow.com/a/27912011
score: 0

http://stackoverflow.com/comment/117256789
has text: HTML to JSX convert: https://transform.tools/html-to-jsx
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27934238

http://stackoverflow.com/q/27813794
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/43415570
downvote count: 0
tagged with: jquery
has body: I have created a Google Pie chart. I need to add a border around the Google pie chart can you guys help me to add this? I have added the code for the Google Chart and the image I want it to be done. My Read
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27814146
tagged with: css
has comment: http://stackoverflow.com/comment/44134259
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44037286
type: Question
has title: Add a border around the Google pie chart
tagged with: google-visualization

http://stackoverflow.com/q/27898232
has body: Here is my code, and this code to open new tab and focus on it. If tab is not opened yet, I will open it with specify name. If tab is opened, I will focus on it by using window.focus(); Quick test: http://jsfiddle.net/u2jd2oLw/1/ Javascript Code var tabs = []; $('#btnOpenTab').on('click', function(){ openTab('http://google.com.vn', 'GG'); }); function openTab(url, tabNm) { try { if (tabs[tabNm]) { tabs[tabNm].focus(); } else { var mTab = window.open(url, tabNm); tabs[tabNm] = mTab; tabs[tabNm].focus(); } } catch(e) { alert(e.message); } } HTML Code Open Tab Actually, I check in IE11, it occurred that "Access is denied" And I tried to turn off option: "Turn on Pop-up Blocker" by un-check CheckBox. Do you have any suggestion? Thanks!!
has answer: http://stackoverflow.com/a/27899398
has answer: http://stackoverflow.com/a/27898520
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1751912
tagged with: internet-explorer
type: Question
score: 0
answer count: 2
has title: function Window.focus doesn't work in IE (8, 9, 10, 11)
tagged with: javascript

http://stackoverflow.com/comment/44291047
has text: Did you try checking `videoPlayer.src` to find out which of the three sources it is currently playing?
comment on: http://stackoverflow.com/q/27947984
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44221289
comment on: http://stackoverflow.com/q/27901561
has text: @RGraham ha haa, I've actually just logged on to check that. Your right. Everyday's days a school day, thanks for the spot. Interestingly it also trims the input which i didn't know the coercion would do i.e. " 20" * " 5 " and " 20" / " 2" still work.
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/44059606
type: Comment
has text: even without any quotations in the string at all it's not displaying the json
score: 0
comment on: http://stackoverflow.com/q/27825603
type: QuestionComment

http://stackoverflow.com/comment/44251998
type: AnswerComment
score: 0
type: Comment
has text: Thanks Kevin! I might tweak my jquery.js to console an alert there for future reference. Just working on the extra code snippets I missed (well, getting my head round them). Will let you know how I do
comment on: http://stackoverflow.com/a/27926972

http://stackoverflow.com/q/27835396
type: UnansweredQuestion
has title: Create redirect link based on current user using java & html
tagged with: http-redirect
has answer: http://stackoverflow.com/a/27835449
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27835493
has body: Authentication based on Google account. How to create redirect link based on current user. For example: My site: www.test.com/home If user A logged on, when he/she press my page it should go to www.test.com/User A If user B logged on, when he/she press my page it should go to www.test.com/user B Note: PHP not support in my application

http://stackoverflow.com/a/51789597
downvote count: 3
score: 5
has comment: http://stackoverflow.com/comment/140075648
upvote count: 8
has body: This one will work for any extension type: pdf, mp3, png, .... base64.substring(base64.indexOf('/') + 1, base64.indexOf(';base64'));
type: Answer
answers question: http://stackoverflow.com/q/27886677

http://stackoverflow.com/q/27940047
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Difference between document.write(HTML) and document.documentElement.innerHTML= HTML
has comment: http://stackoverflow.com/comment/44277016
favorite count: 0
score: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44288153
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44323112
linked to: http://stackoverflow.com/q/802854
has comment: http://stackoverflow.com/comment/44289069
has body: I am using the document.write( HTML ) to change a document html and it re-renders the page by itself, which is exactly what I want, but it does not show the same behavior on IE, as following: document.open(); document.write(&lt;HTML&gt;); document.close(); So I tried the following : document.documentElement.innerHTML = &lt;HTML&gt;; But it did not render the page unless I refresh it. So what is the difference between them, and what is the best way to change the document content and re-render it?
type: Question
has answer: http://stackoverflow.com/a/27964005
answer count: 1

http://stackoverflow.com/q/27954287
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27954564
score: 0
has title: Node JS Rendering Blank Page
tagged with: node.js
type: AnsweredQuestion
has body: I have a problem where if I connect to localhost:3000 or 127.0.0.1:3000, I get a completely blank page. Here is the code via GitHub https://github.com/InfamousGamez/halp Here is a picture localhost:3000, what I currently am running node on. http://gyazo.com/1b92c35798bef88980eaec882572d851 Is there something wrong with my code or is it a express/node error?
has answer: http://stackoverflow.com/a/27954564
type: Question
tagged with: mongodb

http://stackoverflow.com/comment/44256790
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27929055
has text: It's supposed to not return errors. Obviously I have greater intents, this is just an example. Nobody ever asks "what's the point of 'foo' and 'bar'?"
score: 0

http://stackoverflow.com/a/27954747
has body: With selenium you mimic the real-user interactions in a real browser - tell it to locate an input, write a text inside, click a button etc - high-level approach - you don't even need to know what is there under-the-hood, you see what a real user sees. The downside here is that there is a real browser involved which, at least, slows things down. You can though, automate a a headless browser (PhantomJS), or use a Xvfb virtual framebuffer if you don't have conditions to open up a browser with a UI. Example: from selenium import webdriver driver = webdriver.PhantomJS() driver.get('url here') button = driver.find_element_by_id('linkSaveDestination') button.click() With requests+BeautifulSoup, you are going down to the bare metal - using browser developer tools you research/analyze what requests are made to a server and mimic them in your code. Sometimes the way a page is constructed and requests made are too complicated to automate, or there are anti-web-scraping technique used. There are pros &amp; cons about both approaches - which option to choose depends on many things.
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44773277
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27954723

http://stackoverflow.com/q/27844527
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44093014
has title: Custom message box in JavaScript
tagged with: css
has answer: http://stackoverflow.com/a/27853360
accepted answer: http://stackoverflow.com/a/27853360
has comment: http://stackoverflow.com/comment/44093767
has body: Im looking at making a custom message box in JavaScript but am wondering how I go about doing it. I have this code below which shows a Yes, No, Cancel message Box: msls.showMessageBox("Please choose the appropriate button", { title: "This is a message box", buttons: msls.MessageBoxButtons.yesNoCancel }).then(function(result) { if (result === msls.MessageBoxResult.yes) { alert("You have selected Morning"); } else if (result === msls.MessageBoxResult.no) { alert("You Have Selected Afternoon"); } else if (result === msls.MessageBoxResult.cancel) { alert("You have closed this message box"); } }); } my goal is to rename the button text but im not sure how to do it, here is an example of what I mean: Yes to be Morning No to be Afternoon cancel to be cancel I know how to change what each button does, its just the small part of editing the text inside the button to say what i want, thanks for any help im using Lightswitch HTML and the message box is referenced in jquery.mobile.structure-1.3.0.css file
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27856363
tagged with: visual-studio-lightswitch
has answer: http://stackoverflow.com/a/27856363
type: Question
tagged with: lightswitch-2013
has comment: http://stackoverflow.com/comment/44093415
answer count: 2

http://stackoverflow.com/comment/44059731
comment on: http://stackoverflow.com/a/27826908
score: 0
type: AnswerComment
has text: Hey that worked, thank you. So I guess instead of putting the CSS selector in the $(), I make it the second argument in the $(document).on? Thanks for the solution.
type: Comment

http://stackoverflow.com/a/27870779
answers question: http://stackoverflow.com/q/27870745
score: 2
upvote count: 2
has body: You are not implementing Positive Lookbehind, (?:...) syntax is called a non-capturing group which is used to group expressions, not capture them (usually used in alternation when you have a set of different patterns). You can simply reference the captured group for the match result. var r = 'XXXXmyParameter=foobar'.match(/myParameter=([A-Za-z]+)/)[1]; if (r) console.log(r); //=&gt; "foobar" Note: Lookbehind assertions are not supported in JavaScript ...
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44187603
comment on: http://stackoverflow.com/q/27892300
type: Comment
type: QuestionComment
has text: What are you trying to accomplish? The google maps javascript API v3 uses canvas for some of its rendering. It sounds to me like you are trying to reproduce that functionality.
score: 0

http://stackoverflow.com/comment/71360127
type: Comment
comment on: http://stackoverflow.com/a/27822700
has text: Just make the exporterSuppressColumns comma delimited, like so: exporterSuppressColumns: [ 'gender','company' ]
type: AnswerComment
score: 0

http://stackoverflow.com/a/27855140
has comment: http://stackoverflow.com/comment/44114274
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44113765
has body: Seems weird to use a link to submit a form, but your problem is you are not cancelling the click action on the anchor. $('.btn_submit').on("click", function(evt) { evt.preventDefault(); $('form').submit(); });
answers question: http://stackoverflow.com/q/27854926
downvote count: 0
has comment: http://stackoverflow.com/comment/44113830

http://stackoverflow.com/comment/44226025
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27913085
has text: I'll try and get a fiddle up later. The views however contain observable arrays constantly updated buy a long poll to the server. The UI has a foreach binding to these observable arrays.

http://stackoverflow.com/comment/44182924
score: 0
has text: This is not a web page, this is a simple one line script. But it is transferred with wrong headers. May be you can report this issue to a site owners?
type: Comment
comment on: http://stackoverflow.com/q/27891017
type: QuestionComment

http://stackoverflow.com/comment/44290406
type: Comment
score: 0
has text: That returns DOMException: Failed to execute 'querySelector' on 'Document': 'html>body>section:eq(3)>ul>li:eq(1)>div' is not a valid selector.
comment on: http://stackoverflow.com/q/27947746
type: QuestionComment

http://stackoverflow.com/comment/44177236
type: AnswerComment
score: 0
type: Comment
has text: @Ja͢ck Yeah, that's what I don't understand. I never got any type errors, only a reference error on the OP's fiddle.
comment on: http://stackoverflow.com/a/27888081

http://stackoverflow.com/comment/44055731
comment on: http://stackoverflow.com/a/27824386
type: Comment
has text: Main loop is the while loop and it driven by the value of `ind`. ind is an index for each month. So it also holds and make sure the id of the calendar instance. It is just to make sure that each calendar for every month.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27946179
has body: It is quite clear. I have an array with some links and I want to build a loopto try all of them, but the problem is that link is always 3. It means that it read the last number in my array. Why? How can I fix it? var categories = ['1','2','3']; for( var i = 0; i &lt; categories.length; i++ ) { var link = '/'+categories[i]; browser.get(link); browser.sleep(2000); browser.driver.getCurrentUrl().then( function(url) { expect(url).toMatch(link); }); } and I have list of divs and I want to read randomly infos from them. So I made the following chosenOffer = Math.floor( (Math.random() * count ) + 1); offer = element.all( by.className('offer')).get( chosenOffer ); But it shows always error message chosenOffer object...
upvote count: 1
tagged with: unit-testing
type: Question
accepted answer: http://stackoverflow.com/a/27946377
tagged with: protractor
downvote count: 0
tagged with: javascript
tagged with: end-to-end
answer count: 1
score: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27946377
has title: Add two parameters in function into "then" protractor
linked to: http://stackoverflow.com/q/27910331
type: AnsweredQuestion

http://stackoverflow.com/q/27872546
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27872612
score: 2
has title: Troubleshooting AJAX XMLHTTP object creation
type: AnsweredQuestion
upvote count: 2
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27872612
has body: Troubleshooting this function and having trouble finding an error with it as the ajax stuff is all copy-pasted from a guide I'm following: function updateStuff() { // Data validation for a text var called val var xmlHttp ; if(window.ActiveXObject){ try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }catch(e) xmlHttp = false; }else{ try{ xmlHttp = new XMLHttpRequest(); }catch(e){ xmlHttp = false; } } if(!xmlHttp) alert("Error : Cannot create xmlHttp object"); else{ alert("Worked"); //xmlHttp.open("GET","update.php?val="+val,true); //xml.onreadystatechange = handleServerResponse; //xmlHttp.send(); } } } Right now I'm just trying to get the "Worked" alert to display at the end of the if-statement. I know the JS is all linked correctly because if I take all the ajax out the data validation works properly with alerts.
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/44280744
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27936772
type: QuestionComment
has text: ES6 is finalized and new features are no longer added, AFAIK.

http://stackoverflow.com/a/27920075
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44324291
has body: You are talking about two different things. First is SSL and encryption of network second is password hashing in db. To be secure you should use both SSL and password hashing. If you do not want to pay for signed certificate you can create own cert not signed by CA and give it to your friends (in secure manner) they should include it in browser or they should check certificate fingerprint each time they connect to site. Any one who do not have this cert or its fingerprint will not know it there is MITM and browser will complain about it.
answers question: http://stackoverflow.com/q/27901052
upvote count: 1
has comment: http://stackoverflow.com/comment/44312733
has comment: http://stackoverflow.com/comment/44349913
score: 1
accepted answer of: http://stackoverflow.com/q/27901052

http://stackoverflow.com/q/27847533
has comment: http://stackoverflow.com/comment/44101534
tagged with: php
tagged with: drupal
type: AnsweredQuestion
has body: I am trying to populate 3 hidden HTML files upon submitting a form based on values received from an iFrame message. This form is built using the Drupal Form API On page load, I append 3 hidden fields to the form and setup the eventListener setupMonerisHiddenFormElements() { $('&lt;input type="hidden"&gt;').attr({ id: 'responseCode', name: 'responseCode', }).appendTo('form'); $('&lt;input type="hidden"&gt;').attr({ id: 'dataKey', name: 'dataKey', }).appendTo('form'); $('&lt;input type="hidden"&gt;').attr({ id: 'errorMessage', name: 'errorMessage', }).appendTo('form'); } window.onload = function() { is_production = Drupal.settings.moneris_payment_processor.is_production; qa_gateway_url = Drupal.settings.moneris_payment_processor.qa_gateway_url; prod_gateway_url = Drupal.settings.moneris_payment_processor.prod_gateway_url; gateway_url = ((is_production) ? qa_gateway_url : prod_gateway_url); if (window.addEventListener) { window.addEventListener("message", processMonerisResponse, false); } else { if (window.attachEvent) { window.attachEvent("onmessage", processMonerisResponse); } } setupMonerisHiddenFormElements(); } I can see these fields are being added on the form. This is not the problem. When the form gets submitted the function submitMonerisIframe() is called by this Drupal form attribute: $form['#attributes'] = array('OnSubmit' =&gt; 'submitMonerisIframe();'); Here i am posting the message and can see that my processMonerisResponse() function is being called (see below) function submitMonerisIframe() { var monFrameRef = document.getElementById('monerisFrame').contentWindow; monFrameRef.postMessage('',gateway_url); } I have added my debugging. When I submit the form, I can see that the hidden values are being set correctly. function processMonerisResponse(e) { console.log(e.data); this.respData = eval("(" + e.data + ")"); $('#responseCode').attr('value',respData.responseCode); $('#errorMessage').attr('value',respData.errorMessage); $('#dataKey').attr('value',respD…
type: Question
has comment: http://stackoverflow.com/comment/44099012
has answer: http://stackoverflow.com/a/27849057
tagged with: javascript
tagged with: jquery
has title: How do I set Hidden field values from an iFrame response with Javascript?
score: 0
possible better answer: http://stackoverflow.com/a/27849057
answer count: 2
has answer: http://stackoverflow.com/a/27847694
accepted answer: http://stackoverflow.com/a/27847694

http://stackoverflow.com/a/27886230
type: Answer
has body: Attach the click handler afterwards. You should also change your id to a class, because you are likely going to have multiple buttons the way you are doing this. var text = $(item).html().replace(exp, " Click "); $('.btnac').on( 'click', function() { window.alert( "hi!" ); } );
answers question: http://stackoverflow.com/q/27886204
score: 0

http://stackoverflow.com/q/27872521
type: Question
has comment: http://stackoverflow.com/comment/44147363
answer count: 2
has comment: http://stackoverflow.com/comment/44147443
has answer: http://stackoverflow.com/a/27872586
has comment: http://stackoverflow.com/comment/44147436
has answer: http://stackoverflow.com/a/27873182
tagged with: javascript
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44147421
has comment: http://stackoverflow.com/comment/44147335
score: 0
has title: Textbox becomes readonly on postback even when setting the readonly attribute to false manually
has body: So, in my current application in ASP.net, I have a weird bug. Textbox that I have added in the existing page, goes in read only mode after the postback. When the page loads the first time, textbox works fine. But after page load, it stays enabled and in read only mode. I checked Dev tools in IE, and the text box has readonly attribute set to false, as expected. I can even set the other properties from the js function called during page load, and they work fine. Only the readonly attribute doesn't work. I am unable to figure out a reason as to why this is happening, so I am unable to solve it either. &lt;tr&gt; &lt;td nowrap align="right"&gt; &lt;asp:Label ID="lblResTimeDescription" runat="server" EnableViewState="False" CssClass="Common"&gt;Response Time Comments&lt;/asp:Label&gt;&amp;nbsp;:&amp;nbsp;&lt;/td&gt; Textbox code: &gt; &lt;asp:TextBox ID="txtResTimeDescription" CssClass="TextBox" &gt; MaxLength="200" TextMode="MultiLine" runat="server" Width="100%" &gt; Height="50px" ReadOnly="false"&gt;&lt;/asp:TextBox&gt; P.S. Do let me know, which code I can post here. Edit: JS function called at the very end of the page load. function fnEnableComments(e) { var strCompletion = document.getElementById("ddlCompletion").value; if (strCompletion == "Y") { document.getElementById("txtResTimeDescription").disabled = false; document.getElementById("txtResTimeDescription").setAttribute("value", "zyx"); document.getElementById("txtResTimeDescription").setAttribute("ReadOnly",false); } else { document.getElementById("txtResTimeDescription").disabled = true; document.getElementById("txtResTimeDescription").value = ""; } } This function gets called properly, as I can see the value change to zyx. Edit 2: Removed all hints of readonly from code and js. Still the same problem. Also, the textbox is getting enabled properly, on change of dropdown, gets the value set properly. I can even click on the text box to set the focus, but I just can't change the value in it. Edit 3: Program wo…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44147386
tagged with: c#

http://stackoverflow.com/comment/44183414
has text: Amen brother man. As everything has its quirks, so does node. But I agree, outdated tutorials is a great sign of growth. With node still growing everyday, it's not something to rule out. It's a great tool. Maybe for your next numeric computation or scientific evaluation project, don't use it though.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27890811

http://stackoverflow.com/a/52960008
has comment: http://stackoverflow.com/comment/106271082
downvote count: 0
type: Answer
has body: I used this library called Parser. It worked for what I needed. import React, { Component } from 'react'; import Parser from 'html-react-parser'; class MyComponent extends Component { render() { &lt;div&gt;{Parser(this.state.message)}&lt;/div&gt; } };
has comment: http://stackoverflow.com/comment/99370350
upvote count: 12
score: 12
answers question: http://stackoverflow.com/q/27934238

http://stackoverflow.com/a/27863797
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27862979
type: Answer
upvote count: 2
has body: I would say you want to checkout promises or async. Async has a parallel function I find useful in this situation. https://github.com/caolan/async#paralleltasks-callback It allows you to run multiple async functions at once then a callback is called when all functions are done. I think it would work perfectly for your needs. Here is an example from their docs: var async = require('async'); async.parallel([ function(callback){ setTimeout(function(){ callback(null, 'one'); }, 200); }, function(callback){ setTimeout(function(){ callback(null, 'two'); }, 100); } ], // optional callback function(err, results){ // the results array will equal ['one','two'] even though // the second function had a shorter timeout. });
has comment: http://stackoverflow.com/comment/44130222

http://stackoverflow.com/a/27893321
upvote count: 1
score: 0
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44194217
answers question: http://stackoverflow.com/q/27893308
has body: That's because the elements are not in the DOM when you run the jQuery selector. Use event delegation. $(function () { $(document).on('click', 'tr', function () { $(this).toggleClass("obarva"); }); });

http://stackoverflow.com/q/27837251
duplicate of: http://stackoverflow.com/q/44128395
tagged with: javascript
score: 0
has body: In an XML view I have an expandable Panel. Here, I can expand the panel only with clicking the arrow icon. Is there a way to make the icon AND the whole Panel clickable? Here's a snippet for a simple Panel: http://jsbin.com/wamutodubu/1/
has answer: http://stackoverflow.com/a/27848439
answer count: 1
has title: SAPUI5 make the whole row clickable for sap.m.Panel
has comment: http://stackoverflow.com/comment/109990720
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27848439
tagged with: sapui5
linked to: http://stackoverflow.com/q/44128395
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/44269935
type: Comment
comment on: http://stackoverflow.com/a/27887302
has text: thanks, but what i want to ask is to access properties of the function itself instead of properties of the prototype
score: 1
type: AnswerComment

http://stackoverflow.com/a/78629388
answers question: http://stackoverflow.com/q/27928372
has body: See the problem is react serve single page application so I don't think there is any way you can access your files directly if you are going to use a single react project and a single server , I would suggest you using react-router-dom and replacing the href tags with navigate() function and a tag with Link tag , if you want to hide your data then you have to actually make a separate react project or a public folder in your server , basically do ssr for that purpose . Here is my sample code where I wanted to add post and some Link Tags example : const navigate = useNavigate(); const userData = useSelector((state) => state.auth.userData); const submit = async (data) => { if (post) { const file = data.image[0] ? await appwriteService.uploadFile(data.image[0]) : null; if (file) { appwriteService.deleteFile(post.featuredImage); } const dbPost = await appwriteService.updatePost(post.$id, { ...data, featuredImage: file ? file.$id : undefined, }); if (dbPost) { navigate(`/post/${dbPost.$id}`); } } else { const file = await appwriteService.uploadFile(data.image[0]); if (file) { const fileId = file.$id; data.featuredImage = fileId; const dbPost = await appwriteService.createPost({ ...data, userId: userData.$id }); if (dbPost) { navigate(`/post/${dbPost.$id}`); } } } }; The Link example for checking if the user is the author {isAuthor && ( Edit Delete )} Remember that this is an illusion we are creating for the user that it's a multi page application whereas in reality it's a single page application made in such way that it loads data like a multi page application.
type: Answer
score: 0

http://stackoverflow.com/comment/96333650
type: AnswerComment
type: Comment
has text: Same folder as .ipython notebook. Use argument '--output NotebookNoCode' to rename the file.
comment on: http://stackoverflow.com/a/50790330
score: 0

http://stackoverflow.com/q/27830717
has answer: http://stackoverflow.com/a/27831096
answer count: 3
score: 0
accepted answer: http://stackoverflow.com/a/27830773
has comment: http://stackoverflow.com/comment/44067417
tagged with: javascript
has comment: http://stackoverflow.com/comment/44067396
has title: jQuery - Dialog Box using .closest?
tagged with: jquery
type: Question
possible better answer: http://stackoverflow.com/a/27830766
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44067391
has answer: http://stackoverflow.com/a/27830766
has body: I'm trying to pop a dialog box open using .closest but I can't seem to make it work. I've fiddled it here: http://jsfiddle.net/dx2yz8mg/ $(function(){ $('.prdDetails').click(function() { $('#prdDetails').dialog({ draggable: false, height: 430, modal: true, resizable: false, width: 774, }); return false; }); }); I've tried this : $(this).closest('#prdDetails').dialog({ I feel like this is okay but it doesn't work, does anybody have any ideas? The reason I need to do it this way is I'm pulling in content dynamically. Currently when you click the second .prdDetails you see the first #prdDetails in the popup.
has answer: http://stackoverflow.com/a/27830773

http://stackoverflow.com/q/27928718
tagged with: ember.js
has answer: http://stackoverflow.com/a/27930091
has comment: http://stackoverflow.com/comment/44254886
has answer: http://stackoverflow.com/a/27949450
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27930091
possible better answer: http://stackoverflow.com/a/27949450
has body: I have a Book model instance and would like to get a href string to it given its route. Eg: someEmberJSMethod('book.edit', aBookInstance) #=&gt; "/books/12/edit" Given the route: @resource "books", -&gt; @route "edit", path: "/:book_id/edit" I tried looking at the Ember.js source and how link-to helper generates the href given the route name and the instance, but didn't manage to find the answer.
has comment: http://stackoverflow.com/comment/44256438
type: Question
answer count: 2
tagged with: javascript
has title: Ember.js: Get url string to a model instance using its route
score: 0
has comment: http://stackoverflow.com/comment/44257172

http://stackoverflow.com/comment/44052030
score: 1
comment on: http://stackoverflow.com/q/27823089
type: Comment
type: QuestionComment
has text: There's a jQuery mobile library, I think? Would be worth a look.

http://stackoverflow.com/comment/44239264
has text: You can use jQuery or other library to do the same, there is no reason to use SignalR if you just want that feature. SignalR is a pub/sub framework for pushing messages from server directly to the clients
score: 2
comment on: http://stackoverflow.com/a/27919570
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44086719
has text: I try disable input of this field
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27841097

http://stackoverflow.com/comment/44230048
comment on: http://stackoverflow.com/a/27915585
type: AnswerComment
has text: You mean if selected value is 1 then you want to check the radio button ? am i right ?
score: 0
type: Comment

http://stackoverflow.com/a/27880217
has comment: http://stackoverflow.com/comment/44167241
accepted answer of: http://stackoverflow.com/q/27880165
answers question: http://stackoverflow.com/q/27880165
type: Answer
downvote count: 0
score: 4
has body: I strongly suggest you use jQuery which is kind of simulating DOM manipulation like an array or more precisely an object. My suggestion would be the following: $(".nav-sidebar").on('click', 'li', function(e) { $(this).parent().find('li.active').removeClass('active'); $(this).addClass('active'); }); This code is removing the active class from all li items, and adding active class to currently clicked li item. Cheers, Edit PS: You could also bind your event directly like this: $(".nav-sidebar li").click(...); But the purpose of using .on() is that it will bind the event dynamically, so that if you decide to add a new li to your $(".nav-sidebar") element, it will also trigger the event on that element. Edit: To answer @zeddex your question: How to select manually li 4? You simply use the following: $("li:eq(3)").trigger('click'); That'll manually trigger a click event for li 4. If you want to select a specific li you can use a method of the like: :eq(x) in which x is the position of the li item you want to reach starting from 0 which corresponds to your first li. Have a look at jQuery DOC on that: jQuery DOC on :eq()
upvote count: 4
has comment: http://stackoverflow.com/comment/44176936
type: AcceptedAnswer

http://stackoverflow.com/a/27938751
answers question: http://stackoverflow.com/q/27938265
has comment: http://stackoverflow.com/comment/44274336
score: 0
has body: Because all of your checkboxes have the same function attach to it, so you dont need to loop all the element using each. An easier way to do that $('document').on('click', "input[name='chk[]']:checked", function(){ //make sure you reset all tr before applying new class $(this).closest('tr').addClass('custom-class'); });
has comment: http://stackoverflow.com/comment/44277192
type: Answer

http://stackoverflow.com/q/27901038
favorite count: 0
has title: Edit Regular Expression from Java to JavaScript
tagged with: regex
type: AnsweredQuestion
upvote count: 0
tagged with: java
type: Question
has comment: http://stackoverflow.com/comment/44202704
tagged with: javascript
score: -1
has body: Hi i have a problem with RegEx i have my expression in Java for split input to arrays, but this expression don't work in JavaScript: (?<=</d[12]>)\\d*(?=<d[12]>) I have some dialogue bla bla bla bla bla bla bla bla bla And i want to output split into array [ bla bla bla , bla bla bla , bla bla bla ] Can you help me how i edit this expression? Thanks.
has answer: http://stackoverflow.com/a/27901867
accepted answer: http://stackoverflow.com/a/27901867
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/44052224
score: 0
type: QuestionComment
has text: possible duplicate of [how to find out if XMLHttpRequest.send() worked](http://stackoverflow.com/questions/10876123/how-to-find-out-if-xmlhttprequest-send-worked)
comment on: http://stackoverflow.com/q/27823187
type: Comment

http://stackoverflow.com/a/27907540
type: Answer
accepted answer of: http://stackoverflow.com/q/27906630
has body: As others have mentioned without the rest of your HTML and CSS you use to actually set up the scrolling, this is rather difficult to answer. Judging by your use of type="submit" this chat triggers on a form submit, I added a directive to the form that can target an element to bring to the bottom scroll position on a 'chat'. You could in theory hook this into anything if you change the event handler although remember to remove it upon destroy. http://jsfiddle.net/U3pVM/11961/ .directive("fixBottom", function () { return { link: function (scope, element, attrs) { var scrollBot = function(){ var target = document.getElementById(attrs.fixBottom); target.scrollTop = target.scrollHeight; }; element[0].addEventListener("submit", scrollBot); scope.$on('$destroy', function () { element[0].removeEventListener("submit", scrollBot); }); } } })
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44272496
answers question: http://stackoverflow.com/q/27906630
has comment: http://stackoverflow.com/comment/44286428
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44224925
has text: @RonGilchrist actually has the same behavior, what I want to correct is that when you reach the bottom, if you scroll down once again nothing must happen. Try it yourself my friend: scroll at the bottom and then go ahead and do it again, you will that the window will be increasing his size, that's what I want to avoid.
score: 0
comment on: http://stackoverflow.com/q/27912440
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44266887
type: Comment
has text: Should return pretty quick.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27934491

http://stackoverflow.com/a/27934888
answers question: http://stackoverflow.com/q/27934616
score: 1
upvote count: 1
downvote count: 0
type: Answer
has body: If I'm understanding you, you want to merge sentences into groups smaller or equal to 300 characters? Assuming a single sentence never exceeded 300 characters (which may not be a good assumption), I think you could do something like this: // I didn't know if you have a string of sentences or an array of sentences. // string of sentences =&gt; array of sentences function sentences(string) { return string.split(". "); } // array of sentences =&gt; array of paragraphs less than or equal to 300 characters function paragraphs(sentences) { var paragraph = ""; var paragraphs = []; sentences.forEach(function (sentence) { if (paragraph.length + sentence.length &lt;= 300) { paragraph += sentence; } else { paragraphs.push(paragraph); paragraph = sentence; } }); if (paragraphs[paragraphs.length - 1] !== paragraph) paragraphs.push(paragraph); return paragraphs; } Disclaimer: I didn't test this code.

http://stackoverflow.com/a/27915610
type: Answer
answers question: http://stackoverflow.com/q/27915562
has body: $("button [data-button='inventoryb'][data-name='overview']").click();
score: 0

http://stackoverflow.com/q/27837271
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I have one constructor function in my code. I have create instance of that constructor. In newly created instance I want to add value or function by using prototype method. But I getting error while doing this. Here is my code fiddle function a(){ this.d=9 } a.prototype.one=1; a.prototype.two=2; var j= new a(); j.prototype.three=3; console.log(j)
duplicate of: http://stackoverflow.com/q/572897
has answer: http://stackoverflow.com/a/27837313
type: Question
has title: Add value using prototype in function instance
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44079372
linked to: http://stackoverflow.com/q/572897
upvote count: 9
possible better answer: http://stackoverflow.com/a/27837432
has answer: http://stackoverflow.com/a/27837432
score: 9
accepted answer: http://stackoverflow.com/a/27837313
has comment: http://stackoverflow.com/comment/44079134
answer count: 2
has comment: http://stackoverflow.com/comment/44079427
has comment: http://stackoverflow.com/comment/44079048

http://stackoverflow.com/comment/44176941
has text: @Nathan Yeah there is the ajax call
comment on: http://stackoverflow.com/q/27887862
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44257078
type: QuestionComment
has text: @KevinB - I have changed that one too but still not joy. I have reposted it as it is not with the 2 notes indicating what is now different from the original
comment on: http://stackoverflow.com/q/27914450
score: 0
type: Comment

http://stackoverflow.com/a/27963275
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44320431
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27963115
type: Answer
answers question: http://stackoverflow.com/q/27963115
has body: In AngularJS you should use $sce.trustAsResourceUrl(url); to use secure URLs like HTTPS. Example Code: $scope.trustSrc = function (path) { if (path) { if (path.indexOf('https') === -1) { path = path.replace('http', 'https'); } } return $sce.trustAsResourceUrl(path); }; This should return a secured path that could be used in your GET request like this: $scope.trustedPath = $scope.trustSrc(path); $http({method: 'GET' , url: trustedPath});

http://stackoverflow.com/a/27943854
answers question: http://stackoverflow.com/q/27942712
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44312729
has body: You can pass from property a random variable and define a function that generates your string: var random_string = function () { // your random string code goes here }; var message = { from: random_string, to: '&lt;someone@somewhere.com&gt;', // ... }

http://stackoverflow.com/comment/44033792
score: 0
type: Comment
type: QuestionComment
has text: @Aditya I tried ` ` all files are in the same folder
comment on: http://stackoverflow.com/q/27813294

http://stackoverflow.com/comment/44204274
type: Comment
has text: can you make a fiddle at http://jsfiddle.net/?
type: QuestionComment
comment on: http://stackoverflow.com/q/27902485
score: 0

http://stackoverflow.com/q/27831431
tagged with: javascript
tagged with: jquery-isotope
accepted answer: http://stackoverflow.com/a/27831466
tagged with: filter
has title: can't change isotope filtering from end with on start with
has body: on the main page of isotope exist demo with filtering by name ends with, but i need filtering by name starts with , it's will be pretty usefull for filter by alphabet. Please help me, i'm noob in javascript. this demo: $container.isotope({ filter: function() { var name = $(this).find('.name').text(); return name.match( /ium$/ ); } })
score: 0
has answer: http://stackoverflow.com/a/27831466
type: AnsweredQuestion
tagged with: filtering
type: Question
answer count: 1

http://stackoverflow.com/comment/44020052
score: 0
has text: Can't understand where the problem is.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27805522

http://stackoverflow.com/a/27818524
score: 1
has body: Well, to start there's no Enum in Javascript, but you can implement it by your own, and looking at the work you have done, I think that's correct and it's a good try. But if we focus on the logic of Enum, we should know that an Enum must be constant and its elements values should never change so we have to look for a more suitable solution because in Javascript we can overwrite any object. After a search I've made, I found a Javascript method that can provide the solution, wich is the Object.freeze(). So after defining your Enum you should freeze it, so it'll never change: var pieces = { NONE : {name: "None", code: " "}, WHITE_KING : {name: "White King", code: "♔"}, WHITE_QUEEN : {name: "White Queen", code: "♕"}, WHITE_ROOK : {name: "White Rook", code: "♖"}, WHITE_BISHOP : {name: "White Bishop", code: "♗"}, WHITE_KNIGHT : {name: "White Knight", code: "♘"}, WHITE_POWN : {name: "White Pown", code: "♙"}, BLACK_KING : {name: "Black King", code: "♚"}, BLACK_QUEEN : {name: "Black Queen", code: "♛"}, BLACK_ROOK : {name: "Black Rook", code: "♜"}, BLACK_BISHOP : {name: "Black Bishop", code: "♝"}, BLACK_KNIGHT : {name: "Black Knight", code: "♞"}, BLACK_POWN : {name: "Black Pown", code: "♟"}, }; var frozenpieces=Object.freeze(pieces); In that case the frozenpieces Object will remain always the same, so we can assume that it's an Enum.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44045387
type: Answer
answers question: http://stackoverflow.com/q/27818093
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27818093

http://stackoverflow.com/q/27928296
has answer: http://stackoverflow.com/a/27955023
has body: I know I can pass props while rendering a component. I'm also aware of the getInitialState method. But the problem is, getInitialState isn't quite helping because my component doesn't know it's initial state. I do. So I want to pass it while I'm rendering it. Something like this (pseudo-code): React.render(&lt;Component initialState={...} /&gt;); I know I could use a prop to work as the initial state but this smells like an anti-pattern. What should I do? EDIT FOR CLARITY Imagine I have a CommentList component. By the time I first render it, the initial state corresponds to the snapshot of current comments from my database. As the user includes comments, this list will change, and that's why it should be a state and not props. Now, in order to render the initial snapshot of comments I should pass it to the CommentsList component, because it has no way to know it. My confusion is that the only way I see to pass this information is through a props which seems to be an anti-pattern.
score: 19
answer count: 4
type: AnsweredQuestion
upvote count: 19
has answer: http://stackoverflow.com/a/27928440
accepted answer: http://stackoverflow.com/a/27928388
type: Question
has comment: http://stackoverflow.com/comment/44257048
tagged with: reactjs
has comment: http://stackoverflow.com/comment/44304956
has answer: http://stackoverflow.com/a/33217851
tagged with: javascript
possible better answer: http://stackoverflow.com/a/33217851
has answer: http://stackoverflow.com/a/27928388
downvote count: 0
has title: ReactJs: How to pass the initial state while rendering a component?
favorite count: 0

http://stackoverflow.com/comment/44017953
type: Comment
has text: "I am getting a syntax error" — What is the error message? What line does it refer to?
comment on: http://stackoverflow.com/q/27804456
score: 5
type: QuestionComment

ember.js
tags question: http://stackoverflow.com/q/27929011
tags question: http://stackoverflow.com/q/27924648
tags question: http://stackoverflow.com/q/27909379
tags question: http://stackoverflow.com/q/27903730
tags question: http://stackoverflow.com/q/27948111
tags question: http://stackoverflow.com/q/27951118
tags question: http://stackoverflow.com/q/27879140
tags question: http://stackoverflow.com/q/27892431
tags question: http://stackoverflow.com/q/27908232
tags question: http://stackoverflow.com/q/27928718
tags question: http://stackoverflow.com/q/27893521
tags question: http://stackoverflow.com/q/27930600
type: Tag
tags question: http://stackoverflow.com/q/27831481
tag name: ember.js
tags question: http://stackoverflow.com/q/27853021
tags question: http://stackoverflow.com/q/27940987
tags question: http://stackoverflow.com/q/27871265
tags question: http://stackoverflow.com/q/27951061
tags question: http://stackoverflow.com/q/27890872
tags question: http://stackoverflow.com/q/27832142
tags question: http://stackoverflow.com/q/27952217
tags question: http://stackoverflow.com/q/27908986
tags question: http://stackoverflow.com/q/27903243
tags question: http://stackoverflow.com/q/27933709
tags question: http://stackoverflow.com/q/27814385
tags question: http://stackoverflow.com/q/27818159
tags question: http://stackoverflow.com/q/27947274
tags question: http://stackoverflow.com/q/27883239
tags question: http://stackoverflow.com/q/27869083
tags question: http://stackoverflow.com/q/27883392
tags question: http://stackoverflow.com/q/27912435
tags question: http://stackoverflow.com/q/27867912
tags question: http://stackoverflow.com/q/27827451
tags question: http://stackoverflow.com/q/27879237
tags question: http://stackoverflow.com/q/27952889

http://stackoverflow.com/a/28081399
has comment: http://stackoverflow.com/comment/44609944
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27945679
has body: Ricardo, Yea there is an other option. You can use Impress.JS with angularJS. HTML Markup: {{i}} Previous Next Or Left / Right Arrows Start Over Here's the fiddle http://jsfiddle.net/eprouver/LAhGH/
accepted answer of: http://stackoverflow.com/q/27945679
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/27851804
has body: Because you are disabling the form before it submits, nothing will happen. You would have to set a timeout to allow the submission to happen. $('form').submit(function() { var after = $.proxy(function () { $(this).find("input[type='submit']").prop('disabled',true); },this); window.setTimeout(after,50); }); or $('form').submit(function() { var elems = $(this).find("input[type='submit']"); var after = function () { elems.prop('disabled',true); }; window.setTimeout(after,50); });
downvote count: 0
has comment: http://stackoverflow.com/comment/44107750
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/27851765
has comment: http://stackoverflow.com/comment/44107836
has comment: http://stackoverflow.com/comment/44109689
score: 2
has comment: http://stackoverflow.com/comment/44107791

http://stackoverflow.com/comment/44201306
type: Comment
has text: Yes It's correct way. You can do this to get value of either `input` or `div` text
comment on: http://stackoverflow.com/a/27900832
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44017399
type: Comment
type: QuestionComment
score: 0
has text: Now check @Terry, someone edited thatone, what i acual posted. Now its running. But I want to reset only the last newly inserted block's fields to be clear on the click of reset , not all or not of the previous ones.
comment on: http://stackoverflow.com/q/27803817

http://stackoverflow.com/comment/64006558
has text: what's with the `Index -{this.props.route.foo}` syntax? or is that pseudocode?
comment on: http://stackoverflow.com/a/32761932
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27920307
has comment: http://stackoverflow.com/comment/44238149
type: UnansweredQuestion
tagged with: css
answer count: 0
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/44238108
tagged with: javascript
has title: Lightbox in Wordpress only for selected images
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: lightbox
has body: I want to install a lightbox in my wordpress theme but select the images. If I install one of the common plugins, all of the images will be used with a lightbox, I want to set the images manually in the code.. What can you recommend? Thanks

http://stackoverflow.com/a/27848249
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44126724
has comment: http://stackoverflow.com/comment/44139819
type: Answer
accepted answer of: http://stackoverflow.com/q/27833594
downvote count: 0
has comment: http://stackoverflow.com/comment/44137934
score: 1
answers question: http://stackoverflow.com/q/27833594
has comment: http://stackoverflow.com/comment/44126362
has comment: http://stackoverflow.com/comment/44110684
has body: Instead of 2 LI elements, save the hotel id as a data-attribute of the visible LI: $.each(response, function(index,value){ output+='&lt;li data-hotelid="'+value.Hotel.Id+'"&gt;&lt;a href="#" style="text-decoration:none;"&gt; &lt;img alt="chef" src="./images/chef.min.png" width="20px" height="20px" &gt;'+value.Hotel.Name+' has'+value.Hotel.Romms+'&lt;/a&gt;&lt;/li&gt;'; }); Instead of $(document).ready(function(){ in jQuery Mobile you should use one of the page events e.g. pagecreate. On page creation create a click handler for all LIs using event delegation so that dynamically created ones are included. Use the jQM method jqmData() to retrieve the id data-attribute from the LI: $(document).on("pagecreate", "#yourpageid", function(){ $("#listHotelsOption").on("click", "li", function(){ //get hotel id var id = $(this).jqmData("hotelid"); ... rest of click handler }); $("#btnReg").on("click", function(){ //your code to dynamically create list }); }); Here is a working DEMO

http://stackoverflow.com/a/27878542
upvote count: 1
score: 1
has body: if your animation is performed with CSS (eg, css transitions) then you can monitor the transition end event with this: $('.close-button').hide(); $("#loading-animation").bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(event){ //this will run when the css transitions on your #loading-animation end $('.close-button').show(); }).show(); or you can perform the animation using jQuery animate: $('.close-button').hide(); $("#loading-animation").animate({ //do your transitions here //"left":"+=200" }).promise().done(function(){ //this will run when animate is done $('.close-button').show(); });
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27878436

http://stackoverflow.com/comment/73185295
type: Comment
comment on: http://stackoverflow.com/a/42358879
type: AnswerComment
score: 14
has text: The asker never indicated that they are using jquery and appears to be asking for a native javascript solution.

http://stackoverflow.com/a/27864645
score: 0
has comment: http://stackoverflow.com/comment/44132377
type: Answer
has comment: http://stackoverflow.com/comment/44132327
answers question: http://stackoverflow.com/q/27864513
has body: You can store the data in $rootscope if the application is not refreshing while sending data from one view to another. Example: angular.module('myApp').controller('myCtrl', function($scope, $rootScope) { $rootScope.test = "TEST"; }); angular.module('myApp').controller('myCtrl2', function($scope, $rootScope) { $scope.value = $rootScope.test; alert($scope.value); });

http://stackoverflow.com/q/27885702
has answer: http://stackoverflow.com/a/36093435
has comment: http://stackoverflow.com/comment/44194012
answer count: 3
has comment: http://stackoverflow.com/comment/44191876
upvote count: 1
tagged with: c#
has comment: http://stackoverflow.com/comment/44192520
has comment: http://stackoverflow.com/comment/44190140
tagged with: asp.net-mvc
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/36096146
score: 1
tagged with: jquery
favorite count: 0
has body: Since two weeks, I'm trying to Create a ASP.NET MVC 4 Application which is contain 3 drop down lists. Those are Country, State and City . I'm Following this article These database list details I call from databas Connection string : <add name="CACD_Con" connectionString="metadata=res://*/Models.Project_Name.csdl|res://*/Models.Project_Name.ssdl|res://*/Models.Project_Name.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.0.000;initial catalog=CACD;persist security info=True;user id=000;password=000000000;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> controller class: public class CacadingController : Controller { private ProjectContext db = new ProjectContext(); public ActionResult Index() { ViewBag.CountryId = new SelectList(db.Countrys, "CountryId", "CountryName"); return View(); } public JsonResult StateList(int Id) { var state = from s in db.States where s.CountryId == Id select s; return Json(new SelectList(state.ToArray(), "StateId", "StateName"), JsonRequestBehavior.AllowGet); } public JsonResult Citylist(int id) { var city = from c in db.Citys where c.StateId == id select c; return Json(new SelectList(city.ToArray(), "CityId", "CityName"), JsonRequestBehavior.AllowGet); } public IList<State> Getstate(int CountryId) { return db.States.Where(m => m.CountryId == CountryId).ToList(); } [AcceptVerbs(HttpVerbs.Get)] public JsonResult LoadClassesByCountryId(string CountryName) { var stateList = this.Getstate(Convert.ToInt32(CountryName)); var stateData = stateList.Select(m => new SelectListItem() { Text = m.StateName, Value = m.CountryId.ToString(), }); return Json(stateData, JsonRequestBehavior.AllowGet); } } Model Class : public partial class ProjectContext : DbContext { public ProjectContext() : base("CACD") { } public DbSet<Country> Countrys { get; set; } public DbSet<State> States { get; set; } public DbSet<City> Citys { get; set; } } public class Country { [Key] public int Count…
has answer: http://stackoverflow.com/a/27890641
type: Question
has title: Cascading Dropdown List in Asp.net MVC4 using Json and Jquery not Populate

http://stackoverflow.com/a/68789434
has comment: http://stackoverflow.com/comment/123077773
score: 0
type: Answer
has body: If you want to merge multiple plain objects (do not modify input objects). Based on Object.assign polyfill function isPlainObject(a) { return (!!a) &amp;&amp; (a.constructor === Object); } function merge(target) { let to = Object.assign({}, target); for (let index = 1; index &lt; arguments.length; index++) { let nextSource = arguments[index]; if (nextSource !== null &amp;&amp; nextSource !== undefined) { for (let nextKey in nextSource) { // Avoid bugs when hasOwnProperty is shadowed if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { if (isPlainObject(to[nextKey]) &amp;&amp; isPlainObject(nextSource[nextKey])) { to[nextKey] = merge(to[nextKey], nextSource[nextKey]); } else { to[nextKey] = nextSource[nextKey]; } } } } } return to; } // Usage var obj1 = { a: 1, b: { x: 2, y: { t: 3, u: 4 } }, c: "hi" }; var obj2 = { b: { x: 200, y: { u: 4000, v: 5000 } } }; var obj3 = { c: "hello" }; console.log("result", merge(obj1, obj2, obj3)); console.log("obj1", obj1); console.log("obj2", obj2); console.log("obj3", obj3); If you want to merge with limited depth function isPlainObject(a) { return (!!a) &amp;&amp; (a.constructor === Object); } function merge(target) { let to = Object.assign({}, target); const hasDepth = arguments.length &gt; 2 &amp;&amp; typeof arguments[arguments.length - 1] === 'number'; const depth = hasDepth ? arguments[arguments.length - 1] : Infinity; const lastObjectIndex = hasDepth ? arguments.length - 2 : arguments.length - 1; for (let index = 1; index &lt;= lastObjectIndex; index++) { let nextSource = arguments[index]; if (nextSource !== null &amp;&amp; nextSource !== undefined) { for (let nextKey in nextSource) { // Avoid bugs when hasOwnProperty is shadowed if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { if (depth &gt; 0 &amp;&amp; isPlainObject(to[nextKey]) &amp;&amp; isPlainObject(nextSource[nextKey])) { to[nextKey] = merge(to[nextKey], nextSource[nextKey], depth - 1); } else { to[nextKey] = nextSource[nextKey]; } } } } }…
has comment: http://stackoverflow.com/comment/123191346
answers question: http://stackoverflow.com/q/27936772

http://stackoverflow.com/comment/44149511
comment on: http://stackoverflow.com/a/27873703
type: Comment
score: 0
type: AnswerComment
has text: Thank you, I didn't catch that. Nice answer.

http://stackoverflow.com/q/27864314
upvote count: 1
tagged with: safari
tagged with: forms
has answer: http://stackoverflow.com/a/27964258
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44135031
has body: I have loader, which works correctly in all browsers except safari here is my code: so, in all browsers everything works ok, but in safari page reloads without showing loader. I've searched a lot of information and have tried such workaround: but it is unsuitable, because, f.e. in IE loader rotates only for 200ms (it's like a half of circle), so setting timeout for some seconds makes loader rotate for some time, but it's unsuitable(what if user would want to upload 500mb file and loader would rotate just for 2 seconds and then wait until page reloads). So I need a working solution to work in all browsers.
tagged with: submit
score: 1
tagged with: file-upload
has answer: http://stackoverflow.com/a/28005696
has comment: http://stackoverflow.com/comment/44133472
has comment: http://stackoverflow.com/comment/44294928
type: UnansweredQuestion
has title: how to prevent page reload until file uploads in safari
has comment: http://stackoverflow.com/comment/44133615

http://stackoverflow.com/a/27899156
has body: A few words of advice: Do not use inline onclick attribute handlers with jQuery. That adds unneeded complexity and separation of the event code from the event registration code. Use double-quote on HTML attribute values. Most browser accept either, but double-quoting is safer for compatibility. Also use data- attributes to provide meta-data (rather than bury it in the href). Make the href a plain bookmark link (#). Use a common class on any photo links to allow simpler jQuery matching (and styling): $(function(){...}); is a handy shortcut for $(document).ready(function(){...}); e.g sb.AppendFormat(""); and add a jQuery click handler that looks for clicks on any .photo links: $(function () { // Here I want to get the value of IDphoto ... $('a.photo').click(function(e){ // Stop the link click from moving to the page top e.preventDefault(); var id = $(this).attr("data-photo"); alert(id); }); }); Here is a mockup of the above using some sample links: JSFiddle: http://jsfiddle.net/TrueBlueAussie/wqkxwz2j/
answers question: http://stackoverflow.com/q/27899079
downvote count: 0
has comment: http://stackoverflow.com/comment/44201413
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44201299

http://stackoverflow.com/q/27947688
tagged with: jquery
favorite count: 0
tagged with: jeditable
type: UnansweredQuestion
has body: I am using jquery-datatables-editable to edit a table. Everything is working fine for text inputs and datepickers but when I attempt to populate a select it is always empty. The code I am using is: $("#eventsTable").dataTable( { "bPaginate": false, "bInfo": false, "bLengthChange": false, "bFilter": false, "aoColumnDefs": [ { "bSortable": false, "aTargets": [5] } ], "sPaginationType": "full_numbers", "oLanguage": { "sEmptyTable": "&lt;%=LanguageFieldsList.translate("There are no events")%&gt;" } }) .makeEditable( { sUpdateURL: "ForecastManager?cmd=updateForecastEvent", aoColumns: [ { indicator: "&lt;img src='/Shared/img/loading.gif' alt='Saving...'/&gt;", event: "click", type: "text", onblur: "submit" }, { indicator: "&lt;img src='/Shared/img/loading.gif' alt='Saving...'/&gt;", event: "click", type: "datepicker", datepicker: { dateFormat: datePickerDateFormat, monthNamesShort: datePickerNames.monthNamesShort, dayNamesMin: datePickerNames.dayNamesMin, changeMonth: true, changeYear: true }, onblur: "submit" }, { indicator: "&lt;img src='/Shared/img/loading.gif' alt='Saving...'/&gt;", event: "click", type: "datepicker", datepicker: { dateFormat: datePickerDateFormat, monthNamesShort: datePickerNames.monthNamesShort, dayNamesMin: datePickerNames.dayNamesMin, changeMonth: true, changeYear: true }, onblur: "submit" }, { indicator: "&lt;img src='/Shared/img/loading.gif' alt='Saving...'/&gt;", event: "click", type: "text", onblur: "submit" }, { indicator: "&lt;img src='/Shared/img/loading.gif' alt='Saving...'/&gt;", event: "click", type: "select", onblur: "submit", loadurl: "ForecastManager?cmd=loadForecastEventSelect" } ] }); As you can see when the last column is clicked I am attempting to populate the select by going to "ForecastManager?cmd=loadForecastEventSelect", this works and returns the JSON string: {"0": "No Event","1": "Event 1","2": "Event 2"} But the select is blank, however when i directly put this JSON string as a data option: { indicator: "&lt;img src='/Share…
answer count: 0
score: 1
has title: Datatables editable select not populating
upvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: datatables
downvote count: 0

http://stackoverflow.com/comment/44199490
has text: Also, please explain better what you're _trying_ to do, this looks like an [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27899740
score: 0

http://stackoverflow.com/comment/91540864
score: 1
has text: @Rocketq use this - ```from IPython.display import HTML HTML(''' $('div.input').show()''')```
comment on: http://stackoverflow.com/a/34192347
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45074995
comment on: http://stackoverflow.com/q/27884063
has text: Is there a reason why you have an input outside the `ng-repeat` loop?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27941789
score: 0
has comment: http://stackoverflow.com/comment/44286660
has comment: http://stackoverflow.com/comment/44308164
type: Answer
has comment: http://stackoverflow.com/comment/44286368
has body: You'll need to wrap your template div (#flightIndex1) in a container with a unique id attribute. Then, you take the contents of that container (a template for a single record), and append it to your results div (#searchFlightResultDiv) using some type of loop based on the number of results received. Basically, HTML: Result Javascript: //Get the number of results. //This can be sent from your API or however you're getting the data. //For example, in PHP you would set this to $query->num_rows(); var count = 5; //Start a for loop to clone the template element (div#singleResult) into div#results 'count' times. //This will repeat until the number of records (count) has been reached. for (i = 1; i <= count; i++) { //Append the HTML from div#thingToRepeat into the #results. $('#results').append($('#singleResult').clone()); } Here's a JSFiddle to show you how it works. You can play with it and tweak it if necessary. I can't in good conscious complete this post without telling you the downsides of this. Doing it this way is majorly frowned upon in the web development community and is super inefficient. It may be good for practice and learning, but please do take a look at and consider a javascript templating framework like moustache or handlebars. It does this same thing but way more efficiently. Hope this was helpful!
answers question: http://stackoverflow.com/q/27936988

http://stackoverflow.com/q/27835345
has answer: http://stackoverflow.com/a/27835489
has answer: http://stackoverflow.com/a/27835479
accepted answer: http://stackoverflow.com/a/27835479
has answer: http://stackoverflow.com/a/27835954
has comment: http://stackoverflow.com/comment/44075553
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/43885408
type: Question
possible better answer: http://stackoverflow.com/a/27835489
score: 5
tagged with: performance
upvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/44075636
tagged with: optimization
has comment: http://stackoverflow.com/comment/44076479
downvote count: 0
has title: Do unused paramenters in functions slow down the execution of JavaScript?
has body: Does having unused parameters in javascript functions slow down execution? Does it take up memory? I often write functions with parameters that are never actually used for example function has an event as a parameter, but the event is never used for anything.
has comment: http://stackoverflow.com/comment/44075486
favorite count: 0

http://stackoverflow.com/comment/44051852
type: AnswerComment
comment on: http://stackoverflow.com/a/27822158
type: Comment
has text: I believe, this is the most complete answer iv'e ever seen on this. Like my personal approach, in case of disliking prototype/"ungrouped code", i suggest using an option like the mentioned defclass function or start using TypeScript / CoffeeScript. Helped me to stay close to replicate the usual code paradigms in (my opinion) easy to-write-messy-javascript ..
score: 1

http://stackoverflow.com/q/27835368
answer count: 1
tagged with: google-plus
tagged with: javascript
has title: Google+ Hangout Button Window Location
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/27835429
type: Question
tagged with: google-hangouts
has body: So I was trying to embed the hangouts button within my website and realised that it opens a new window when the button is pressed through my website. So my question is. Is it possible to set the location and size of the window relative to my screen. For example when the hangout button is pressed (through my website) is it possible for the window to open on the bottom left cornor of my screen ? I read on several forums that is not possible to entirely embed hagouts into your website and needs to always open another window. Is this true ?﻿

http://stackoverflow.com/comment/44300818
comment on: http://stackoverflow.com/a/27952795
has text: Jordan. You'll need to assign the width of the headers as well so they don't shift. I've updated my answer with new fiddle (http://jsfiddle.net/mn76ujsu/3/) and javascript.
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/comment/44101564
has text: I tried this and got a similar result to the issues experienced with the answer provided by indubitabilee - they all show automatically. I DO understand what you're saying now, and realize the issue with my IF statement, and making sure it can return true/false under the appropriate circumstances, and the gist of your code, so I will fiddle with this.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27848631
type: AnswerComment

http://stackoverflow.com/comment/52358941
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27878587
has text: I've tried putting the dispatchEvent call into a setTimeout, and it prevents that error. But it didn't seem to properly dispatch the event for some reason. Its parent got the event, but the node I dispatched to didn't get it.
score: 0

http://stackoverflow.com/a/27949366
answers question: http://stackoverflow.com/q/27949301
has comment: http://stackoverflow.com/comment/44293988
has comment: http://stackoverflow.com/comment/44294304
has body: u may use html5 session storage , to store the number of visit , then u may disable autoplay if (sessionStorage.visitcount==3) { var aud = document.getElementById("audio"); aud.autoplay = false; } else { sessionStorage.visitcount += 1; }
downvote count: 1
has comment: http://stackoverflow.com/comment/44293928
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/44293961
has comment: http://stackoverflow.com/comment/44293990
type: Answer

http://stackoverflow.com/comment/44018541
score: 3
has text: Are you coding in Word?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27804637

http://stackoverflow.com/q/27953185
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: carousel
has body: I'm trying to figure out how to loop through each list element one at a time and apply a function to them when they run, I've tried several methods and some hints would help! HTML structure Test Test Test I've worked out an each function that if i understand correctly will handle the changing of classes, this is where I'm failing to loop through each element. $(document).ready(function() { $( ".slide" ).each(function( i ) { if ( this.className !== "active" ) { this.addClass("active"); } else { this.removeClass("active"); } }); });
possible better answer: http://stackoverflow.com/a/27953950
accepted answer: http://stackoverflow.com/a/27953964
has answer: http://stackoverflow.com/a/27953950
upvote count: 3
has answer: http://stackoverflow.com/a/27954244
has title: Carousel - How to loop through elements?
has comment: http://stackoverflow.com/comment/44302524
has comment: http://stackoverflow.com/comment/44301935
type: AnsweredQuestion
score: 3
type: Question
has answer: http://stackoverflow.com/a/27953964
has comment: http://stackoverflow.com/comment/44302323
has comment: http://stackoverflow.com/comment/44302492
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27963891
score: 37
accepted answer of: http://stackoverflow.com/q/27946228
has body: I had to convert the file into a Uint8Array before passing it to the Blob var arr = data.file; var byteArray = new Uint8Array(arr); var a = window.document.createElement('a'); a.href = window.URL.createObjectURL(new Blob([byteArray], { type: 'application/octet-stream' })); a.download = data.filename; // Append anchor to body. document.body.appendChild(a) a.click(); // Remove anchor from body document.body.removeChild(a) Reading this answer helped a lot https://stackoverflow.com/a/16245768/1016439
answers question: http://stackoverflow.com/q/27946228
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/73061680
upvote count: 37
has comment: http://stackoverflow.com/comment/110974578
type: Answer
downvote count: 0

http://stackoverflow.com/q/27883191
has answer: http://stackoverflow.com/a/27884924
type: UnansweredQuestion
score: 0
tagged with: autoload
type: Question
has comment: http://stackoverflow.com/comment/44168860
tagged with: javascript
has comment: http://stackoverflow.com/comment/44171225
answer count: 1
has comment: http://stackoverflow.com/comment/44168313
has comment: http://stackoverflow.com/comment/44168230
has body: This is basically my load function, This is the only "Load" word in my files, no vars or anything except for a button in html. I want to make my game autoload on start, When I put load(); in my setinterval time, it keeps loading infinitely, meaning no progress. I I was thinking a function which checks if my curren't items > load, then don't load, else load, but that would be too much coding :( and I suck at coding. function load(){ var savegame = JSON.parse(localStorage.getItem("save")); if (typeof savegame.Cash !== "undefined") Cash = savegame.Cash; if (typeof savegame.Item !== "undefined") Item = savegame.Item; if (typeof savegame.Item2 !== "undefined") Item2 = savegame.Item2; if (typeof savegame.Item3 !== "undefined") Item3 = savegame.Item3; document.getElementById('Cash').innerHTML = Cash; document.getElementById('Item').innerHTML = Item; document.getElementById('Item2').innerHTML = Item2; document.getElementById('Item3').innerHTML = Item3; }; Then this is my save functions. Incase it has anything to do with the load function. Other than that it has nothing to do with anything... var autosave = "on"; var autosaveCounter = 1; function save(){ var save = { cash: cash, Item: Item, Item2: Item2, Item3: Item3, } localStorage.setItem("save",JSON.stringify(save)); }; "My" "auto save" which doesn't work very well. function toggleAutosave(){ //Turns autosave on or off. Default on. if (autosave == "on"){ autosave = "off"; document.getElementById("toggleAutosave").innerHTML = "Enable Autosave" } else { autosave = "on"; document.getElementById("toggleAutosave").innerHTML = "Disable Autosave" } } this is what I put in my window.setInterval(function(){ if (autosave == "on") { autosaveCounter += 1; if (autosaveCounter &gt;= 10){ save('auto'); autosaveCounter = 1; } }; Thanks for your time :)
has title: Autoloading game function
has comment: http://stackoverflow.com/comment/44169696

http://stackoverflow.com/comment/44264049
type: QuestionComment
score: 0
type: Comment
has text: I have your answer, i'll type it up now.
comment on: http://stackoverflow.com/q/27932759

http://stackoverflow.com/q/27888999
has answer: http://stackoverflow.com/a/28614043
has body: Obviously, some people are not happy with websites using a Facebook plugin for they don't want to be tracked in what they do when they're not on Facebook. There's Shariff, which looks like a fair approach: The Facebook plugin isn't loaded until the user clicks the Facebook button (here's a demo). I'm trying to do the same (using the JavaScript SDK). However, I blatantly fail in loading the SDK dynamically. I didn't get any error messages either (yes, I did insert the app id). Any ideas? The code below was taken from the API docs. Link
has comment: http://stackoverflow.com/comment/45530733
type: Question
linked to: http://stackoverflow.com/q/3548493
tagged with: javascript
upvote count: 2
answer count: 1
favorite count: 0
has title: Loading Facebook SDK on click
type: UnansweredQuestion
tagged with: facebook
score: 2
downvote count: 0

http://stackoverflow.com/q/27854926
type: Question
has answer: http://stackoverflow.com/a/27854981
tagged with: javascript
tagged with: forms
has body: I'm in trouble when I use form submit event in jQuery. Markups Submit Event listener function valid() { return false; } $('form').submit(function() { if(!valid()) { return false; } }); Then, when I click that it do trigger that event, and can cancel the submit event. But when I trigger the form submit on the .btn_submit tag, return false cannot cancel the submit. Failure of cancel $('#btn_submit').click(function() { $('form').submit(); // $('form').trigger('submit'); // document.forms[0].submit(); }); So, now the question is, if I must use an a.btn_submit to trigger the submit of form, and I want to cancel that submit in case. How should I trigger? How should I cancel? Please help! I made a fiddle http://jsfiddle.net/69wcduv5/2/. But it seemed cannot submit in jsfiddle. My final solution (a bit dirty) I can create a submit input inside the form, then trigger a click on it. Then remove it. If I trigger the submit in this way, I acts exactly the same as I expected: The validation code inside the $('form').submit(function() {}); don't have to change. If the form has something like , it can do well. I can style well on that anchor. Not the f**king Thank you all for your patient, best regards. And hoping for a clean better solution.
has answer: http://stackoverflow.com/a/27855140
has comment: http://stackoverflow.com/comment/44113462
score: 0
has comment: http://stackoverflow.com/comment/44113673
has comment: http://stackoverflow.com/comment/44113876
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44113803
possible better answer: http://stackoverflow.com/a/27854981
has comment: http://stackoverflow.com/comment/44113494
has title: Cancel a $('form').submit() call in jQuery
answer count: 5
has answer: http://stackoverflow.com/a/27855509
accepted answer: http://stackoverflow.com/a/27855509
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27855002
has answer: http://stackoverflow.com/a/27855102
type: AnsweredQuestion
upvote count: 2
downvote count: 2

http://stackoverflow.com/a/27932032
has comment: http://stackoverflow.com/comment/44262617
has comment: http://stackoverflow.com/comment/44270277
has comment: http://stackoverflow.com/comment/44287711
answers question: http://stackoverflow.com/q/27931142
has comment: http://stackoverflow.com/comment/44283426
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44264400
has body: In the JW Player, the default behavior for a playlist is to play each item automatically. Would this possibly do what you want? 4 Videos
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44265028

http://stackoverflow.com/comment/44305924
type: Comment
score: 0
type: AnswerComment
has text: define "did not work", you should see a error-message when it didn't work.
comment on: http://stackoverflow.com/a/27877911

http://stackoverflow.com/q/27936134
score: 0
tagged with: homekit
answer count: 1
has comment: http://stackoverflow.com/comment/44269368
has title: Frustrating syntax error
linked to: http://stackoverflow.com/q/8294088
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27936279
has body: This project turns appliances and such On/off using Apple's homekit and a node.js server on raspberry pi (https://github.com/KhaosT/HAP-NodeJS). So Light_accessory.js, when vaule is true(1), turns a lamp(relay) on using a child process and wiring pi. It also needs to turn the lamp off (gpio write 7 1) when value is false(0). I have tried adding IF statements to it (near the end), but I keep getting syntax errors from the if statements.. Don't know why. //frustrated. // HomeKit types required var types = require("./types.js") var exports = module.exports = {}; var exec = require('child_process').exec; var execute = function(accessory, characteristic, value) { console.log("executed accessory: " + accessory + ", and characteristic: " + characteristic + ", with value: " + value + "."); } exports.accessory = { displayName: "Light", username: "1A:2B:4A:4D:5E:FF", pincode: "031-45-154", services: [{ sType: types.ACCESSORY_INFORMATION_STYPE, characteristics: [{ cType: types.NAME_CTYPE, onUpdate: null, perms: ["pr"], format: "string", initialValue: "Light 0", supportEvents: false, supportBonjour: false, manfDescription: "Bla", designedMaxLength: 255 }, { cType: types.MANUFACTURER_CTYPE, onUpdate: null, perms: ["pr"], format: "string", initialValue: "Oltica", supportEvents: false, supportBonjour: false, manfDescription: "Bla", designedMaxLength: 255 }, { cType: types.MODEL_CTYPE, onUpdate: null, perms: ["pr"], format: "string", initialValue: "Rev-1", supportEvents: false, supportBonjour: false, manfDescription: "Bla", designedMaxLength: 255 }, { cType: types.SERIAL_NUMBER_CTYPE, onUpdate: null, perms: ["pr"], format: "string", initialValue: "A1S2NASF88EW", supportEvents: false, supportBonjour: false, manfDescription: "Bla", designedMaxLength: 255 }, { cType: types.IDENTIFY_CTYPE, onUpdate: null, perms: ["pw"], format: "bool", initialValue: false, supportEvents: false, supportBonjour: false, manfDescription: "Identify Accessory", designedMaxLength: 1 }] }, { sType: types.LIGHT…
tagged with: syntax
has comment: http://stackoverflow.com/comment/44269384
type: Question
has comment: http://stackoverflow.com/comment/44269255
has comment: http://stackoverflow.com/comment/44269312
tagged with: if-statement
tagged with: javascript

http://stackoverflow.com/q/27821428
type: Question
has comment: http://stackoverflow.com/comment/44048678
answer count: 2
linked to: http://stackoverflow.com/q/1470488
tagged with: javascript
has comment: http://stackoverflow.com/comment/44048538
tagged with: jquery
has comment: http://stackoverflow.com/comment/44048541
score: 0
has comment: http://stackoverflow.com/comment/44048511
has answer: http://stackoverflow.com/a/27821488
accepted answer: http://stackoverflow.com/a/27821488
has answer: http://stackoverflow.com/a/27821474
has body: EDIT I want the function to be globally accessible Why does myfunction0 work in the dom ready call and myfunction1 does not work? external.js file (function($) { // functions defined like that works myfunction0 = function() { console.log("hello world"); } // functions defined like that do not work function myfunction1() { console.log("hello world"); } })(jQuery); index.html &lt;script&gt; $(function () { myfunction0(); // works myfunction1(); // does not work not defined }) &lt;/script&gt; Does the first function definition get a global scope whereas the second only a local 'in file' scope?
has comment: http://stackoverflow.com/comment/44048629
has title: jQuery function scope confusion
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44048543
duplicate of: http://stackoverflow.com/q/1470488
possible better answer: http://stackoverflow.com/a/27821474

http://stackoverflow.com/comment/44113150
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27835595
has text: Thank you for replay, but I am totally confused and unable to change the "SAVE" text button to "Yes Yes" of options object? Please help me!
score: 0

http://stackoverflow.com/q/27930424
has comment: http://stackoverflow.com/comment/44258173
answer count: 0
type: UnansweredQuestion
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/44258201
has comment: http://stackoverflow.com/comment/44258033
has comment: http://stackoverflow.com/comment/44258445
tagged with: forms
score: 0
has title: How to make Google Chrome autofocus input form over search bar?
tagged with: javascript
linked to: http://stackoverflow.com/q/16684663
tagged with: google-chrome-extension
has body: Whenever I open a new tab it always auto focuses the search bar instead of my beautiful custom made new tab searchbar... http://prntscr.com/5s38y3 Is there any way to fix this in either my code/script/markup or google settings?
has comment: http://stackoverflow.com/comment/44257981
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44261814
score: 0
has text: well i checking for <,> " to prevent Xss. because the content will be stored in a database.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27931920

http://stackoverflow.com/a/27852185
answers question: http://stackoverflow.com/q/27832823
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27832823
has body: I like Sockjs because it is simple. Here is an implementation for SocketRocket --> Sockjs that works as proof of concept NEED: -SocketRocket (add libicucore.dylib, Security.framework and CFNetwork.framework to your project) -Node.js -Sockjs Server SERVER: var http = require('http'), sockjs = require('sockjs'), sockserver = sockjs.createServer(), connections = []; sockserver.on('connection', function(conn) { console.log('Connected'); connections.push(conn); conn.on('data', function(message) { console.log('Message: ' + message); // send the message to all clients for (var i=0; i &lt; connections.length; ++i) { connections[i].write(message); } // }); conn.on('close', function() { connections.splice(connections.indexOf(conn), 1); // remove the connection console.log('Disconnected'); }); }); var server = http.createServer(); sockserver.installHandlers(server, {prefix:'/sockserver'}); server.listen(3000, '0.0.0.0'); // http://localhost:3000/sockserver/websocket CLIENT (ViewController.m): #import "ViewController.h" @interface ViewController () @end @implementation ViewController { SRWebSocket *myWebSocket; __weak IBOutlet UILabel *connectionStatus; __weak IBOutlet UITextView *myTextView; } - (void)viewDidLoad { [super viewDidLoad]; connectionStatus.textColor = [UIColor redColor]; myWebSocket = [[SRWebSocket alloc] initWithURL:[[NSURL alloc] initWithString:@"http://localhost:3000/sockserver/websocket"]]; myWebSocket.delegate = self; [myWebSocket open]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message{ myTextView.text = message; NSLog(@"message: %@",message); } - (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean{ connectionStatus.text = @"Disconnected"; connectionStatus.textColor = [UIColor redColor]; } - (void)webSocketDidOpen:(SRWebSocket *)webSocket{ conne…

http://stackoverflow.com/a/28592096
type: Answer
answers question: http://stackoverflow.com/q/27943026
score: 2
has body: Use b.require to make a file available from outside of the bundle. And in order to use the vinyl streams, that Gulp uses/emits, with Browserify; we make a small inline transform using through2.obj to emit only the contents. A note on using b.require is that you need to b.exclude so that module-deps doesn't try to resolve it in the node_modules directories, etc. See issues #908 and #1106 for more information. var gulp = require('gulp'); var through = require('through2'); var source = require('vinyl-source-stream'); var browserify = require('browserify'); gulp.task('browserify-bundle', function() { return browserify('./test/main.js') // We need to exclude the required module so `module-deps` doesn't try to resolve it in the `node_modules` directories, etc // Suggested here: https://github.com/substack/node-browserify/issues/908#issuecomment-74909062 // See also: https://github.com/substack/node-browserify/issues/1106 .exclude('some-func') // Then add in the module to the bundle .require( gulp.src('./test/hidden-some-func.js') // Any plugins here.... // .pipe(ngAutoBootstrap(..) // // Then convert it to a object stream with only the `contents` for browserify to consume .pipe(through.obj(function(chunk, env, cb) { if (chunk.isStream()) { self.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Cannot operate on stream')); } else if (chunk.isBuffer()) { this.push(chunk.contents); } // "call callback when the transform operation is complete." cb(); })), { // Dependency name to inject expose: 'some-func', // So that relative requires will be resolvable basedir: './test/' } ) .bundle() .pipe(source('bundle.js')) .pipe(gulp.dest('dest')); });
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45515296
accepted answer of: http://stackoverflow.com/q/27943026

http://stackoverflow.com/a/27919906
has body: You cant use php code directly in your external js file, the given code is, <?php $a = array("Apple","Orange","Grape"); ?> I think you can change the code as, //Declaring the array in php <?php $a = array("Apple","Orange","Grape"); ?> //Assigning the json encoded format to javascript //You can use the jArray in the external js file
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/27918653
downvote count: 0
score: 4

http://stackoverflow.com/q/27917588
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27917649
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44233455
has comment: http://stackoverflow.com/comment/44233589
has comment: http://stackoverflow.com/comment/44233384
has body: there is a div present in my js file &lt;div id="myid" data="mydata"&gt;&lt;/div&gt; when i try to access custom attribute data with pure javascript var data = document.getElementById('myid').getAttribute('data'); jquery alone var data = $("#"+myid).attr('data'); above both mwthods are working properly but when i try to used the both jquery and javascript var data = $("#"+myid).getAtrribute("data"); then is is giving error? but didn't able to get the reason ? can anyone explain please?
has answer: http://stackoverflow.com/a/27917648
upvote count: 1
downvote count: 1
type: Question
has title: Jquery custom attribute access
has comment: http://stackoverflow.com/comment/44233490
has answer: http://stackoverflow.com/a/27917626
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/27817438
type: Answer
has comment: http://stackoverflow.com/comment/44041782
answers question: http://stackoverflow.com/q/27817379
has comment: http://stackoverflow.com/comment/44041297
score: 0
has body: Use: scope: false In your child scope to preserve the scope from the parent element in child elements. Using true or {} is called isolateScope, and there's a reason why it's like that. To protect the child scopes.

http://stackoverflow.com/q/27948708
has body: I made a custom ckeditor but I had all the basic things plus a few more. I've been trying to use ckeditor and tried both by both replacing textarea element by class name and by javascript code, but in both situations, all I get in my textarea is My code for it is here: {{ Form::textarea('LONG_DESCRIPTION', $article-&gt;LONG_DESCRIPTION, ['class' =&gt; 'edito', 'id'=&gt;'editor1']) }} &lt;script src="/*****/vendor/ckeditor/ckeditor.js"&gt;&lt;/script&gt; &lt;script&gt; CKEDITOR.replace('editor1', { toolbar: 'MyToolbar' }); &lt;/script&gt; And this is the config file just in case: CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; config.toolbar = 'MyToolbar'; config.toolbar_MyToolbar = [ { name: 'document', items : [ 'NewPage','Preview' ] }, { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','Scayt' ] }, { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ,'Iframe' ] }, '/', { name: 'styles', items : [ 'Styles','Format' ] }, { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] }, { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] }, { name: 'links', items : [ 'Link','Unlink','Anchor' ] }, { name: 'tools', items : [ 'Maximize','-','About' ] } ]; }; What am I doing wrong or have wrong for it not to work and just appear as that in the image?
downvote count: 0
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
has title: The ckeditor toolbar missing
tagged with: javascript
tagged with: ckeditor

http://stackoverflow.com/comment/44200081
has text: The parameters probably do not match the action's. Can you share its signature?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27899984

http://stackoverflow.com/q/27905762
has comment: http://stackoverflow.com/comment/44211379
has title: JSON returned from http handler is null in IE8 but not IE10 or Chrome
tagged with: internet-explorer
tagged with: internet-explorer-8
has body: I have the following JavaScript patients.prototype.GetPatient = function(patient_id,callback) { var xmlhttp; var fullpath; try { if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var pat = parseJson(xmlhttp.response); if (pat) { callback(parseJson(xmlhttp.response)); } else { alert('Null object returned?'); } } else if (xmlhttp.status == 404) { alert('Unable to find Retrieve Patient Service'); } } xmlhttp.open("GET", "RetrievePatient.ashx?PatientId=" + patient_id, true); xmlhttp.send(); } catch (e) { alert('Unable to retrieve requested patient details'); } } function parseJson(jsonString) { var res; try { alert('Parsing JSON'); res = JSON.parse(jsonString); } catch (e) { alert('Call to evaluate result failed with error ' + e.message + ' Evaluating Json ' + jsonString ); }; return res; } If this is run from a page running on IE10 I get the patient details back correctly. If I run it on Chrome likewise it returns back the details of the patient, but if I run it on a page in IE8 the JSON is null and the whole thing falls down. Anyone know what I can do to make this work in IE8?
has comment: http://stackoverflow.com/comment/44216262
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44210890
has answer: http://stackoverflow.com/a/27907652
has comment: http://stackoverflow.com/comment/44211518
has comment: http://stackoverflow.com/comment/44212138
has comment: http://stackoverflow.com/comment/44211717
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44211466
has comment: http://stackoverflow.com/comment/44212378
accepted answer: http://stackoverflow.com/a/27907652
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/q/27806587
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: JQuery SVG not working
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44022270
has comment: http://stackoverflow.com/comment/44022307
type: Question
tagged with: javascript
has body: I am trying to create a circular page with tabs around it and the SVG path are not being appended to the html. Any help would be grateful. I have not worked with JS in a long time since I have moved on to Java so my skills are rusty. var tabs = 10; var radius = 500; var xcords = []; for (var i = 1; i &lt;= tabs; i++) { xcords[xcords.length] = radius + Math.cos(36 * i + 18) * radius; } var ycords = []; for (var i = 1; i &lt;= tabs; i++) { ycords[ycords.length] = radius + Math.sin(36 * i + 18) * radius; } $(document).ready(function(){ for (var i = 1; i &lt; tabs; i++) { $(".svg").prepend("&lt;path class='piece' /&gt;"); $(".piece").attr({ "d" : "M" + xcords[i] + "," + ycords[i] + "L500,500 L" + xcords[i + 1] + "," + ycords[i + 1] " A500,500 0 0,0 " + xcords[i] + "," + ycords[i] + " Z" }); } $(".piece").mouseenter(function() { $(this).fadeTo(100, 0.7); }); $(".piece").mouseleave(function() { $(this).fadeTo(100, 1); }); $(".piece").click(function() { $(".center").attr("fill",$(this).attr("fill")); }); }); I know that the array id not large enough to get xcords[11] but a solution to it would be helpful.
tagged with: jquery

http://stackoverflow.com/q/27917802
tagged with: javascript
score: 0
answer count: 1
has title: How to create an index over an property which is a list of objects in OrientDB?
type: UnansweredQuestion
tagged with: oriento
tagged with: orientdb
tagged with: node.js
has body: I'd like a class that stores a structure such as this: { name: "blabla", metaData: [ {a: "mya"}, { a:"mya2"} ] } ` Now, I would like to have an index over the metaData[?].a fields. What is the best way to represent this metaData in a schema? As an embeddedList? Is it possible to have that index i want? If so, who should the query for retrieving an entity by it's "a" value should look like? Alternatively, if we have, instead of that metaData, a field called "myAs" that is a simple array of string - would it be easier? Note that i'm using the Node.JS oriento library.
has answer: http://stackoverflow.com/a/28589535
type: Question

http://stackoverflow.com/a/27896914
has comment: http://stackoverflow.com/comment/44201833
has comment: http://stackoverflow.com/comment/44201493
has comment: http://stackoverflow.com/comment/44200894
has comment: http://stackoverflow.com/comment/44201323
type: Answer
has comment: http://stackoverflow.com/comment/44202204
has comment: http://stackoverflow.com/comment/44198242
has comment: http://stackoverflow.com/comment/44199010
has comment: http://stackoverflow.com/comment/44201114
answers question: http://stackoverflow.com/q/27896641
has comment: http://stackoverflow.com/comment/44198412
has comment: http://stackoverflow.com/comment/44309781
score: 0
has body: Try this this is a sample demo with your json and the js object should have to be in []: var data = [{"timestamp":"2015-01-12T17:22:40.4372664+11:00","code":0012345,"parsedname":" (NAME)","priority":"AB","message":"THIS IS A TEST MESSAGE"}]; $(function () { $("#list").jqGrid({ datastr: data, datatype: "jsonstring", mtype: "GET", colNames: ["timestamp", "code", "name", "message"], colModel: [ { name: "timestamp", width: 400 }, { name: "code", width: 200 }, { name: "name", width: 200, align: "right" }, { name: "message", width: 200, align: "right" } ], pager: "#pager", rowNum: 10, rowList: [10, 20, 30], sortname: "invid", sortorder: "desc", viewrecords: true, gridview: true, autoencode: true, caption: "My first grid" }); }); Another way is this, you can have a jquery ajax call to get the object you are getting and push that object in array and pass the array to the jqgrid like this: $.getJSON('example.php', function(data){ makeGrid(data); }); and your function makeGrid(): function makeGrid(data){ var json = [data]; // now this is local data $("#list").jqGrid({ datastr: data, // so you should use datastr instead of url with localdata datatype: "jsonstring", // and dataype should be jsonstring with local data .... }); }

http://stackoverflow.com/comment/44228323
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27914450
has text: @Shahar None at all. I have been tailing the log for hours. To be more accurate on the index.php - index.php includes donuts.php which has the same code in yes. That one loads perfectly fine. It is the master file and also contains jQuery tabs and 3 other donuts, again all working fine. It is only when you get to donut1.php where no jQuery works at all. Not even my Hellow World test. I have noticed that when I click the link taking my to donut5.php jQuery loads in Network but doesn't load when i click the link taking me to donut1.php. Odd!
score: 0

http://stackoverflow.com/comment/44036839
type: Comment
comment on: http://stackoverflow.com/a/27808497
has text: Thanks a lot, this is very close. The only problem seems to be when the user does not change an option, the class is not added unless the user clicks twice on the page to remove the focus. It's this part that has got me stumped. I've tried to add a `blur` in various instances but can't get anything to work.
type: AnswerComment
score: 0

http://stackoverflow.com/a/27901686
answers question: http://stackoverflow.com/q/27901552
has body: Use as mentioned below: HTML: &lt;span id="calculatedTime"&gt;&lt;/span&gt; JavaScript: window.onload = function(){ document.getElementById('calculatedTime').innerHTML = date2-date1; }
score: 0
type: Answer

http://stackoverflow.com/q/27839472
has body: i'm trying to customise a field of a form generated with sonata admin bundle, i adopted the solution posted here: Customize form field rendering what i want to do also is to execute an autocomplete script with ajax that load for me possible values for the field i've already created, so iwrote the script in the myfield_edit.html.twig mentionned in the solution. My problem: when loading the form page, my script's never been loaded! help pleaze!
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27841442
answer count: 2
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/36952624
tagged with: sonata-admin
tagged with: symfony
has title: issue loading js code when Customizing form field symfony/ sonata Admin
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36952624
has answer: http://stackoverflow.com/a/27841442
linked to: http://stackoverflow.com/q/14194148
score: 1
tagged with: forms
upvote count: 1
type: Question

http://stackoverflow.com/comment/44214693
type: Comment
has text: At least take a stab at mapping it. Create a temp object using the 3 types as keys loop over response data and push rows to temp object arrays then tweak temp object to fit flot format
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27907549

http://stackoverflow.com/q/27932834
tagged with: mongodb
has title: How create collections names dynamically (depending on the user info)
has answer: http://stackoverflow.com/a/27933023
tagged with: mongoose
tagged with: javascript
has body: I want create a more deep collection.. data more organize. I know how to access the data, how retrieve information, but I don't exactly know how to create the schema. this is my actual schema: var MySchema = new Schema ({ event: { full: String, date: String, name: String, }, person: { name: String, phone: String, email: String, obs: String } }); And I want change for: var BookingSchema = new Schema ({ monday: { event: { full: String, date: String, name: String, }, person: { name: String, phone: String, email: String, obs: String } }, friday: { event: { full: String, date: String, name: String, }, person: { name: String, phone: String, email: String, obs: String } }, saturday: { event: { full: String, date: String, name: String, }, person: { name: String, phone: String, email: String, obs: String } } sunday: { event: { full: String, date: String, name: String, }, person: { name: String, phone: String, email: String, obs: String } } }); This is not very dry, so I was wondering if I can change the names of the weeks dynamically. If I can, how to do? If this is possible, the real schema would be: dinamicallyDay: { event: { full: String, date: String, name: String, }, person: { name: String, phone: String, email: String, obs: String } } This is my first questions, now me second. If the first question is possible, how can I create entrances inside the dinamicallyDay? For example, someone wants to register to the monday, but this day already exists in my database, I want put this register inside, like this: monday: { 1: { event: { full: String, date: String, name: String, }, person: { name: String, phone: String, email: String, obs: String } } } This is possible? If so.. can you guys help me??
answer count: 1
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27933023
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44263485
type: Question

http://stackoverflow.com/q/27910012
has answer: http://stackoverflow.com/a/43534589
type: Question
has body: I'm having trouble getting typeahead.js to return only results that match the inputted query. For example, if I type in "Facebook" to my company search bar, it will return all companies ("Yahoo", "Google", etc.) even though most of these don't match the query. I am not doing any server side processing of data. Should my datumTokenizer function take care of this filtering? Also, I notice that every time I modify the query, it enters the filter() function for each datum. So when I change the query from "G" to "Go," the console.log() statement in filter: function (companies_list) will print 3000 times. Here is my code: var companies = new Bloodhound({ datumTokenizer: function (datum) { return Bloodhound.tokenizers.whitespace(datum.name); }, queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: '/json/company_list.json', filter: function (companies_list) { // Map the remote source JSON array to a JavaScript object array return $.map(companies_list, function (company) { console.log('mapping') return { name: company.name }; }); } } }); // Initialize the Bloodhound suggestion engine var promise = companies.initialize(); promise.done(function() {console.log('Bloodhound initialized!')}); // passing in `null` for the `options` arguments will result in the default // options being used $('#form-company').typeahead(null, { name: 'companies', displayKey: 'name', // `ttAdapter` wraps the suggestion engine in an adapter that // is compatible with the typeahead jQuery plugin source: companies.ttAdapter() }); And an example of what my url is returning: [{"name": "Yahoo"}, {"name": "Sanchai Technologies "}, {"name": "Oliver Wyman"}, {"name": "University of Oregon"}, ...] I am using remote because prefetch absolutely does not work for me. It only gives me the suggestion [object Object], which makes no sense. I would like to use prefetch/remote to load the entire .json file upon initialization, and not make any further requests to the server. So I think prefetch is the bette…
has answer: http://stackoverflow.com/a/41991703
has comment: http://stackoverflow.com/comment/56028338
tagged with: javascript
score: 4
upvote count: 4
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/74116344
has comment: http://stackoverflow.com/comment/44943226
favorite count: 0
type: UnansweredQuestion
tagged with: typeahead
linked to: http://stackoverflow.com/q/41991387
has title: typeahead.js showing all results instead of just matching results
tagged with: bloodhound

http://stackoverflow.com/comment/44289102
has text: I'm using chrome. Although Firefox gives even more completely different results (`key`,`getItem`,`setItem`, ... ) for the `for in` and proper results for the `for`.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27946707

http://stackoverflow.com/a/27806502
type: Answer
downvote count: 1
accepted answer of: http://stackoverflow.com/q/27806025
has body: After many hours trying to figure this out I applied something similar to what I found here jQM 1.4.2 Collapsible set not refreshing properly after dynamic content change function addOtherItem(id, addOther) { var btn = "btn" + id; var txt = "txt" + id; var pg = ' ' pg+=' ' pg+=' Delete ' pg+=' ' $(addOther).after(pg).trigger('create'); $("#ServicePage #fieldsetCollapse").enhanceWithin(); } It seems I needed to refresh the collapsible section of the JQM page.
answers question: http://stackoverflow.com/q/27806025
score: -1
upvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/a/27904986
type: AcceptedAnswer
has body: I've solved the problem. I've moved $.view_indicator.hide(); into if...else block. So the right code, for the loginReq.onload is loginReq.onload = function() { var json = this.responseText; var response = JSON.parse(json); if (response.logged == true) { var args = { name: response.name, email: response.email }; var loggedUser = Alloy.createController("loggedin", args).getView(); loggedUser.open(); $.view_indicator.hide(); } else { alert(response.message); $.view_indicator.hide(); } }
type: Answer
answers question: http://stackoverflow.com/q/27901767
accepted answer of: http://stackoverflow.com/q/27901767
score: 0

http://stackoverflow.com/a/27950747
answers question: http://stackoverflow.com/q/27950662
score: 0
type: Answer
has body: Try doing: var datasend=encodeURIComponent(getdata);

http://stackoverflow.com/q/27885049
has body: I'm trying to use the javascript bind function to pass a file that I've required into the scope, and have it use that object's functionality to execute some code. It's a recursive function, so to put it simply, I have an object: var tts = require('./tts') This object uses the Web API's Speech Synthesis functionality to turn the text that was passed in into speech. So, I have a recursive function, say something, that should say the next thing, after the first one is done. function saySomething(idx) { tts('first thing',saysomething.bind(this,'next thing')) } Unfortunately, however, this does not work. Can anyone tell me what I'm doing wrong? My code: tts code recursive function code P.S. I'm using browserify to compile the node-style code into browser-friendly code
has title: How do you pass a require('') object into the scope of the bind object?
answer count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27885122
type: Question
has comment: http://stackoverflow.com/comment/44171477
has answer: http://stackoverflow.com/a/27885122
tagged with: javascript
score: 0

http://stackoverflow.com/a/27850761
type: Answer
accepted answer of: http://stackoverflow.com/q/27850728
has comment: http://stackoverflow.com/comment/44107170
answers question: http://stackoverflow.com/q/27850728
has body: missing the direct child selector. Codepen detail You just need to add a tabindex attribute to the lis themselves. html Enabled Enabled Enabled Enabled Disabled Disabled edit DEMO 2 this is simple and does everything you want. $(function () { $("#sortable-1, #sortable-2").sortable({ items: "li:not(.ui-state-disabled)", cancel: ".ui-state-disabled", connectWith: ".connect" }); $("ul").on("dblclick", "li", function (event) { var $el = $(this); if ($el.text() == "Enabled") { $el.text("Disabled"); } else { $el.text("Enabled"); } $el.toggleClass("ui-state-disabled"); }) }) DEMO $("#sortable-1, #sortable-2").sortable({ items: "> li:not(.ui-state-disabled)", connectWith: ".connect" });
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44106063

http://stackoverflow.com/q/27873095
has answer: http://stackoverflow.com/a/27874034
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27873162
has comment: http://stackoverflow.com/comment/44148459
tagged with: http://stackoverflow.com/tag/json
has body: I am new to angularJS. Sorry, If I am not clear with the question. Here's the issue. I have a JSON file ranging 20KB in size. When I try to load this file using 'factory' method, I am getting null value. var app = angular.module('moonApp', []); app.factory('MainSource', ['$http', function($http){ var data={source:null}; $http.get('/datafile.json',function(output){ data.source=output; console.log(data.source); // it works }); return data; }]); app.controller('appCtrl',['$scope','MainSource',function($scope,MainSource){ console.log(MainSource.source); // Not works - getting Null value }]); For the above code I am getting NULL value in the console. But If i try it inside the $http success method, it renders the json file contents. Please help me. Thanks in advance.
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27874034
has comment: http://stackoverflow.com/comment/44148770
has answer: http://stackoverflow.com/a/27873165
answer count: 3
has comment: http://stackoverflow.com/comment/44162223
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/27873162
has title: AngularJS eager loading json file

http://stackoverflow.com/q/27822303
has answer: http://stackoverflow.com/a/27822663
type: AnsweredQuestion
has body: Im having trouble getting validate.js to work I have followed the documentation on the github and the form does not display any errors in console log or otherwise. How would I convey an error to the user? Script
possible better answer: http://stackoverflow.com/a/27822904
has answer: http://stackoverflow.com/a/27822904
tagged with: forms
accepted answer: http://stackoverflow.com/a/27822663
type: Question
has title: Trouble Validating form with Validate.js
tagged with: javascript
score: 0
answer count: 2
tagged with: validation

http://stackoverflow.com/a/58084503
score: 1
answers question: http://stackoverflow.com/q/27948046
upvote count: 1
has body: This is an old question, but I hope my answer might help others who need this info as I did. I sometimes need some miscellaneous but reactive data to display indicators in the UI and documents count is a good example. Create a reusable (exported) client-side only collection that won't be imported on the server (to avoid creating unnecessary database collection). Note the name passed as argument ("misc" here). import { Mongo } from "meteor/mongo"; const Misc = new Mongo.Collection("misc"); export default Misc; Create a publication on the server that accepts docId and the name of the key where the count will be saved (with a default value). The collection name to publish to is the one used to create the client only collection ("misc"). The docId value does not matter much, it just needs to be unique among all Misc docs to avoid conflicts. See Meteor docs for details about the publication behavior. import { Meteor } from "meteor/meteor"; import { check } from "meteor/check"; import { Shifts } from "../../collections"; const COLL_NAME = "misc"; /* Publish the number of shifts that need revision in a 'misc' collection * to a document specified as `docId` and optionally to a specified `key`. */ Meteor.publish("shiftsToReviseCount", function({ docId, key = "count" }) { check(docId, String); check(key, String); let initialized = false; let count = 0; const observer = Shifts.find( { needsRevision: true }, { fields: { _id: 1 } } ).observeChanges({ added: () =&gt; { count += 1; if (initialized) { this.changed(COLL_NAME, docId, { [key]: count }); } }, removed: () =&gt; { count -= 1; this.changed(COLL_NAME, docId, { [key]: count }); }, }); if (!initialized) { this.added(COLL_NAME, docId, { [key]: count }); initialized = true; } this.ready(); this.onStop(() =&gt; { observer.stop(); }); }); On the client, import the collection, decide of a docId string (can be saved in a constant), subscribe to the publication and fetch the appropriate document. Voilà! import { Meteor } from "mete…
type: Answer
downvote count: 0

http://stackoverflow.com/comment/44218674
has text: @dandavis: It was regarding the alert as a debugging tool.
comment on: http://stackoverflow.com/q/27909353
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44312175
comment on: http://stackoverflow.com/q/27958952
score: 1
has text: can you show the code that is calling the myfunc() on the two pages? you are getting two results so show the inputs
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44242703
type: Comment
type: QuestionComment
has text: How does it 'not work'? Do you get an error? Which aspect doesn't work?
comment on: http://stackoverflow.com/q/27920101
score: 0

http://stackoverflow.com/q/27956445
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44307738
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/44307860
has body: i have two functions. both are working app.controller("MainController", ["$scope","$http" ,function($scope,$http) { }]); and app.controller("MainController", function($scope,$http) { }); Which one is best to use. and what is the difference in between these. Thanks
duplicate of: http://stackoverflow.com/q/21825117
type: Question
has title: what is difference between these two functions in Angular
linked to: http://stackoverflow.com/q/21825117
has answer: http://stackoverflow.com/a/27956599
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44307591

http://stackoverflow.com/q/27902458
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Slideshow won't accept fixed height
tagged with: css
has answer: http://stackoverflow.com/a/27902578
has body: My current slideshow css with script doesn't seem to accept a common height for the images. Because of this... when they transition the smaller pictures look like they are actually displaying partially above the previous one (aka you see the older image below it). Is there a reason why the height value I have set doesn't do anything and how do I fix this? CSS /* For Slideshow */ /* the slide container with a fixed size */ .slides { box-shadow: 0px 0px 6px black; margin-left: 0; margin-right: 0; width: 500px; height: 200px; postion: relative; } /* the images are positioned absolutely to stack. opacity transitions are animated. */ .slides img { display: block; position: absolute; transition: opacity 1s; opacity: 0; width: 100%; } /* the first image is the current slide. it's faded in. */ .slides img:first-child { z-index: 2; /* frontmost */ opacity: 1; } /* the last image is the previous slide. it's behind the current slide and it's faded over. */ .slides img:last-child { z-index: 1; /* behind current slide */ opacity: 1; } .container { margin-left: auto; margin-right: auto; background-color: #B2D1E0; width: 1000px; height: 200px; border-top: 3px solid black; position: relative; margin-bottom: 100px; } HTML &lt;script&gt; function nextSlide() { var q = function(sel) { return document.querySelector(sel); } q(".slides").appendChild(q(".slides img:first-child")); } setInterval(nextSlide, 3000) &lt;/script&gt; &lt;div class = "container"&gt; &lt;div class="slides"&gt; &lt;img src="http://media02.hongkiat.com/programming-myth/programmer.jpg"&gt; &lt;img src="How-to-Hire-a-Software-Developer1.jpg"&gt; &lt;img src="info-tech-business.jpg"&gt; &lt;img src="IT-Outsourcing.jpg"&gt; &lt;img src="http://lorempixel.com/500/300/?r=5"&gt; &lt;/div&gt; &lt;/div&gt;
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/27902578
tagged with: slideshow
tagged with: javascript
tagged with: image

http://stackoverflow.com/comment/44059756
score: 1
has text: I've added a link to a screenshot (I don't have enough reputation to post an image...). You can see the problem best in the river. (and thank you)
type: QuestionComment
comment on: http://stackoverflow.com/q/27826784
type: Comment

http://stackoverflow.com/q/27891820
has comment: http://stackoverflow.com/comment/44184711
tagged with: iframe
has title: Button on one iframe to display another iframe
accepted answer: http://stackoverflow.com/a/27891892
linked to: http://stackoverflow.com/q/4589576
type: AnsweredQuestion
has body: I have a webpage with two iframes on them: On the first iframe, I have a button When I click on this button, I want to show the other, currently hidden iframe '#iframe1', like so: $('#iframe1').show();Obviously, the problem is that button and iframe to show are different documents/pages. Any ideas how I can achieve that if possible without jQuery's .load-function? Thanks!
type: Question
tagged with: javascript
tagged with: show
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/27891892
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/44291692
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27948300
has text: You could try overriding `global.require` in your main file. `global.require = function(){}`.
score: 0

http://stackoverflow.com/comment/44196462
score: 0
type: AnswerComment
type: Comment
has text: Downvoter please commment
comment on: http://stackoverflow.com/a/27898172

http://stackoverflow.com/comment/44145967
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27871694
has text: Great, although bxslider has great methods for custom animation, like `onSlideBefore` etc.
type: Comment

http://stackoverflow.com/comment/44052492
comment on: http://stackoverflow.com/a/27823194
type: Comment
has text: You must have misunderstood. Sorry for my English. I have read that this code works, as user gets from closure. So try to understand where is the closure. And he came to the conclusion that the method user.sayHi wrapped in an anonymous function, and this anonymous function is declared in the global context, and she in turn has access to the object user.
score: 0
type: AnswerComment

http://stackoverflow.com/a/43632728
answers question: http://stackoverflow.com/q/27827427
score: 0
has body: You can always send vars using iframe url query string name value pairs, and then on page load populate the variables or input fields as you desire.
type: Answer

http://stackoverflow.com/a/34749873
has comment: http://stackoverflow.com/comment/74102245
has comment: http://stackoverflow.com/comment/65972377
type: Answer
has comment: http://stackoverflow.com/comment/80893486
has comment: http://stackoverflow.com/comment/127560355
has comment: http://stackoverflow.com/comment/57519827
has body: I know this is a bit of an old issue but the easiest solution in ES2015/ES6 I could come up with was actually quite simple, using Object.assign(), Hopefully this helps: /** * Simple object check. * @param item * @returns {boolean} */ export function isObject(item) { return (item &amp;&amp; typeof item === 'object' &amp;&amp; !Array.isArray(item)); } /** * Deep merge two objects. * @param target * @param ...sources */ export function mergeDeep(target, ...sources) { if (!sources.length) return target; const source = sources.shift(); if (isObject(target) &amp;&amp; isObject(source)) { for (const key in source) { if (isObject(source[key])) { if (!target[key]) Object.assign(target, { [key]: {} }); mergeDeep(target[key], source[key]); } else { Object.assign(target, { [key]: source[key] }); } } } return mergeDeep(target, ...sources); } Example usage: mergeDeep(this, { a: { b: { c: 123 } } }); // or const merged = mergeDeep({a: 1}, { b : { c: { d: { e: 12345}}}}); console.dir(merged); // { a: 1, b: { c: { d: [Object] } } } You'll find an immutable version of this in the answer below. Note that this will lead to infinite recursion on circular references. There's some great answers on here on how to detect circular references if you think you'd face this issue.
answers question: http://stackoverflow.com/q/27936772
upvote count: 317
has comment: http://stackoverflow.com/comment/111239210
score: 311
has comment: http://stackoverflow.com/comment/107520575
has comment: http://stackoverflow.com/comment/134407916
downvote count: 6
has comment: http://stackoverflow.com/comment/132622266
has comment: http://stackoverflow.com/comment/80811693
has comment: http://stackoverflow.com/comment/82547582
has comment: http://stackoverflow.com/comment/80811657
has comment: http://stackoverflow.com/comment/134068173
has comment: http://stackoverflow.com/comment/134068209
has comment: http://stackoverflow.com/comment/66063944

http://stackoverflow.com/a/27848605
has comment: http://stackoverflow.com/comment/44102266
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27848475
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27848475
has body: You can make a simpler solution: Change your code to the following one and add "popup" class to your divs: JS: $(document).ready(function(){ $("a.fp").click(function(){ $(".popup").hide(); $("div.fp").fadeIn(); }); $("a.sp").click(function(){ $(".popup").hide(); $("div.sp").fadeIn(); }); $("a.tp").click(function(){ $(".popup").hide(); $("div.tp").fadeIn(); }); $("a.ftp").click(function(){ $(".popup").hide(); $("div.ftp").fadeIn(); }); }); HTML: First popup | Second popup | Third popup | Fourth popup Hi, this is first popup content.X Hi, this is second popup content.X Hi, this is third popup content.X Hi, this is fourth popup content.X Edit for the latest question: You can suppress the function when you check if a popup is currently visible with this pseudo selector: $("a.fp").click(function(){ if($('.popup:visible').length > 0) return; // do nothing $(".popup").hide(); $("div.fp").fadeIn(); });
has comment: http://stackoverflow.com/comment/44102066
has comment: http://stackoverflow.com/comment/44101374
type: Answer
has comment: http://stackoverflow.com/comment/44101585

http://stackoverflow.com/comment/46492015
type: AnswerComment
comment on: http://stackoverflow.com/a/27934662
type: Comment
score: 1
has text: Is there seriously no way to make an object delete itself without it seeing its parent array? I feel like putting the array of objects into the root scope (Lautaro's comment below), or pinging an event to some external controller (this answer) are both hacks.

http://stackoverflow.com/comment/44261774
has text: w00t, that worked, can i also change the default marker of google maps for user ??
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27922300
type: Comment

http://stackoverflow.com/q/27838001
has answer: http://stackoverflow.com/a/27838474
type: AnsweredQuestion
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/44080177
has comment: http://stackoverflow.com/comment/44080082
type: Question
answer count: 1
tagged with: javascript
score: -1
has title: Underscore one-liner to transform a collection into object of objects
downvote count: 1
accepted answer: http://stackoverflow.com/a/27838474
has body: I'm trying to find an underscore one-liner to transform a collection into a dictionary of dictionary for later quick access. Example : transforming this [ {a:'prop1', b:'subProp1', c:'first' }, {a:'prop1', b:'subProp2', c:'second'}, {a:'prop2', b:'subProp1', c:'third'}, {a:'prop2', b:'subProp2', c:'forth'} ] into this { prop1 : { subProp1 : {a:'prop1', b:'subProp1', c:'first' }, subProp2 : {a:'prop1', b:'subProp2', c:'second'} }, prop2 : { subProp1 : {a:'prop1', b:'subProp1', c:'third' }, subProp2 : {a:'prop1', b:'subProp2', c:'forth'} } } I know it is quite easy using a loop, but i'm looking for a neat-looking solution that underscore could maybe provide. I've tried with groupbBy and indexBy, but I would still require a loop somewhere, which I'm trying to avoid.
favorite count: 0
upvote count: 0

http://stackoverflow.com/comment/44242735
comment on: http://stackoverflow.com/q/27922848
has text: I am not getting what is the desired output please clear once again.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27849355
has comment: http://stackoverflow.com/comment/44102911
answer count: 1
has comment: http://stackoverflow.com/comment/44103131
has comment: http://stackoverflow.com/comment/44102785
has comment: http://stackoverflow.com/comment/44103312
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27849419
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44102687
has comment: http://stackoverflow.com/comment/44103393
has comment: http://stackoverflow.com/comment/44103094
type: Question
has comment: http://stackoverflow.com/comment/44103356
has comment: http://stackoverflow.com/comment/44103175
tagged with: javascript
tagged with: jquery
has body: I have to choose one simple jquery function to serialize both oft these forms by getting form name dynamically following jsfiddle is not working. JSFIDDLE HTML &lt;form id="JotForm" method="post" enctype="text/plain" class="jot"&gt; FirstName:&lt;input type="text" name="FirstName"&gt; Email:&lt;input type="text" name="Email"&gt; &lt;input id="btnFade" type="button" name="submit" value="Submit"&gt; &lt;/form&gt; &lt;form id="MyForm" method="post" enctype="text/plain" class="jot"&gt; FirstName:&lt;input type="text" name="FirstName"&gt; Email:&lt;input type="text" name="Email"&gt; &lt;input id="btnFade" type="button" name="submit" value="Submit"&gt; &lt;/form&gt; Code Part $(function () { $("#btnFade").bind("click", function () { //alert(FormId); // setTimeout(function () { var FormId = $(".jot").attr('id'); alert(FormId); var FormSerialize = $(FormId).serialize(); console.log(FormSerialize); }); });
accepted answer: http://stackoverflow.com/a/27849419
has comment: http://stackoverflow.com/comment/44103260
has title: Serialize form with Dynamic form names
score: 0

http://stackoverflow.com/q/27943876
has comment: http://stackoverflow.com/comment/44287153
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44283900
answer count: 1
has answer: http://stackoverflow.com/a/27943920
type: UnansweredQuestion
has body: I have intialisd a datatable like this var t = $('#domains_list').DataTable(); Now my problem is how to alert value of each 2nd column of rows which have class 'selected'? say for the below codes: To alert no. of rows selected. The below code works fine alert(t.rows('.selected').data().length +' row(s) selected' ); to alert data of 1st column of rows having class 'selected'. The below code works fine alert(t.cell('.selected', 1).data()); To alert data of 2nd column of all selected class rows. The below code is buggy t.cells('.selected').eq(1).each(function() { alert($(this).data()); }); How can I solve problem #3? Thanks
score: 0
type: Question
has title: Get value of each "selected" cell of datatable

http://stackoverflow.com/q/27879568
has title: Casting a MongoDB document to a strongly typed class
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27892487
score: 1
upvote count: 1
type: Question
tagged with: mongodb
tagged with: javascript
has comment: http://stackoverflow.com/comment/44180662
accepted answer: http://stackoverflow.com/a/27892487
answer count: 1
downvote count: 0
favorite count: 0
has body: Can anyone tell me how to cast a document retrieved from MongoDB to a class I have created myself? I don't want to use Mongoose, I am using github.com/christkv/mongodb-legacy v2.0.13 The values of the document returned from MongoDB { id { MongoDb ID}, email: 'me@home.com', passwordHash: '$2a$04$Wjan4CloaZRYj60MGsDb6e7x11e1QYkjW3N2q5JYBDaKBNipLti36', passwordSalt: '$2a$04$Wjan4CloaZRYj60MGsDb6e', id: 'mrpmorris' } The code that is failing to execute var user = Object.create(User.prototype, document) The exception thrown TypeError: Property description must be an object: $2a$04$Wjan4CloaZRYj60MGsDb6e at defineProperties (native) at Function.create (native) The User class var assert = require('assert') var bcrypt = require('bcrypt') var User = (function () { function User() { this.passwordSalt = "hello" } User.prototype.constructor = User User.prototype.setPassword = function (newPassword, callback) { var self = this assert.ok(newPassword != null, "newPassword cannot be null") assert.ok(newPassword.length &gt;= 8) bcrypt.genSalt(2, function (err, salt) { self.passwordSalt = salt bcrypt.hash(newPassword, salt, function (err, hash) { self.passwordHash = hash callback(err); }) }); } User.prototype.checkPassword = function (password, callback) { var self = this bcrypt.hash(self.passwordHash, self.passwordSalt, function (err, hash) { callback(err, hash === self.passwordHash) }) } return User })() exports.User = User

http://stackoverflow.com/q/27828691
has comment: http://stackoverflow.com/comment/44097376
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44079966
has comment: http://stackoverflow.com/comment/44084654
type: Question
has comment: http://stackoverflow.com/comment/44085163
has answer: http://stackoverflow.com/a/27846936
tagged with: javascript
tagged with: image
tagged with: google-maps-api-3
score: 0
has title: Error adding images on GoogleMaps API v3 InfoBox
answer count: 1
has body: I am trying to add images on the infoBox inside of many markers using GoogleMaps API v3. The code is working fine before trying to add images (omiting the indicated code). Peace Javascript Code on HTML page: function LoadMapa(value) { var idInfoBoxAberto; var infoBox = []; function abrirInfoBox(id, marker) { if (typeof(idInfoBoxAberto) == 'number' && typeof(infoBox[idInfoBoxAberto]) == 'object') {infoBox[idInfoBoxAberto].close(); } infoBox[id].open(map, marker); idInfoBoxAberto = id; } initialize(value); function initialize(value) { var mapCanvas = document.getElementById('map_canvas'); var mapOptions = { center: new google.maps.LatLng(-3.7280,-38.5303), zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(mapCanvas, mapOptions); var latlngbounds = new google.maps.LatLngBounds(); var markers = []; //BUILDING MARKERS $.each(value, function(i,e) { marker = new google.maps.Marker({ map: map, draggable: true, position: new google.maps.LatLng(new Number(e.latitude), new Number(e.longitude)), title: e.nome_posto_saude, visible: true }), boxText = document.createElement("div"), //these are the options for all infoboxes myOptions = { content: boxText, disableAutoPan: false, maxWidth: 0, pixelOffset: new google.maps.Size(-140, 0), zIndex: null, boxStyle: { background: "url('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/tipbox.gif') no-repeat", opacity: 0.75, width: "280px" }, closeBoxMargin: "12px 4px 2px 2px", closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif", infoBoxClearance: new google.maps.Size(1, 1), isHidden: false, pane: "floatPane", enableEventPropagation: false }; //define the text and style for all infoboxes boxText.style.cssText = " border: 1px solid black; margin-top: 8px; background:#333; color:#FFF; font-family:Arial; font-size:12px; padding: 5px; border-radius:6px; -webkit-border-radius:6px; -moz-border-radius:6px;"; //TEXT BOX CUSTOMIZATION var BoxElements = " "+e.nome_posto_sau…
tagged with: jquery

http://stackoverflow.com/comment/44034143
comment on: http://stackoverflow.com/a/27812317
type: AnswerComment
has text: It will as this is javascript
score: 0
type: Comment

http://stackoverflow.com/comment/44046700
type: QuestionComment
comment on: http://stackoverflow.com/q/27820461
score: 1
has text: `inArray` returns `-1` if not found http://api.jquery.com/jquery.inarray/. So it is still true. You have to check for `>-1`.
type: Comment

http://stackoverflow.com/a/27887924
answers question: http://stackoverflow.com/q/27887657
has comment: http://stackoverflow.com/comment/44177393
score: 0
has body: You can use &lt;ul&gt; or &lt;li&gt;. This is basic HTML. In the &lt;li&gt; You can place whatever you want. Such as a link or a input. Try it out! You can find an example here: http://jsfiddle.net/2q9towgz/
has comment: http://stackoverflow.com/comment/44177315
type: Answer

http://stackoverflow.com/q/27874984
score: 0
has comment: http://stackoverflow.com/comment/44151961
answer count: 1
has comment: http://stackoverflow.com/comment/44151758
has comment: http://stackoverflow.com/comment/44152521
tagged with: javascript
has comment: http://stackoverflow.com/comment/44152483
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44152446
has comment: http://stackoverflow.com/comment/44152606
has comment: http://stackoverflow.com/comment/44152485
has answer: http://stackoverflow.com/a/27875217
has comment: http://stackoverflow.com/comment/44151837
has comment: http://stackoverflow.com/comment/44152500
type: Question
has title: Saving object value of only current instance
has body: Trying to change a value of an object only for the single instance. Im trying to make a small library which can a few of the things that jQuery does, just in order to learn the tricks. I currently have a problem with keeping my elements in the object for usage. Working example: Brain('#test').html('a'); // this will change the innerHTML of #test with "a". Not working example: var a = Brain('#test'); var b = Brain('#test2'); a.html('a'); // should change content of #test to "a", but changes content of #test2 to "a" My JS: // create the brain function to select elements var Brain = function(selector, context) { if (typeof context == 'undefined') var context = document; Brain.elements = context.querySelector(selector); return Brain; }; // set and get innerHTML of element Brain.html = function(content) { if (typeof content != 'undefined') Brain.elements.innerHTML = content; return Brain.elements.innerHTML; }; // testing var a = Brain('#test'); var b = Brain('#test2'); a.html('a'); b.html('b'); My HTML test test2 jsfiddle example
tagged with: object
has comment: http://stackoverflow.com/comment/44152423

http://stackoverflow.com/q/27894318
linked to: http://stackoverflow.com/q/26886424
type: UnansweredQuestion
tagged with: line
has title: How to draw lines in Famous?
has comment: http://stackoverflow.com/comment/44233886
answer count: 0
tagged with: famo.us
has body: How would one go about drawing a line dynamically in Famou.us ? I would have thought there would be in innate function or something ? Must we transform a 2D surface into a 1D line ?
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44189823
tagged with: famous-angular
tagged with: geometry

http://stackoverflow.com/comment/67919775
has text: @Stijn - That really cleared a few things up for me, thanks. Can you clarify the 'catch-all' technique? This seems like the logical step for me at the moment, but I'm not sure where to find more detail on how to accomplish this...
score: 0
comment on: http://stackoverflow.com/a/36623117
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44295751
comment on: http://stackoverflow.com/a/27949947
score: 0
type: AnswerComment
type: Comment
has text: This is so close! The id logs correctly and the rest of my js works great but, although the new class is added (a class to change the button's color), the button color doesn't change (I can see that the class has been add by inspecting the button with the Chrome developer tools)...do I need to do some sort of automatic refresh?

http://stackoverflow.com/comment/44197805
type: QuestionComment
has text: Publications `Meteor.publish('activeQuestions', function(){ var currentUserId = this.userId return QuestionList.find({ }); }); Meteor.publish('userAnswer', function(){ var currentUserId = this.userId return UserList.find({_id: currentUserId}); });` Subscriptions `Meteor.subscribe('activeQuestions'); Meteor.subscribe('userAnswer'); ` Im sure I am not using publish and subscribe to their full power.
comment on: http://stackoverflow.com/q/27897142
score: 0
type: Comment

http://stackoverflow.com/comment/44218586
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27909353
has text: how about "any book with non-working code is is either too old, or is poorly written"? there are a lot of JS books out there, most of them bad. i question why the book even covers fake classical inheritance, there are more useful paradigms these days...
score: 0

http://stackoverflow.com/q/27823047
answer count: 1
downvote count: 0
tagged with: spring-security
favorite count: 0
has body: I have a front end written in AngularJS, and a Spring MVC backend. The idea I had was to only secure the REST API services and use an interceptor in AngularJS to redirect the user to the login page when an unauthorized service call is made. The problem I'm facing now is that, while a service is called, the page is briefly displayed before the user is redirected. Is there anything I can do about that? Or is this approach fundamentally flawed? This is the interceptor: $httpProvider.interceptors.push(function ($q, $location) { return { 'responseError': function(rejection) { var status = rejection.status; if (status == 401 || status == 403) { $location.path( "/login" ); } else { } return $q.reject(rejection); } };}); My security configuration: @Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private CustomUserDetailsService customUserDetailsService; @Autowired public void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(customUserDetailsService); } @Override protected void configure(HttpSecurity http) throws Exception { http .antMatcher("/api/**") .authorizeRequests() .anyRequest().authenticated(); } @Bean(name="myAuthenticationManager") @Override public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); } } The login controller: @RequestMapping(value = "/login", method = RequestMethod.POST, produces="application/json") @ResponseBody public String login(@RequestBody User user) { JSONObject result = new JSONObject(); UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword()); try { Authentication auth = authenticationManager.authenticate(token); SecurityContext securityContext = SecurityContextHolder.getContext(); securityContext.setAuthentication(auth); ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestA…
tagged with: angularjs
type: UnansweredQuestion
tagged with: spring-mvc
score: 1
tagged with: java
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27824278
tagged with: javascript
has title: AngularJS and Spring MVC security

http://stackoverflow.com/q/27892695
accepted answer: http://stackoverflow.com/a/27892803
has body: I am looking for way to change 'GetElementById' div inside the div, which I am targeting. Here's the example: Let's say I have this If I would like to change exactly the same div, which I am clicking on, I could use this.style.color='red', but I need to change "insider" div inside exactly 'this' div I'm clicking on. I am looking only for javascript solution, no jquery.
possible better answer: http://stackoverflow.com/a/27892734
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27892734
type: Question
has comment: http://stackoverflow.com/comment/44186586
has answer: http://stackoverflow.com/a/27892898
tagged with: javascript
has title: Something like this.getelementbyid(id of element inside this div)
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44186599
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
has answer: http://stackoverflow.com/a/27892803

mouse-picking
type: Tag
tags question: http://stackoverflow.com/q/27907424
tag name: mouse-picking

http://stackoverflow.com/comment/44043115
type: Comment
has text: So why does it work when calling it directly? but not through the `init`
comment on: http://stackoverflow.com/a/27818676
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44201227
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27863378
type: Comment
has text: http://jsfiddle.net/Lbe81zbe/ is pretty much the setup i have for multiple sections.

http://stackoverflow.com/q/27851150
has title: Cleaning up my View with AngularJS
has answer: http://stackoverflow.com/a/27852175
type: Question
accepted answer: http://stackoverflow.com/a/27852646
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27851235
has answer: http://stackoverflow.com/a/27852646
score: 0
has answer: http://stackoverflow.com/a/27851235
answer count: 3
has body: The snippet I would like to change is the following: You have {{255 - (name.length + email.length + textarea.length)}} characters left Where 255 - name.length + email.length + textarea.length could be wrap up in a function, but when I try to do this in the controller, it is not working. I might just not be understanding a core concept here. Link to my full codepen can be found here: http://codepen.io/Travo100/pen/pvRyoa
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24961940

http://stackoverflow.com/comment/44072800
score: 0
has text: I think this link will help you: http://aspsnippets.com/Blue/Articles/Disable-ASPNet-button-after-click-to-prevent-double-clicking.aspx
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27833564

http://stackoverflow.com/comment/44126859
type: QuestionComment
comment on: http://stackoverflow.com/q/27862213
score: 0
has text: Can you please tell me more about `lean()` and write a working example please? The documentation for `lean()` lack of every kind of information. Thanks.
type: Comment

http://stackoverflow.com/q/27874695
has comment: http://stackoverflow.com/comment/44172752
has comment: http://stackoverflow.com/comment/44173575
tagged with: math
has comment: http://stackoverflow.com/comment/44151167
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/26767512
upvote count: 0
has comment: http://stackoverflow.com/comment/44158978
has comment: http://stackoverflow.com/comment/44172367
tagged with: javascript
linked to: http://stackoverflow.com/q/10477
linked to: http://stackoverflow.com/q/19556544
answer count: 1
score: -1
favorite count: 0
has title: Find equidistant points on ellipse or Beizier curves
has comment: http://stackoverflow.com/comment/44173712
tagged with: geometry
has comment: http://stackoverflow.com/comment/44163229
has comment: http://stackoverflow.com/comment/44151202
has answer: http://stackoverflow.com/a/27887568
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44160085
has comment: http://stackoverflow.com/comment/44157624
has comment: http://stackoverflow.com/comment/44172815
has comment: http://stackoverflow.com/comment/44172627
tagged with: 2d
has body: Currently I writing JavaScript code that will place objects on screen accross the ellipse. I trying to find algorithm that will solve one of this problems, ellipse will be perfect, but if it is too expensive Beizier curve will be ok too. I'm sorry, but unforunately my math doesn't let me to use answers that I found (https://mathoverflow.net/questions/28070/finding-n-points-that-are-equidistant-around-the-circumference-of-an-ellipse , Equidistant points across Bezier curves ), so I need help to translate it to code or just advice how to do this. If you need visualisation of my question you can look at second page of this doc: http://www.saccade.com/writing/graphics/RE-PARAM.PDF

http://stackoverflow.com/comment/44034596
type: AnswerComment
type: Comment
has text: I want to allow buttons like delete,backspace in firefox. But event.preventDefault() doesnot allows.
comment on: http://stackoverflow.com/a/27813829
score: 0

http://stackoverflow.com/comment/44110024
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27852879
has text: IF you are storing messages you don't have to add any extra parameters to your mongo doc, the `_id` has the timestamp

http://stackoverflow.com/q/27821029
possible better answer: http://stackoverflow.com/a/27862783
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has answer: http://stackoverflow.com/a/27862783
has comment: http://stackoverflow.com/comment/44208954
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44142416
linked to: http://stackoverflow.com/q/21530063
has answer: http://stackoverflow.com/a/27862581
type: Question
has answer: http://stackoverflow.com/a/27869984
accepted answer: http://stackoverflow.com/a/27869984
has title: Typeahead Control Not Working
tagged with: javascript
tagged with: typeahead.js
answer count: 3
has comment: http://stackoverflow.com/comment/44233478
upvote count: 1
has body: I am trying to use typeahead.js. My code looks like this: &lt;input id="query" type="search" class="form-control typeahead tt-query" autocomplete="off" spellcheck="false" placeholder="Search by typing anything" /&gt; ... var URL_ROOT = '[populated on server. Something like "http://localhost:8080"]'; var suggestions = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: URL_ROOT + '/api/suggestions?querytext=%QUERY' }); suggestions.initialize(); $(document).ready(function() { $('input.typeahead').typeahead({ source: suggestions.ttAdapter() }); }); When the page loads, I do not see any errors in the console window. As I type though, I do not see any requests to the server in Fiddler. I would expect as I typed to see requests being made to the server to find suggestions. What am I doing wrong?
favorite count: 0
has comment: http://stackoverflow.com/comment/44181827

http://stackoverflow.com/comment/44306320
type: QuestionComment
comment on: http://stackoverflow.com/q/27954809
has text: Is there a way to display or test this: filter:{ 'user._id': global.user._id}:true ??
score: 0
type: Comment

http://stackoverflow.com/a/27865852
answers question: http://stackoverflow.com/q/27851817
has body: There are various problems with your code, but it won't throw an error because the mapping plugin is used improperly. The problem of scope First, fullAddress is a property of Address instances, so you should prefix it with address. Second, the with binding tells Knockout to look for editingPerson.savePerson which doesn't exist. So you have to change the binding to the root scope, like so: click: $root.savePerson. inputAddress: inputAddress: Save Save It is also advised to use objects as constructor parameter, allowing for easier use in combination with the mapping plugin and should you wish to leave out one property. The mapping plugin The mapping plugin documentation clearly states that: All properties of an object are converted into an observable. This means that you cannot include computed observables and expect them to just work. Indeed, the documentation has a part about augmenting JS objects with computed observables here. I might be wrong, but from my tests and the docs, it doesn't seem so that the create functions for mapping can be used for nested objects. Following this documentation, you don't need to create all observable properties explicitly, as a single call to ko.mapping.fromJS can instantiate them. Your new Person constructor would look like this: function Person(options){ // because these arrays contain nested objects with computed observables, // they should have a special create function var self = this, mapping = { 'amounts': { create: function(options) { return new Amount(options.data); }}, 'address': { create: function(options) { return new Address(options.data); }} }; // instantiates all properties, eg. surname, name, id ko.mapping.fromJS(options, mapping, this); self.fullName = ko.computed(function() { return self.name()+" - "+self.surname(); }); } Another minor 'nit-pick': you can only use the mapping plugin's create functions on named object properties, so in your original fiddle, the plugin will never find the persons array because it is …
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27851817
type: Answer

http://stackoverflow.com/comment/44201071
has text: You are calling the *onclick* property instead of assigning to it, use something like: `document.getElementById("pause").onclick = function(){...}`. Fixing the indenting also shows syntax errors.
comment on: http://stackoverflow.com/q/27900636
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/44071534
score: 0
has text: http://plnkr.co/edit/kY8QZ3IIiVD8TIg6KqY1?p=preview looks good to me
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27832486

http://stackoverflow.com/comment/44112940
has text: @epascarello Hmmm... It seems you are [correct](http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2). I could have sworn the in the past when I accidentally used a single quote the W3C validator got angry at me.
comment on: http://stackoverflow.com/a/27854507
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27877445
type: Answer
answers question: http://stackoverflow.com/q/27877161
downvote count: 0
has comment: http://stackoverflow.com/comment/44158426
score: 1
has body: I'm not 100% sure what it is you're asking here (judging by the down votes it would appear others are too). Some general tips for asking questions on StackOverflow: Your question should be clear (it's difficult to actually judge what you're asking here) Your code should ideally be presented in a readable manner (the PHP/HTML code you've provided is all on one line, and considering the question is regarding JavaScript functionality, and we don't have access to the rest of your PHP code, the PHP code is useless in terms of the question, and makes answering your question more effort) JSFiddles are usually helpful when asking a frontend question like this (it means less wasted time replicating the issue) Try and follow the above suggestions when asking a question, the list is by no means all inclusive though, you should also really read through the guidelines on asking questions here. Now onto your actual question. I'm guessing you want your code to function as follows: A user can only select an option once Once an option has been selected it should be added to the numerical contents of a paragraph Assuming I've got the above correct (let me know if not) the following code should work for you: HTML: 1 1 2 3 4 5 6 7 8 9 10 JavaScript: // the paragraph that contains information about your currently selected answer var answerSummary = document.getElementById('answerResult'); // the container of the radio buttons var answersContainer = document.getElementById("allQuestion"); // the radio buttons var answerOptions = answersContainer.getElementsByTagName("input"); for(var i = 0; i < answerOptions.length; i++) { answerOptions[i].addEventListener("click", function(event) { // change the paragraph to show the currently selected value answerSummary.innerHTML = answerSummary.innerHTML + " " + this.value; // disable all radio buttons once an options has been selected for(var i = 0; i < answerOptions.length; i++) { answerOptions[i].disabled = true; } }); } And a link to this code in…
upvote count: 1
has comment: http://stackoverflow.com/comment/44157383

http://stackoverflow.com/comment/44184863
type: Comment
type: QuestionComment
has text: Hmm, how would i go about selecting only mobile phones? I know one can specify a width for a media query but how about mobile phones?
score: 0
comment on: http://stackoverflow.com/q/27891792

http://stackoverflow.com/comment/44306166
score: 0
has text: He's using the default style.
comment on: http://stackoverflow.com/q/27955077
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44142060
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27869815
score: 0
has text: Just shuffle your array. Is the order in the array important?

http://stackoverflow.com/comment/44229829
type: QuestionComment
type: Comment
has text: path of js and jsp is..Webcontent/js/self1.js and Webcontent/jsp/self1.jsp @Outlooker Console shows no error
score: 0
comment on: http://stackoverflow.com/q/27915297

http://stackoverflow.com/a/27932620
has comment: http://stackoverflow.com/comment/44266196
has comment: http://stackoverflow.com/comment/44277670
has comment: http://stackoverflow.com/comment/44266744
has comment: http://stackoverflow.com/comment/44267098
score: 1
has comment: http://stackoverflow.com/comment/44305011
accepted answer of: http://stackoverflow.com/q/27932334
has comment: http://stackoverflow.com/comment/44277981
has comment: http://stackoverflow.com/comment/44266643
answers question: http://stackoverflow.com/q/27932334
has comment: http://stackoverflow.com/comment/44266314
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44265982
has body: If I understand you correctly, this should do what you need: var players = [ { "id" : "45783", "r3" : "DED" }, { "id" : "54762", "r3" : "DEDCCCCDDDDCDEWE" }, // I added chars here to show how to get the rest of the string that is different { "id" : "78903", "r3" : "DEDCDBDDDDDC"} ] var oldPlayers = [ { "id" : "45783", "r3" : "DE" }, { "id" : "54762", "r3" : "DEDCCCCDDDD" }, { "id" : "78903", "r3" : "DEDCDBDDDDD"} ] $.each(players,function(index, element){ var newR3= players[index]["r3"].split(''); var oldR3= oldPlayers[index]["r3"].split(''); var curId= players[index]["id"]; $.each(newR3,function(i, el){ if(el != oldR3[i]){ $('#myDiv').append('Object '+index+' (id '+curId+') in players is different than object '+index+' (id '+curId+') in oldPlayers starting at index: '+i +'&lt;br&gt;'); $('#myDiv').append('The rest of the string, from the fist difference to the end is: ' + newR3.slice(i).join('') +'&lt;br&gt;&lt;br&gt;'); return false; } }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="myDiv"&gt;&lt;/div&gt;
type: Answer
upvote count: 1

http://stackoverflow.com/a/27808206
has comment: http://stackoverflow.com/comment/44026084
has body: If you're not wanting to keep them in order, then basically you can just remove the row, not the cell, and append it to the last row on the other table. You'll need to add another "tbody" tag to the 2nd table so we don't put the rows in the "thead" if there's no rows in the table. $('.add-selection').on('click', function(){ var $row = $(this) .closest('tr') .fadeOut("fast"); $row.detach() .appendTo($('.aside-table').find('tbody tr:last')) .find('button') .removeClass('add-selection') .addClass('remove-selection') .find('span') .removeClass('glyphicon-plus') .addClass('glyphicon-minus'); }); For the remove function, it'd be the same code w/ the exception of the table class selector, and switch out the classes for the button as well.
score: 0
has comment: http://stackoverflow.com/comment/44051162
has comment: http://stackoverflow.com/comment/44064431
answers question: http://stackoverflow.com/q/27808094
type: Answer
has comment: http://stackoverflow.com/comment/44064484

http://stackoverflow.com/a/27815086
has body: javascript $(document).ready(function() { var div_val_arr = []; $("#id_div_values li").each(function() { div_val_arr.push($(this).text()); }); $('#autocomplete').on('focus click touchstart',function() { $( "#autocomplete" ).autocomplete({ source: div_val_arr }); }); }); html some value another value value3 value4 value5 fiddle http://jsfiddle.net/arfrbzbz/1/
accepted answer of: http://stackoverflow.com/q/27814315
answers question: http://stackoverflow.com/q/27814315
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/44076000
upvote count: 1

http://stackoverflow.com/a/27877661
has body: You put {if $anonymous_vote eq "false" and $user_logged_in eq ""} {/if} Which does not make sense at all, because: The if statement is not a html code. You are not using a server-side. You can not refresh a div using a client side only. In Order to refresh a div, you should use a server-side language like (Java, PHP and etc..). For the Java code, you will have to create 2 files: A JSP (Java Server Page) which will contain your HTML code. A Java File Which will be the server-side processing. -For the JSP File, you will need to make a link/button for the user to click in order to refresh a certain div. -For the Java File, you will need to import some libraries Like: import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; And then create the class for Example "Refresh" and implement the doGet method. At the end you will have to redirect the user to the same page. public class Refresh extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(true); session.setAttribute("Example", Div.Refresh()); //The Div.Refresh() is another class with method Refresh, so you will have to create what will the refresh do in another Java Filed called"Div." response.sendRedirect("THE_SAME_PAGE.jsp"); } } I Hope this helps.
has comment: http://stackoverflow.com/comment/44157816
downvote count: 0
answers question: http://stackoverflow.com/q/27877253
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/27909326
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27909173
score: 4
answers question: http://stackoverflow.com/q/27909173
type: Answer
upvote count: 4
downvote count: 0
has body: I am assuming you are setting this for an asynchronously bound data. ng-init is really bad for this purpose. Thumb rule is do not use ng-init for something which controller is supposed to do. You should set up your view model in the controller. The reason why it could fail when the data is bound asynchronously is because ng-init'ed expression is not watched. So it just runs once during the first rendering and the subStatuses is not yet populated and it falls back to showing the default empty option. And even if the data is populated and view is updated during the later digest cycle ng-init expression does not run again. From Doc The only appropriate use of ngInit is for aliasing special properties of ngRepeat, as seen in the demo below. Besides this case, you should use controllers rather than ngInit to initialize values on a scope. So just initialize it in your controller, instead of using ng-init. $scope.getSubStatuses = function(attempt_status) { var statuses = $scope.statuses; for(var index in statuses) { if(statuses[index].name === attempt_status) { if(statuses[index].children) { $scope.subStatuses = statuses[index].children; } else { $scope.subStatuses = []; } break; } } //Initialize the model here, assuming $scope.order is already initialized $scope.order.attempt_status_sub = ($scope.subStatuses[0] ||{}).name; }; angular.module('app', []).controller('ctrl', function($scope, $timeout) { $timeout(function() { $scope.subStatuses = [{ name: 'test1' }, { name: 'test2' }, { name: 'test3' }]; $scope.order = { attempt_status_sub1: $scope.subStatuses[0].name }; }); }); With Ng-Init With controller initialization.

http://stackoverflow.com/q/27930622
has title: Push my values to top of auto completion list in Ace editor
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 3
tagged with: ace-editor
downvote count: 0
type: UnansweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/44258544
has answer: http://stackoverflow.com/a/27931454
has answer: http://stackoverflow.com/a/38528924
type: Question
has body: I'm using a custom completer that pulls values from a server using jQuery.getJSON. My custom completions are showing up along with local and snippets and I'd like mine to always be at the top. I was thinking score would do that but not working like this. I'm giving score a value of 1000. var langTools = ace.require("ace/ext/language_tools"); editor = ace.edit("editor"); editor.setOptions({ enableBasicAutocompletion: true, enableLiveAutocompletion: true, enableSnippets: true }); var myCompleter = { getCompletions: function(editor, session, pos, prefix, callback) { if (prefix.length === 0) { callback(null, []); return; } $.getJSON("/server/completions", function(json) { callback(null, json.map(function(c) { return {value: c.value, caption: c.caption, meta: c.meta, score:c.score}; })); }) } }; langTools.addCompleter(myCompleter); Any ideas? Thanks, /w
answer count: 2

http://stackoverflow.com/comment/44051217
type: Comment
type: QuestionComment
score: 0
has text: see here: http://stackoverflow.com/questions/66420/how-do-you-launch-the-javascript-debugger-in-google-chrome This is the command: debugger;
comment on: http://stackoverflow.com/q/27822679

http://stackoverflow.com/a/27956277
score: 0
answers question: http://stackoverflow.com/q/27955533
type: Answer
has body: You could say JS belongs to a category of languages where the idea that everything is an object on equal footing is part of the "philosophy" that has guided its development. Node's require is a function (an object) supplied by the environment, as is the module object. This pattern is called the Common JS format. You actually don't have to assign the result of the require function to a variable. It's rare in practice, but the node module you're calling on could just be invoked to cause an action to take place, for example one might require sugar.js which alters some of the native objects but has no methods of its own to offer, so there would be no point in assigning the return value (which is the module.exports object that was supplied during that module's execution). A more common example of not assigning a module to a variable is when one uses require just to grab some property off the module -- e.g. var x = require('module').methodOfInterest. Similarly, some modules return a constructor, so you may sometimes see var instance = new (require('ConstructorModule'))(options) (which is ugly in my opinion; requires should generally be grouped at the top of a file and acted on only afterwards). Note: There's really no concrete answer to your question so odds are high that it will get closed as SO-inappropriate.

http://stackoverflow.com/comment/125279598
comment on: http://stackoverflow.com/a/27958186
type: AnswerComment
type: Comment
has text: Remember to encode the URL of your file! As described in the [docs](https://www.microsoft.com/en-us/microsoft-365/blog/2013/04/10/office-web-viewer-view-office-documents-in-a-browser/)
score: 1

http://stackoverflow.com/q/27929479
accepted answer: http://stackoverflow.com/a/27930466
tagged with: controller
answer count: 1
downvote count: 0
has body: Question: is it possible, to make a direct connection between two parallel directives w/o creating a factory, parent-directive or emit/broadcast but just a straight require: 'directiveA' Note: if i'm being silly with this request please tell me... I just like the readability of this idea and am curious if it is feasible? Here we go, I have two directives that are parallel to another. HTML: click to update store {{storeDataA}} {{newStoreDataB}} JS:: directive-a angular.module('carouselApp') .directive('directiveA', function () { return { templateUrl: 'views/modal/directiveA.html', //note this require statement. require: 'directiveB', link: function (scope, el, attrs, ctrl) { scope.updateStore = function(storeID){ scope.storeDataA = storeID; ctrl.updateStoreB(storeID) }; }}); JS:: directive-b angular.module('carouselApp') .directive('directiveA', function () { return { templateUrl: 'views/modal/directiveB.html', controller: function($scope){ this.updateStoreB = function(storeID){ $scope.storeB = storeID+"storeB"; } } });
has comment: http://stackoverflow.com/comment/44256601
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44256341
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27930466
score: 1
has title: require a parallel directives controller w/o creating a parent controller
upvote count: 1
type: Question
tagged with: angularjs-directive
tagged with: javascript

http://stackoverflow.com/a/27812827
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27812685
type: Answer
has comment: http://stackoverflow.com/comment/44033703
has comment: http://stackoverflow.com/comment/44033968
upvote count: 2
has comment: http://stackoverflow.com/comment/44034109
has comment: http://stackoverflow.com/comment/44034741
score: 2
has comment: http://stackoverflow.com/comment/44033123
has comment: http://stackoverflow.com/comment/44033815
has body: you are inject $routeProvider please make sure you loaded: angular-route.js cdn: https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular-route.js when u loaded,then add dependency to your app with ngRoute angular.module('app', ['ngRoute']);
accepted answer of: http://stackoverflow.com/q/27812685

http://stackoverflow.com/q/27961813
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44317084
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44317528
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has body: I want to display image, expanded such as radial effect (from width 0 to 100%). I've tried using jQuery animated property, image work as I want but don't remains at fixed point. js &lt;script&gt; jQuery(function(){ jQuery( "#vert img" ).animate({ width: "100%", height: "100%", opacity: 1 }, 1500 ); }); &lt;/script&gt; html &lt;div id="vert"&gt; &lt;img src="images/radial.png" alt="Radial" /&gt; &lt;/div&gt; css #vert{ width: 960px; height: 600px; position: absolute; top: 50%; left: 50%; margin-top: -333px; margin-left: -480px; } #vert img{ width: 0; height: 0; opacity: 0; }
type: Question
has title: jQuery image radial effect
tagged with: javascript

http://stackoverflow.com/q/27900279
linked to: http://stackoverflow.com/q/27580145
accepted answer: http://stackoverflow.com/a/27902053
tagged with: asp.net-web-api
tagged with: javascript
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44203019
has title: POST parameter to web api being set as null
has answer: http://stackoverflow.com/a/27902053
has answer: http://stackoverflow.com/a/27900356
has comment: http://stackoverflow.com/comment/44203252
linked to: http://stackoverflow.com/q/21035849
has comment: http://stackoverflow.com/comment/44200978
tagged with: ngresource
type: AnsweredQuestion
tagged with: c#
has comment: http://stackoverflow.com/comment/44201150
possible better answer: http://stackoverflow.com/a/27900356
has body: I'm trying to use ng-resource to POST a value to my web-api and get the value back in javascript. While the request seems to go through alright, the parameter being passed to my function public string AddOrder([FromBody]string order) seems to be set as null. orderController.js var result = $scope.store.sendOrder("hello"); store.js function store($resource) { var Resource = $resource('/api/products/'); this.products = Resource.query(); this.sendOrder = function (order) { var sendOrder = $resource('/api/products'); var result = sendOrder.save("Helloa"); &lt;--- return result; } } ProductController.cs [Route("api/products")] [HttpPost] public string AddOrder([FromBody]string order) { return order; //When I put a breakpoint here and check the value of order, it is null. } raw request POST http://localhost:12345/api/products HTTP/1.1 Host: localhost:12345 Connection: keep-alive Content-Length: 6 Accept: application/json, text/plain, */* Origin: http://localhost:12345 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 Content-Type: application/json;charset=UTF-8 Referer: http://localhost:12345/Home/Cart Accept-Encoding: gzip, deflate Accept-Language: en-GB,en;q=0.8,es;q=0.6,en-US;q=0.4 Cookie: ai_user=fc592beca77b4a5e8c4a95db221a574a|2014-12-04T18:36:22.7128874+00:00 hello raw reply HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Type: application/json; charset=utf-8 Expires: -1 Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcbXJ5YW4uQVNBVklFXERvY3VtZW50c1xleHByZXNzb1xFeHByZXNzb1x3ZWJzaXRlc1xjb25zdW1lclxhcGlccHJvZHVjdHM=?= X-Powered-By: ASP.NET Date: Mon, 12 Jan 2015 10:45:03 GMT Content-Length: 4 null Anybody have any ideas? Edit The quickest / easiest solution to this was to wrap the string in an object as follows: Order.cs public class Order { public string order { get; set; } } ProductController.cs [Route("api/products")] [HttpPost] public …
type: Question
score: 0
answer count: 2

http://stackoverflow.com/comment/44069009
has text: I removed iResolution from the code here. It was extraneous.
type: Comment
comment on: http://stackoverflow.com/a/27830875
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44196340
score: 0
comment on: http://stackoverflow.com/q/27896993
type: QuestionComment
has text: see this example -> http://jsfiddle.net/3h11vqkq/
type: Comment

http://stackoverflow.com/q/27911182
tagged with: arrays
tagged with: javascript
tagged with: counting
favorite count: 0
answer count: 3
downvote count: 1
has title: Counting If Element Appears in Both Arrays
has answer: http://stackoverflow.com/a/27911238
upvote count: 0
has answer: http://stackoverflow.com/a/27911250
accepted answer: http://stackoverflow.com/a/27911250
has body: I am trying to create a counter that increments playerScores for each player in allPlayers every time allPlayers[i] appears in roundWinners. Currently imJbVrPfGG only raises to a count of 1 whereas it should be 3. Arrays: allPlayers = ["iMJbVrPfGG","PjCtgHizDF","iQtZ88qyeX","zhvd8mAdhl"] roundWinners = ["iMJbVrPfGG","iMJbVrPfGG","iMJbVrPfGG"] Code: for (i = 0; i &lt; allPlayers.length; i++) { playersScores[i] = 0; } for (i = 0; i &lt; roundWinners.length; i++) { if(roundWinners[i] == allPlayers[i]){ var index = allPlayers.indexOf(roundWinners[i]) playersScores[index]++; } }
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27911292
score: -1
possible better answer: http://stackoverflow.com/a/27911238
type: Question

http://stackoverflow.com/comment/44060207
score: 0
type: Comment
type: QuestionComment
has text: Two day from Today variable @Demodave
comment on: http://stackoverflow.com/q/27827066

http://stackoverflow.com/comment/44083978
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27840073
score: 1
has text: Where does `title` and `slug` come into it? Should there be a replace for those too?

http://stackoverflow.com/a/34718954
answers question: http://stackoverflow.com/q/27957726
score: 5
has body: Try stream.getVideoTracks()[0].stop(); to stop the screen capture. And to record the stream caught using chrome.tabCapture API , you could use RecordRTC.js var video_constraints = { mandatory: { chromeMediaSource: 'tab' } }; var constraints = { audio: false, video: true, videoConstraints: video_constraints }; chrome.tabCapture.capture(constraints, function(stream) { console.log(stream) var options = { type: 'video', mimeType : 'video/webm', // minimum time between pushing frames to Whammy (in milliseconds) frameInterval: 20, video: { width: 1280, height: 720 }, canvas: { width: 1280, height: 720 } }; var recordRTC = new RecordRTC(stream, options); recordRTC.startRecording(); setTimeout(function(){ recordRTC.stopRecording(function(videoURL) { stream.getVideoTracks()[0].stop(); recordRTC.save(); }); },10*1000); }); I hope the above code snippet would help you :) Edit 1: corrected the RecordRTC initialization.
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/57185734
type: Answer
has comment: http://stackoverflow.com/comment/57189522

http://stackoverflow.com/q/27813528
score: 0
has answer: http://stackoverflow.com/a/27813566
accepted answer: http://stackoverflow.com/a/27813566
possible better answer: http://stackoverflow.com/a/27813595
has answer: http://stackoverflow.com/a/27813595
has comment: http://stackoverflow.com/comment/44034116
tagged with: php
has body: Here is my javascript code and the render function is function CustomAlert() { this.render = function (dialog,url) { var winW = window.innerWidth; var winH = window.innerHeight; var dialogoverlay = document.getElementById('dialogoverlay'); var dialogbox = document.getElementById('dialogbox'); dialogoverlay.style.display = "block"; dialogoverlay.style.height = winH + "px"; dialogbox.style.left = (winW / 2) - (550 * 0.5) + "px"; dialogbox.style.top = "100px"; dialogbox.style.display = "block"; document.getElementById('dialogboxhead').innerHTML = "Heading"; document.getElementById('dialogboxbody').innerHTML = dialog; document.getElementById('dialogboxfoot').innerHTML = " OK "; } this.ok = function (url) { window.location.href(url); document.getElementById('dialogbox').style.display = "none"; document.getElementById('dialogoverlay').style.display = "none"; } } var Alert = new CustomAlert(); my problem is the page is not redirecting after clicking the 'Ok' button. Please help me??
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44034117
has title: How to redirect a page when preessed ok button of custom alert box in javascript
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/73578523
has body: Please DO NOT just add the month by 1! It may break in some situations because each month has different days. The more secure way is like following: date.setDate(1); date.setMonth(date.getMonth() + 1); You may ask why do we have to do date.setDate(1);? It is because there are different days in each month. If today is Oct 31 and you add the month by 1, then it will become Nov 31. However, Nov 31 is not a valid date... Here is a rainy example for how it will break in this situation: const date = new Date(2022, 9, 31); // Oct 31st date.setMonth(date.getMonth() + 1); console.log(date); // It returns "Dec 1st"
answers question: http://stackoverflow.com/q/27935267
score: 0
type: Answer

http://stackoverflow.com/a/27926540
upvote count: 1
answers question: http://stackoverflow.com/q/27926107
has comment: http://stackoverflow.com/comment/44250623
type: Answer
has comment: http://stackoverflow.com/comment/44252303
downvote count: 0
score: 1
has body: The client-side script won't have access to the server-side List. I don't know offhand what liEmailIdsForCC.ToString will return, but I don't think it's not going to be something JavaScript can use. If you want to have access to the string list, I'd convert it to a JavaScript array. Something like the following. Though you should probably escape the strings. tblCell = new HtmlTableCell(); List&lt;string&gt; liEmailIdsForCC = new List&lt;string&gt;(); if(some condition) { liEmailIdsForCC.add("someitem"); } HyperLink hpOwnerName = new HyperLink(); hpOwnerName.Text += string.Format("(FullName) ", "FullName"); string listJSArray = string.Format("['{0}']", string.Join("', '", liEmailIdsForCC.ToArray()); var onClick = string.Format("OnNameClick(this, {0}); return false;", listJSArray); hpOwnerName.Attributes.Add("onclick", onClick); tblCell.Controls.Add(hpOwnerName); // javascript code... function OnNameClick(source, list) { alert(list[0]); }

http://stackoverflow.com/a/27898605
answers question: http://stackoverflow.com/q/27895676
downvote count: 0
score: 1
has body: A few things: That's not quite how to use GM_setValue(). See the documentation for GM_setValue. Those @match directives need an /* at the end. (Unless you really want the exact home page, and no others.) In case either page uses javascript techniques, use waitForKeyElements (or similar) to handle timing issues. To avoid misfires, probably best to have websiteB delete the stored value after it has used it. Putting it all together, the script would be like this: // ==UserScript== // @name Form Copier, Cross-domain // @match https://Sender.com/* // @match https://Receiver.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_openInTab // ==/UserScript== //-- Wait for the element with the ID "name". waitForKeyElements ("#name", setOrGetName, true); function setOrGetName (jNode) { if (location.hostname == "Sender.com") { //-- Store the `name` value: GM_setValue ("nameVal", jNode.val() ); GM_openInTab ("https://Receiver.com/"); } else if (location.hostname == "Receiver.com") { var nameVal = GM_getValue ("nameVal"); if (nameVal) { //-- Set the form value: jNode.val (nameVal); //-- Reset storage: GM_deleteValue ("nameVal"); } } }
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27895676
type: Answer

http://stackoverflow.com/q/27835165
has comment: http://stackoverflow.com/comment/44080011
has comment: http://stackoverflow.com/comment/44075801
downvote count: 0
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
has title: Uncaught SyntaxError: Unexpected token < using bower_components
has comment: http://stackoverflow.com/comment/44076265
tagged with: javascript
has comment: http://stackoverflow.com/comment/51756364
has body: Hi i am getting a Uncaught SyntaxError: Unexpected token < My code is: Contacts Contacts
has comment: http://stackoverflow.com/comment/44075273

http://stackoverflow.com/q/27835358
favorite count: 0
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/27836651
has title: How to get button text with ng-model in angular.js?
has answer: http://stackoverflow.com/a/27835421
answer count: 3
upvote count: 1
has body: I just started to work with Angular, it seems good to implement. I always use ng-model to get text from textfield. Can I get the button text with help of ng-model or something else? For example this is button Do it and I want to get Do it with Angular.
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27836517
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44075682

http://stackoverflow.com/a/27958621
has body: From the docs: Angular expressions do not have access to global variables like window, document or location. This restriction is intentional. It prevents accidental access to the global state – a common source of subtle bugs. Can you just attach the function to the model prototype? That way you just can access it wherever you have an instance of the model. Alternatively, you could create a wrapper class (basically a view-model) that has the interface you need, and delegates to the real model instance.
has comment: http://stackoverflow.com/comment/44319909
has comment: http://stackoverflow.com/comment/44320006
answers question: http://stackoverflow.com/q/27958359
score: 0
type: Answer

http://stackoverflow.com/comment/44179386
comment on: http://stackoverflow.com/a/27885512
score: 0
type: AnswerComment
type: Comment
has text: If the was what you were looking for, consider accepting it by clicking he "accept mark" below the rating.

http://stackoverflow.com/q/27923282
upvote count: 1
tagged with: angular-ui-router
type: UnansweredQuestion
has body: I'm using the ui-router's ui-view directive and ng-animate 1.3.8 to add a CSS page transition when the ui-view content is updated on state change. I have the transition working perfectly but I would now like to define a boolean variable in the $rootScope that is set to true while the ui-view animation is occurring and false otherwise. What is the Angular way of doing this? I've tried defining a new animation with a timeout set to the same time period as the css transition and then attaching it to the ui-view element but it only seems to work intermittently. It also seems completely bad practice so I'm keen to know the correct way. See code below: In HTML: &lt;div ui-view="main" class="trans-timer"&gt;&lt;/div&gt; Animation: .animation('.trans-timer', function($timeout, $rootScope) { return { enter : function(element, done, memo) { $rootScope.isAnimating = true; $timeout(function () { $rootScope.isAnimating = false; }, 500); } }; }) Thanks.
downvote count: 0
answer count: 0
tagged with: javascript
score: 1
favorite count: 0
has title: Angular.js set boolean scope variable when animation is occurring via UI-Router's ui-view directive
tagged with: angularjs
type: Question
tagged with: animation
tagged with: ng-animate

http://stackoverflow.com/q/27884849
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44171772
has comment: http://stackoverflow.com/comment/44171769
has comment: http://stackoverflow.com/comment/44171184
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: Java Script validation Performance issue in IE9 and not in IE8 during validating the entry field and Data of birth field: Behavior of System: Overview about the system behavior, System has to validate all the mandatory entry field(6 controls), dropdown fields(5 controls) and Date Of Birth(1 control) field to validate date and some validation related to entry field like only alphanumeric to key in and only specific Thai language character to key in with regular expression. Once all the validation passes, system has to enable the next button to navigate next page in an Wizard. Coding: To accomplish the above functionality, coded in Java script when ever user key in a single character in any of the mandatory fields, system will check for all the fields are having valid data to enable next and clear the mandatory symbol(red * to indicate mandatory field). attachEvent(ctrls, "onkeyup", handleValidation()); function handleValidation(){ var arrCtrls = getAllRequiredCtrls(); var blnvalidated = false; for(i=0; attCtrls.length(); i++){ objCtrls = arrCtrls[i]; if(objCtrls.Validate == true){ var objFunc = ObjCtrls._ValidateFunc; blnvalidated = eval(objFunc); if(blnvalidated) continue; else break; } if(blnvalidated) enableButton(butNext); } Issue: So, when key in any of the mandatory controls it takes quite a long time to validate all fields and allow the next char to key in. This performance issue occurs only in IE9 not in IE8. Validating all mandatory fields is very much required to verify all fields having valid data to enable next button to navigate next page. Please suggest to resolve this issue, Thanks in advance.
has title: performance issue in IE9 and not in IE8 on validating mandatory controls and date controls
tagged with: internet-explorer-8
score: 1
tagged with: internet-explorer-9
type: Question
tagged with: validation

http://stackoverflow.com/comment/44182137
comment on: http://stackoverflow.com/q/27889800
score: 0
type: Comment
type: QuestionComment
has text: @Boann Hope I'm not duplicating again on this one http://stackoverflow.com/questions/27890656/javascript-arrays-comparing-two-similars-arrays-and-getting-object-that-needs but that'd be in the end what I really look for

http://stackoverflow.com/q/27957134
has answer: http://stackoverflow.com/a/27957217
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44324667
possible better answer: http://stackoverflow.com/a/27957207
has answer: http://stackoverflow.com/a/27957207
has comment: http://stackoverflow.com/comment/44324754
accepted answer: http://stackoverflow.com/a/27957217
has body: If functions are objects in javascript, why can't I access the function scope defined variables? I understand that in the code: // variable test assigned an anonymous function var test = function(){ var x = 5; }; console.log(test.x); // undefined // Even when the function is explicitly named: function test(){ var x = 5; } console.log(test.x); // undefined I don't need to get this working or anything; I just need to understand why functions are like this. Thanks.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27957169
has comment: http://stackoverflow.com/comment/44308702
score: 1
has comment: http://stackoverflow.com/comment/44308693
has answer: http://stackoverflow.com/a/27957200
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/500431
has title: Why can't I access variables inside a function?
has answer: http://stackoverflow.com/a/27957167
has comment: http://stackoverflow.com/comment/44324618
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/27957190

http://stackoverflow.com/comment/44116587
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27856565
has text: How about [this](http://jsfiddle.net/uLc8dcsh/2/)?

http://stackoverflow.com/a/27964318
accepted answer of: http://stackoverflow.com/q/27961888
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27961888
has body: One angular way is using providers for module configuration. Here documentation Here a nice example And here 2 fiddle, 1 for using defaultUrl and other for change it from client. [http://jsfiddle.net/r057c9o5/3/][3] [http://jsfiddle.net/t5uf9jau/][4]

http://stackoverflow.com/comment/44299672
type: Comment
type: QuestionComment
has text: Didn't realize my HTML wasn't visible, so I've corrected that, IndieRok. I also added a snippet of the event handler. Let me know if you need to see more of the code...
score: 0
comment on: http://stackoverflow.com/q/27952048

http://stackoverflow.com/comment/44227985
comment on: http://stackoverflow.com/a/27908920
score: 0
type: AnswerComment
type: Comment
has text: --thanks for that. that works really well to make the graph with timeframe on the x-axis. Do you think I can create a similar graph against a property other than the timestamp. Say for instead of timeframe , I want to plot it against some other property like purchased_date.month , or against delivery_week ?

http://stackoverflow.com/comment/44057284
has text: Got it. I've edited my answer to include an example for this case.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27810846

http://stackoverflow.com/q/27817077
favorite count: 0
possible better answer: http://stackoverflow.com/a/27817104
has answer: http://stackoverflow.com/a/27817104
accepted answer: http://stackoverflow.com/a/27817144
has comment: http://stackoverflow.com/comment/44040210
tagged with: node.js
score: -1
type: AnsweredQuestion
has body: include.js file contain var test = function(){ console.log("log from included file"); }; main.js file contain require('./include.js'); test(); when i tried to run main.js using node main.js command it shows module.js:340 throw err; ^ Error: Cannot find module 'include.js' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.&lt;anonymous&gt; (d:\Nishada\test\main.js:1:63) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) what is the reason for this error ?
has comment: http://stackoverflow.com/comment/44040230
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
has title: Javascript Require
has answer: http://stackoverflow.com/a/27817144
has answer: http://stackoverflow.com/a/27817209
answer count: 3

http://stackoverflow.com/comment/44211031
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27866535
score: 0
has text: @outtheairlock I updated my answer. This should work for you. It isn't, by any means, perfect. However, it should work for you.

http://stackoverflow.com/comment/44214509
comment on: http://stackoverflow.com/q/27907549
has text: Where's the code you are trying with, all I see is a bunch of data and no attempt to solve the problem
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27954984
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27955006
has body: The following snippet of code var map = { a: 1, b: 2 }, arr = ['a']; console.log(map[arr]); will print out 1. Why is that? Does Javascript convert arr into a string before doing the lookup?
type: Question
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27955006
has title: Looking up a map value where the key is a string inside an array. Why does this work?
score: 0

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/27938175
tags question: http://stackoverflow.com/q/27849643
tags question: http://stackoverflow.com/q/27963811
tags question: http://stackoverflow.com/q/27961196
tags question: http://stackoverflow.com/q/27925801
type: Tag
tags question: http://stackoverflow.com/q/27895192

http://stackoverflow.com/q/27850169
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27850378
accepted answer: http://stackoverflow.com/a/27864692
score: 0
has answer: http://stackoverflow.com/a/27850213
has comment: http://stackoverflow.com/comment/44104412
possible better answer: http://stackoverflow.com/a/27854660
has comment: http://stackoverflow.com/comment/44104613
has title: Delay doesn't appear to delay after a Stop(true, true) on an element
has answer: http://stackoverflow.com/a/27854660
has body: What I want is to fade in, wait 10 seconds, then fade out. Instead, it's fading in, then immediately fading out. It appears this code is not running at all: .delay(delayInMS) //delayInMS is 10000 aka 10 seconds. This isn't the full code base, but it is the minimal portion that causes the problem. I need two functions with these signatures, and I don't know why the delay isn't taking place. Code: Hello! CSS: div { display: none; padding: 20px; font-size: 20; color: white; background-color: green; } Javascript: $(document).ready(function() { $('input').on('click', function() { showDiv(); }); function showDiv() { var $div = $('div'); $div.stop(true, true) .fadeTo(0, 0) .show() .fadeTo(1000, 1, function() { hideDiv(10000) }); } function hideDiv(delayInMS) { var $div = $('div'); $div.stop(true, true) .delay(delayInMS) // <-- This appears not to delay .fadeTo(1000, 0, function() { $div.hide(); }); } }); JsFiddle Example
tagged with: animation
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27864692
type: Question

http://stackoverflow.com/q/27894602
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/44190307
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/27894670
type: Question
answer count: 1
downvote count: 0
has body: I'm working on a Rails app with one of my friends, and I'm helping out with some frontend and UI tasks. For one of the views, the page just displays an image that a user uploaded. In my javascript, I need to get the image width which can possibly change every time. In other questions on this site, I saw many people had the solution to use something like var image = new Image(); However, since this image is being dynamically loaded by rails, I cannot access the image like that. Essentially, how can I determine the original dimensions of a dynamically loaded image in javascript? Dirty solutions I have imagined but will try to avoid: 1- Get the item's width before modifying it with css - e.g. originalWidth = img.width(); img.css('width','100%'); 2- have the rails app store the image dimensions so I can embed them like &lt;%= @image.width%&gt; in my JS code
favorite count: 0
has comment: http://stackoverflow.com/comment/44190316
has title: How can I get the original image dimensions from an image loaded from rails in Javascript?
accepted answer: http://stackoverflow.com/a/27894670
score: 2
upvote count: 2

http://stackoverflow.com/comment/137060682
comment on: http://stackoverflow.com/a/58754469
score: 0
type: AnswerComment
type: Comment
has text: this worked for us in ReactJS

http://stackoverflow.com/a/27869900
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27869815
accepted answer of: http://stackoverflow.com/q/27869815
type: Answer
has body: Add this function function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex ; // While there remain elements to shuffle... while (0 !== currentIndex) { // Pick a remaining element... randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; // And swap it with the current element. temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; } And then run your array through it like questionnaire = shuffle(questionnaire); See http://jsfiddle.net/apcdm3rk/

http://stackoverflow.com/comment/44086783
type: AnswerComment
has text: Actually, the whole point is that you wouldn't do so. A namespace as generally used is singular. That's really the point. If you're looking for general object construction patterns, this is not the right list of options. Then you could do simple prototype work as you mention, use `Object.create`, choose one of the many helper libraries for this, or just [search for](https://www.google.com/webhp?q=javascript+object+creation+patterns) javascript object creation patterns.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27828455

http://stackoverflow.com/comment/44192455
type: QuestionComment
has text: can u post your code in a js fiddle?
score: 0
comment on: http://stackoverflow.com/q/27895742
type: Comment

http://stackoverflow.com/comment/44305473
score: 0
type: Comment
type: QuestionComment
has text: Please clean up the question from irrelevant information. If ajax call is irrelevant - please remove and put all `console.logs` + the corresponding screenshots. Or better a single screenshot for: `console.log` before, `console.log` after for the single contiguous call.
comment on: http://stackoverflow.com/q/27955104

http://stackoverflow.com/a/27867213
has comment: http://stackoverflow.com/comment/44140015
upvote count: 3
answers question: http://stackoverflow.com/q/27866716
has body: Better to use Hypelink in that scenario, it has target option to do that:- &lt;asp:HyperLink ID="Link" runat="server" CssClass="ReadOnlyLabel" CausesValidationn="false" Target="_blank"&gt;Click Here&lt;/asp:HyperLink&gt; Just set NavigateUrl property to set window url, and set Target property as _blank.
downvote count: 0
has comment: http://stackoverflow.com/comment/44137954
type: Answer
score: 3

http://stackoverflow.com/q/27830052
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44121414
answer count: 1
type: UnansweredQuestion
tagged with: dojo
has body: I'm having trouble calling a method from my dojo module in another dojo module. The code of my calling module is: define([ "Templates/MarkTicket", "DataTypes/MarkTicketForm_Data", "DBCalls/MarkTicketDB", ...], function (MarkTicket, MarkTicketForm_Data, MarkTicketDB, ... ) { return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { postCreate: function () { //both modules have Test Method MarkTicketDB.Test("call from MarkTicketForm");//works great MarkTicket.Test("call from MarkTicketForm");//object doesnt support property or method test }, ... }); }); The call to Test in MarkTicketDB works just fine, but I get the error shown in the code comment when I try to call Test method in MarkTicket. MarkTicket only shows a Createsubclass and extend method when I debug. The module I'm calling these methods from is also located in the Templates directory -- could this be the problem? (I've also tried defining Templates/MarkTicket as just MarkTicket in the define statement)The Templates package is defined in my main page Any ideas? Thanks As I said in my comment I think the problem may be that my calling module (MarkTicketForm) is a dijit dialog that is instantiated and opened through MarkTicket here is the code: MarkTicket: ... postCreate: function () { MT = new MarkTicketForm();//instaniate MarkTicketForm inside MarkTicket } ... //call a Method in MarkTicket Form to open the dialog MT.showForm(TicketInfo); ... MarkTicketForm (code to show dialog): ... showForm: function (ticketInfo) { ID = ticketInfo.ID; var DateRcvd = this.formatDate(ticketInfo.DateRcvd); this.lblID.innerHTML = ticketInfo.ID; this.lblTicket.innerHTML = ticketInfo.Ticket; this.lblRcvd.innerHTML = DateRcvd; this.lblType.innerHTML = ticketInfo.TicketType; this.myDialog.show(); }, ...
has title: cant call function in another dojo module from dojo module
type: Question
has comment: http://stackoverflow.com/comment/44103578
has answer: http://stackoverflow.com/a/29877440

http://stackoverflow.com/a/27833216
has comment: http://stackoverflow.com/comment/44072109
type: Answer
has body: Because you have passed the "name" parameter in request body of POST,and more over it is JSON type. Just make it GET request and remove the below line `contentType: 'application/json',mimeType: 'application/json', EDIT:-- write below line of code in your servlet,you will have to use JSON library,to parse the data in your servlet(GSON or Jackson) See :- Stack overflow answer StringBuffer jb = new StringBuffer(); String line = null; try { BufferedReader reader = request.getReader(); while ((line = reader.readLine()) != null) jb.append(line); } catch (Exception e) { /*report an error*/ } try { JSONObject jsonObject = JSONObject.fromObject(jb.toString()); } catch (ParseException e) { // crash and burn throw new IOException("Error parsing JSON request string"); }
has comment: http://stackoverflow.com/comment/44072363
answers question: http://stackoverflow.com/q/27833119
accepted answer of: http://stackoverflow.com/q/27833119
has comment: http://stackoverflow.com/comment/44072388
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44071979

http://stackoverflow.com/a/27892472
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27892316
answers question: http://stackoverflow.com/q/27892316
upvote count: 1
type: AcceptedAnswer
has body: http://www.amazon.com/dp/0321146530/?tag=stackoverfl08-20 If you've never done or are curious about TDD, this is a great book to carefully walk you through learning how and why to do it.

http://stackoverflow.com/comment/44133004
comment on: http://stackoverflow.com/a/27864647
type: AnswerComment
score: 1
type: Comment
has text: Aha, that makes complete sense, I was so busy thinking about the new syntax I forgot to think about basic parsing rules :) This works perfectly in 6to5 also. Thanks.

http://stackoverflow.com/q/27878349
has answer: http://stackoverflow.com/a/27878833
has answer: http://stackoverflow.com/a/27887917
type: Question
has answer: http://stackoverflow.com/a/27887847
has body: I came across some eval code: eval('[+!+[]+!+[]+!+[]+!+[]+!+[]]'); This code equals the integer 5. What is this type of thing called? I've tried searching the web but I can't seem to figure out what this is referred to. I find this very interesting and would like to know where/how one learns how to print different things instead of just the integer 5. Letters, symbols and etc. Since I can't pin point a pattern in that code I've had 0 success taking from and adding to it to make different results. Is this some type of obfuscation?
tagged with: javascript
has title: Javascript eval - obfuscation?
possible better answer: http://stackoverflow.com/a/27887847
has comment: http://stackoverflow.com/comment/44160356
downvote count: 0
accepted answer: http://stackoverflow.com/a/27887917
score: 8
favorite count: 0
tagged with: binary
has comment: http://stackoverflow.com/comment/44158457
upvote count: 8
tagged with: obfuscation
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27878440

http://stackoverflow.com/comment/56164025
score: 13
comment on: http://stackoverflow.com/a/27928475
has text: @vsync I think you're crossing the line. The question is about how to write a simple pipe function. I've provided and answer to this question, if you want to know how gulp works, you should go to their repository. Stackoverflow is "only" a Q&A website you know.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27810935
type: UnansweredQuestion
has body: I am using a $modal in angular and, after a simple cycle of creating the modal and dismissing it, the main controller breaks with: TypeError: object is not a function at http://localhost:1337/bower_components/angular/angular.min.js:178:79 at f (http://localhost:1337/bower_components/angular/angular.min.js:195:177) at h.$eval (http://localhost:1337/bower_components/angular/angular.min.js:113:32) at h.$apply (http://localhost:1337/bower_components/angular/angular.min.js:113:310) at HTMLAnchorElement.<anonymous> (http://localhost:1337/bower_components/angular/angular.min.js:195:229) at http://localhost:1337/bower_components/angular/angular.min.js:31:225 at r (http://localhost:1337/bower_components/angular/angular.min.js:7:290) at HTMLAnchorElement.c (http://localhost:1337/bower_components/angular/angular.min.js:31:207) The main controller logic looks like: (function(){ var app = angular.module('butler-user', ['ui.bootstrap']); app.controller('UserController', ['$http', '$log', '$state', '$modal', '$scope', 'UserStatusService', function($http, $log, $state, $modal, $scope, UserStatusService) { var self = this; self.flash = ''; self.users = []; self.newUser = {}; self.editUser = {}; $http.get('/user') .success(function(data, status, headers, config) { self.users = data; }) .error(function(data, status, headers, config){ console.log('error getting data from /user'); $log.error("Error in get from /user: '"+config+"'"); }); var CreateUserModalCtlr = function ($scope, $modalInstance, userForm) { $scope.userForm = {}; $scope.submitted = false; $scope.validateAndCreate = function () { console.log('Entering validateAndCreate()'); $scope.submitted = true; if ($scope.userForm.$valid) { console.log('Creating user with:'+JSON.stringify(self.newUser)); $http.post('/register', self.newUser) .success(function(data, status, headers, config) { console.log('response from /register'+data+' status:'+status) if (status == 200) { self.newUser = {}; $scope.submitted = false; $http.get('/user'…
score: 1
type: Question
tagged with: javascript
has title: Angular JS $modal dismiss causing broken links?
upvote count: 1
favorite count: 0
tagged with: angularjs
answer count: 0
downvote count: 0

http://stackoverflow.com/q/27877864
type: Question
has comment: http://stackoverflow.com/comment/44157589
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: ajax
type: UnansweredQuestion
has title: Capture click event before page load and trigger after DOM ready
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27877918
has comment: http://stackoverflow.com/comment/44157455
has body: I am working on an E-commerce site where on product listing page when the user clicks on Add Cart button product will be added to cart and we are showing an popup box saying the product added... We are using Plugin for showing popup box and data for popup is coming from ajax and java controller. It is working fine well when the entire page loaded successfully. If the user clicks on Add Cart while the page load its showing plain ajax result instead of Popup because the Plugin using for Popup is not available during page load. We tried disabling the Add Cart button till page load but client is not happy with this approach. Code: &lt;--!form for add to cart--&gt; &lt;form submit="addcart()"&gt; &lt;input type="button"&gt;Add Cart&lt;/button&gt; &lt;/form&gt; //JS for show popup and save form data saveform:function{ } displayPopup:function{ } productadd:function{ saveform(); displayPopup(); } $(document).ready(function(){ productadd(); } Is there any workaround to capture the click event during page load and trigger the click event automatically for particular button if user already clicked on. Please suggest me any other solution to show popup properly. Thanks In Advance:)

http://stackoverflow.com/q/27871748
has body: Is this code valid? var myfunc1 = function( parameter ) { parameter = smthg || 0; //code here } var myfunc2 = function( parameter ) { parameter = smthg || 0; //code here } In jQuery, developers use single word parameter like e,t,n many times in their library, so I guess it is safe to use the same parameter again and again?
tagged with: javascript
duplicate of: http://stackoverflow.com/q/500431
type: AnsweredQuestion
has title: Using same parameter for multiple functions
has comment: http://stackoverflow.com/comment/44145999
has comment: http://stackoverflow.com/comment/44146086
type: Question
has answer: http://stackoverflow.com/a/27871813
answer count: 1
score: 0
linked to: http://stackoverflow.com/q/500431
linked to: http://stackoverflow.com/q/518000
accepted answer: http://stackoverflow.com/a/27871813

http://stackoverflow.com/a/37360479
type: Answer
upvote count: 1
has body: Try to put JsDoc "@memberOf" before the inner function. See sample below. You may see "doValidation" and "put" function at outline view under "MyNameSpace" class. For more information about JsDoc, check this out http://kajabity.com/2012/02/how-i-introduced-jsdoc-into-a-javascript-project-and-found-my-eclipse-outline/ . Snapshot from SuiteScript 2.0 RestLet. SuiteScript2.0 is integrated with RequireJS Actual sample here: "use strict"; //Defines that JavaScript code should be executed in "strict mode /** *@NApiVersion 2.x *@NScriptType Restlet */ define( [ 'N/record', 'N/error' ], /** * @param {record} record */ function(record, error) { /** * @memberOf myNameSpace */ function doValidation(args, argNames, methodName) { for (var i = 0; i &lt; args.length; i++) { if (!args[i] &amp;&amp; args[i] !== 0) { throw error.create( { name : 'MISSING_REQ_ARG', message : 'Missing a required argument: [' + argNames[i] + '] for method: ' + methodName }); } } } // Upsert a NetSuite record from request param /** * @memberOf myNameSpace */ function put(context) { doValidation( [ context.recordtype, context.id ], [ 'recordtype', 'id' ], 'PUT'); var rec = record.load( { type : context.recordtype, id : context.id }); for ( var fldName in context) if (context.hasOwnProperty(fldName)) { if (fldName !== 'recordtype' &amp;&amp; fldName !== 'id') { rec.setValue(fldName, context[fldName]); } } rec.save(); return JSON.stringify(rec); } return ( { post : post }); });
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27906867

http://stackoverflow.com/a/27819030
upvote count: 1
has body: Don't know if this will help, it does the same sort of thing and you can style the span as req'd. Been trying a while and the only other way I found that was any cop was adding a style direct to the head like in this thread SO Manipulating psuedo elems, I see from the comments there was a thread posted on this thread but it isn't showing up anymore so not sure if it's the same one. $( "a" ).hover( function() { $( this ).append( $( ">>>" ) ); $( this ).prepend( $( "<<<" ) ); }, function() { $( this ).find( "span:last" ).remove(); $( this ).find( "span:first" ).remove(); } ); Hover Me Hover Me
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27817632
score: 1

http://stackoverflow.com/q/27838545
type: Question
tagged with: javascript
tagged with: parse-cloud-code
score: 0
has title: Parse - Retrieve only items with matching ACL
answer count: 1
has answer: http://stackoverflow.com/a/27838705
accepted answer: http://stackoverflow.com/a/27838705
tagged with: acl
tagged with: parse-platform
has body: Sorry if my title isn't really what I'm after, had a hard time thinking of a good one. I'm fairly (very) new to Parse and here's my (probably quite easy) question: I've got two users: "Test_user_1" and "Test_user_2". I've created an instance (object) of the class "Progression" and also set the ACL using ".setACL(new Parse.ACL(Parse.User.current()));" when creating the object (on the cloud-code), while being logged in with Test_user_1. Meaning only Test_user_1 should have access to this right? I then want to query for the object "Progression" but only want to retrieve the Progression associated with the currently logged in user. So in my scenario above. If Test_user_1 queries for "Progression" I want him to receive one instance (the one "he" created). While Test_user_2 should receive zero. Is there some standard way to achieve this using only ACL and current user? Or do I need to save the userId (of the user) field in the Progression-class and query by this? Thank you!
type: AnsweredQuestion

http://stackoverflow.com/q/27889079
accepted answer: http://stackoverflow.com/a/27889181
type: Question
has comment: http://stackoverflow.com/comment/44179053
has comment: http://stackoverflow.com/comment/44179157
tagged with: javascript
has body: I am developing a website and I am having an issue with a drop down menu that is run via java script, interfering with another one on the same page. I am using a template which can be found here (it is downloaded from bootstrap). I want to make is so that I have two drop down menus, but when I do, the one that is located nearer the top of the code works fine, but the one that is located beneath it, has problems. Basically, when I run the website, the drop down box nearest the top works fine, but when I click, the drop down box bellow, it does not operate itself, instead it opens up the drop down box that is above it. At first I thought it was because they both had the same id so I changed it. When I change the id though, none of them open at all. Here is the code that is for the two drop down menu: Support ProjectSend Email Live Chat Tickets Developers ProjectSend Email Live Chat Tickets The JavaScript is referring to separate files which came from the bootstrap website. I have also removed the second a href="javascript", thinking that it mite carry on from the previous one but that did not work either, I am relatively new to java script, and have some very basic HTML knowledge. Thank you.
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44179227
has comment: http://stackoverflow.com/comment/44179197
has comment: http://stackoverflow.com/comment/44179062
has answer: http://stackoverflow.com/a/27889181
has title: I can not add two drop down menus onto my website without one of them interfering with the other one
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44179089
type: AnsweredQuestion

http://stackoverflow.com/a/46035346
score: 90
has comment: http://stackoverflow.com/comment/103306117
has comment: http://stackoverflow.com/comment/129011599
has comment: http://stackoverflow.com/comment/103303592
has comment: http://stackoverflow.com/comment/129982889
has comment: http://stackoverflow.com/comment/129984229
upvote count: 91
has comment: http://stackoverflow.com/comment/99453261
downvote count: 1
answers question: http://stackoverflow.com/q/27928372
has comment: http://stackoverflow.com/comment/130815818
has comment: http://stackoverflow.com/comment/95173573
has comment: http://stackoverflow.com/comment/122593138
has body: I used Create React App to make a website just now and had the same issue presented here. I use BrowserRouting from the react-router-dom package. I am running on a Nginx server and adding the following to /etc/nginx/yourconfig.conf solved it for me: location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.html break; } } Which corresponds to adding the following to the .htaccess in case you are running Apache: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.html [QSA,L] This also seems to be the solution suggested by Facebook themselves and can be found here.
has comment: http://stackoverflow.com/comment/119637865
has comment: http://stackoverflow.com/comment/102490670
type: Answer

http://stackoverflow.com/q/27853253
has answer: http://stackoverflow.com/a/35145036
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44130064
tagged with: three.js
score: 3
linked to: http://stackoverflow.com/q/10330342
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/40858869
answer count: 2
tagged with: javascript
has body: I am making a 3d bar graph, and I would like my bars to have custom-colored edges. Anyone have any ideas? My shapes are created like this var threeWidth = 400, threeHeight = 300; var viewAngle = 45, aspect = threeWidth / threeHeight, near = 0.1, far = 10000; var $chart = $('#chart'); var renderer = new THREE.WebGLRenderer(); var camera = new THREE.PerspectiveCamera(viewAngle, aspect, near, far); var scene = new THREE.Scene(); scene.add(camera); renderer.setSize(threeWidth, threeHeight); $chart.append(renderer.domElement); var geometry = new THREE.BoxGeometry( 10, 100, 10 ); var material = new THREE.MeshBasicMaterial( {color: 0xCC0000} ); var cube = new THREE.Mesh( geometry, material ); scene.add( cube );
downvote count: 0
has title: In Three.js, how can I give my shapes custom edge colors? ( not just setting wireframe:true )

http://stackoverflow.com/comment/44356047
comment on: http://stackoverflow.com/q/27963933
score: 0
type: Comment
type: QuestionComment
has text: I'd recommend you update your question, there is no mention in it of the things in your comment

http://stackoverflow.com/comment/44126535
type: QuestionComment
comment on: http://stackoverflow.com/q/27862083
score: 0
has text: how big is your data regularly?
type: Comment

http://stackoverflow.com/comment/44050844
comment on: http://stackoverflow.com/q/27821299
score: 0
type: Comment
type: QuestionComment
has text: You can start from this fiddle: http://jsfiddle.net/boldewyn/eywyx6g3/

http://stackoverflow.com/a/30815673
score: 0
has body: wysiwygjs.github.io help to short the syntax issue. Thank you @icke.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/50326279
type: Answer
accepted answer of: http://stackoverflow.com/q/27921394
answers question: http://stackoverflow.com/q/27921394
has comment: http://stackoverflow.com/comment/50329714
has comment: http://stackoverflow.com/comment/50322593

http://stackoverflow.com/q/27898745
has answer: http://stackoverflow.com/a/27899951
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/10657700
has title: How to get the fileName in javascript from input file tag in IE browser
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
has body: I have done this in jQuery, to get filename from input file tag, With jQuery it works perfectly. //jQuery('input[type=file]').on('change', prepareUpload); document.getElementsByTagName('input[type=file]').addEventListener('change',prepareUpload1,true); /* //this works in jQuery function prepareUpload(event) { var files = event.target.files; var fileName = files [0].name alert(fileName); } */ /****Check it here ****/ // it does not work in javascript function prepareUpload1(event) { var files = event.target.files; var fileName = files [0].name alert("fileName 2 : "+fileName); } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="file" /&gt; But I found Event.target does not work in IE, I tried to change it to java script addeventlistener, it did not work. It throws error Uncaught ReferenceError: input is not defined It is working in jQuery but it is not working in JS, Due to IE issue I need to change it to JS. Can some one help
has answer: http://stackoverflow.com/a/27899130
accepted answer: http://stackoverflow.com/a/27899130
type: AnsweredQuestion
tagged with: internet-explorer
score: 7
linked to: http://stackoverflow.com/q/10813494
upvote count: 8
has answer: http://stackoverflow.com/a/49662239
type: Question
possible better answer: http://stackoverflow.com/a/27899951

http://stackoverflow.com/q/27892301
tagged with: javascript
has title: HTML5 input=time won't set via javascript
has comment: http://stackoverflow.com/comment/44185998
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
score: 0
has body: I am having a problem with an HTML5 form field, I need the field (time) to update each second to the current time, the update code is called every second via a setInterval, the HTML5 form element : &lt;form name="process"&gt; &lt;input name="p_time" type="time" value="&lt;?php echo date("H:i:s");?&gt;" /&gt; //... &lt;/form&gt; when I try to update : document.forms.process.p_time.value = current.time.slice(17,25); the display remains at the setting made by PHP, the type of string data is the same format of 00:00:00 but it refuses to budge from that original time. the variable current.time is a string of the UTC format corresponding to : ddd, dd mmm, yyyy hh:mm:ss +00:00 GMT variety. The javascript is a simple routine, it updates a element in the full version current = { now:function(){ return new Date(); }, time:0, tick:function(){ current.time = current.now().toUTCString(); document.forms.process.p_time.value = current.time.slice(17,25); current.clock(); }, clock:function(){ current.target.innerHTML = current.time.slice(0,25); }, auto:setInterval(current.tick,1000) } What I don't want to have to do is to have the page refreshed by a page refresh.
has answer: http://stackoverflow.com/a/27893489
type: Question
has comment: http://stackoverflow.com/comment/44187498

http://stackoverflow.com/comment/44225358
type: Comment
type: QuestionComment
has text: Since the server can't send DOM elements to the browser (only text that the browser will read as tagsoup), I fail to understand the question since it almost seems as if you want a 'regular' php(etc.) site.. Other than that, you might want to look into [DocumentFragment](http://ejohn.org/blog/dom-documentfragments/) and/or cloning nodes including their children (but not attributes): `cloneNode(true);`. You could send raw html-strings over AJAX/JSON to prevent page-reload. Is this what you are after? Also, you could use a different processing thread (webworker) to generate html and pass it back.
comment on: http://stackoverflow.com/q/27912943
score: 0

http://stackoverflow.com/a/27892162
answers question: http://stackoverflow.com/q/27892069
has comment: http://stackoverflow.com/comment/44209803
has comment: http://stackoverflow.com/comment/44207591
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44208345
has comment: http://stackoverflow.com/comment/44202224
has body: change jQuery to jquery wp_enqueue_script('custom-script', get_stylesheet_directory_uri().'/custom-script.js', array('jquery'),'', false);
accepted answer of: http://stackoverflow.com/q/27892069
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44207184
has comment: http://stackoverflow.com/comment/44208597

http://stackoverflow.com/comment/44216726
type: Comment
has text: thanks, the last option didn't seem to work but the first option seems interesting although I fixed the issue with @Kalman-Hazins answer which seems easier. Thanks!
comment on: http://stackoverflow.com/a/27908565
score: 0
type: AnswerComment

http://stackoverflow.com/q/27849805
has title: How do I get access to my bundle?
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44103722
has comment: http://stackoverflow.com/comment/44104033
tagged with: javascript
has comment: http://stackoverflow.com/comment/44103639
has comment: http://stackoverflow.com/comment/44104086
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44103710
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/27850737
has comment: http://stackoverflow.com/comment/44103784
has body: I have a script that I am exporting a single variable: module.exports = { hello: "world" }; I am bundling with browserify and then consuming the bundle in my index.html Here is my html file: Hello World I am getting that my variable hello is undefined. I can see the bundle.js with my dev tools, so I know it is there. Why does my script in the body not have access to the variables that the bundle.js is exporting? What am I missing here?
has comment: http://stackoverflow.com/comment/44103746
has comment: http://stackoverflow.com/comment/44103974
has comment: http://stackoverflow.com/comment/44103882

http://stackoverflow.com/q/27921349
tagged with: ng-options
tagged with: javascript
has body: I have the ngoptions array bound asynchronously inside my controller. When I create a select with it, there is an empty option being created. How do I avoid? My controller code Employees.query(function(employees){ $scope.employees = employees }); How do I avoid empty select being created? I tried ng-init but it didn't work
score: 0
has answer: http://stackoverflow.com/a/27921583
has title: Empty option as default select when ngoptions data is bound asynchronously
has answer: http://stackoverflow.com/a/27921653
possible better answer: http://stackoverflow.com/a/27921583
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44248583
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27921653
type: Question
answer count: 2

http://stackoverflow.com/q/27861253
favorite count: 0
has comment: http://stackoverflow.com/comment/44124932
has comment: http://stackoverflow.com/comment/44125107
has body: I would like to scrape data from my bank account, for my personal use. The script works for another pages but I do no receive any data when I request it. I have tried with PhantomJs and CasperJs. var casper = require('casper').create(); casper.start('https://google.com', function() { this.echo("title:" + this.getTitle()); }); casper.thenOpen('https://www.creditmutuel.fr/cma/fr/banques/particuliers/index.html', function() { this.echo("then title: " + this.getTitle()); }); casper.thenOpen('https://yahoo.com', function() { this.echo("then title: " + this.getTitle()); }); casper.run(); The output of this script: title:Google then title: Google then title: Yahoo France
tagged with: casperjs
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44124791
has comment: http://stackoverflow.com/comment/44124965
tagged with: node.js
has comment: http://stackoverflow.com/comment/44124984
has comment: http://stackoverflow.com/comment/44125036
has title: Requests to my bank website are not handled
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/44125184
downvote count: 0
has comment: http://stackoverflow.com/comment/44124970
duplicate of: http://stackoverflow.com/q/26415188
score: 1
linked to: http://stackoverflow.com/q/26415188
type: Question
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44124881

http://stackoverflow.com/a/29527647
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27909353
has body: Use Object.create() to achieve classical inheritance. function Robot(){ } function UltraRobot(){ Robot.call(this); } UltraRobot.prototype = Object.create(Robot.prototype); var robot = new Robot(); var guard = new UltraRobot(); alert(guard instanceof Robot); // true, through Inheritance
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44279863
type: Comment
type: QuestionComment
has text: can you put some example values in, rather than just empty strings? the issue is probably that they are strings, rather than numbers, so "9" is greater than "11". Either store them as numbers or `parseInt()` them each time
comment on: http://stackoverflow.com/q/27942074
score: 0

http://stackoverflow.com/comment/44247236
comment on: http://stackoverflow.com/q/27925073
type: Comment
score: 2
has text: Sidos what do you mean by duplicates ? based on name or year ?
type: QuestionComment

http://stackoverflow.com/q/27843436
linked to: http://stackoverflow.com/q/27858568
upvote count: 1
answer count: 1
has body: I've recently discovered the whole debate regarding new vs. Object.create(). Coming from doing a ton of OO with new I've learned certain patterns of how to solve my problems. With the intent of learning something different I thought I'd rewrite some simple "classical OO" code to the Object.create() style. I've run into the problem of nested objects, e.g. new function Base() { this.name = { first: '', last: '' }; } var a = new Base(); var b = new Base(); a.name.first = 'Sally'; a.name.last = 'Broker'; b.name.first = 'Peter'; b.name.last = 'Davis'; document.write('first:', a.name.first, " last:", a.name.last); // Outputs { first: 'Sally', last: 'Broker' } document.write("&lt;br&gt;"); document.write('first:', b.name.first, " last:", b.name.last); // Outputs { first: 'Peter', last: 'Davis' } Object.create() var base = { name: { first: '', last: '' } }; var a = Object.create(base); var b = Object.create(base); a.name.first = 'Sally'; a.name.last = 'Broker'; b.name.first = 'Peter'; b.name.last = 'Davis'; document.write('first:', a.name.first, " last:", a.name.last); // Outputs { first: 'Sally', last: 'Broker' } document.write("&lt;br&gt;"); document.write('first:', b.name.first, " last:", b.name.last); // Outputs { first: 'Peter', last: 'Davis' } I understand why the assignments to the nested objects don't work the same, and also that my thinking is based on coding patterns used in "classical OO". I'm trying to learn how I'm supposed think, design wise, when attacking something where I'd have gone for nested objects, but in terms of best practices for Object.create().
has answer: http://stackoverflow.com/a/27843597
has comment: http://stackoverflow.com/comment/44090666
tagged with: javascript
has comment: http://stackoverflow.com/comment/44119337
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44090708
score: 1
accepted answer: http://stackoverflow.com/a/27843597
favorite count: 0
type: Question
has title: Transitioning from new to Object.create()
has comment: http://stackoverflow.com/comment/44090649

http://stackoverflow.com/q/27865472
tagged with: http://stackoverflow.com/tag/html
tagged with: dictionary
has answer: http://stackoverflow.com/a/27866119
has body: Hi guys i have a problem with that code: $("#gotobikeblue").click(function(){ $("#bikeblue").show(); $("#motor").hide(); $("#wheel").hide(); return false; }); $("#gotomotor").click(function(){ $("#bikeblue").hide(); $("#motor").show(); $("#wheel").hide(); return false; }); $("#gotowheel").click(function(){ $("#bikeblue").hide(); $("#motor").hide(); $("#wheel").show(); return false; }); #bikeblue { display:none; } #wheel { display:none; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;img src="http://i62.tinypic.com/2l8jmzo.jpg" alt="" usemap="#motor" id="motor"/&gt; &lt;map id="motor" name="motor"&gt; &lt;area id="gotobikeblue" alt="" title="" href="" shape="rect" coords="1135,13,1261,123" style="outline:none;" target="_self" /&gt; &lt;area id="gotowheel" alt="" title="" href="" shape="rect" coords="1110,874,1265,997" style="outline:none;" target="_self" /&gt; &lt;/map&gt; &lt;img src="http://i62.tinypic.com/14kv6zo.jpg" alt="" usemap="#bikeblue" id="bikeblue"/&gt; &lt;map id="bikeblue" name="bikeblue"&gt; &lt;area id="gotomotor" alt="" title="" href="" shape="rect" coords="10,9,103,92" style="outline:none;" target="_self" /&gt; &lt;area id="gotowheel" alt="" title="" href="" shape="rect" coords="899,666,1010,756" style="outline:none;" target="_self" /&gt; &lt;/map&gt; &lt;img src="http://i58.tinypic.com/2qvw12x.jpg" alt="" usemap="#wheel" id="wheel"/&gt; &lt;map id="wheel" name="wheel"&gt; &lt;area id="gotomotor" alt="" title="" href="" shape="rect" coords="13,12,164,109" style="outline:none;" target="_self" /&gt; &lt;area id="gotobikeblue" alt="" title="" href="" shape="rect" coords="35,130,127,210" style="outline:none;" target="_self" /&gt; &lt;/map&gt; Why the page is reloaded after 2-3 clicks?? I need the page does not reload and clicking on the thumbnails let me see the corresponding images. If, however, use this code with two images , I get no problem . The problem comes when the images are more than …
type: AnsweredQuestion
tagged with: imagemap
tagged with: image
has comment: http://stackoverflow.com/comment/44134740
type: Question
accepted answer: http://stackoverflow.com/a/27866119
answer count: 1
has title: Image map onclick problems
tagged with: javascript
score: 0

http://stackoverflow.com/comment/44133588
type: QuestionComment
comment on: http://stackoverflow.com/q/27865368
has text: its closed in my main code and it dosnt work
score: 0
type: Comment

http://stackoverflow.com/comment/44229972
type: AnswerComment
type: Comment
has text: Any errors in console? **Remember live is not available in jquery 1.11**. *You must need to use on()* Also wrap your code in document.ready()
comment on: http://stackoverflow.com/a/27915271
score: 0

http://stackoverflow.com/q/27889909
tagged with: textarea
has title: HTML,PHP. Change text in textarea cause of checked(change) radio button
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: Hello I want change text in textarea on click(change) radio button. I have own database clanok(article) where attributes are nadpis(title) and text. Thanks. $result = mysqli_query($con,"SELECT * FROM clanok ORDER BY nadpis"); while($row = mysqli_fetch_array($result)) { ?&gt; &lt;input type="radio" name="nadpis" value="&lt;?php echo $row['nadpis']; ?&gt; "&gt; &lt;?php echo $row['nadpis']; echo "&lt;br&gt;"; } ?&gt; &lt;textarea name="text" cols="30" rows="5" &gt; &lt;?php echo $row['text']; ?&gt; &lt;/textarea&gt; &lt;br&gt; &lt;input type="submit" value="Odoslať článok"&gt;
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/5099841
tagged with: php
has comment: http://stackoverflow.com/comment/44180798
has answer: http://stackoverflow.com/a/27890893
type: Question
tagged with: radio-button

http://stackoverflow.com/comment/44171648
has text: Can you please come up with a simple example?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27885164

http://stackoverflow.com/a/27806285
accepted answer of: http://stackoverflow.com/q/27804441
has body: Remove the positional operator($) from the query parameter of the update function. Meteor.users.update( { _id:options.userId, 'buyer.boards.title':options.boardTitle }, { $push: { 'buyer.boards.$.idArr':options.newId } } ); From the docs: db.collection.update( { &lt;array&gt;: value ... }, { &lt;update operator&gt;: { "&lt;array&gt;.$" : value } } ) The positional operator should be used in the update parameter and not in the query parameter. This updates only the first boards object that has the matching title.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27804441
type: Answer
score: 3
downvote count: 0
upvote count: 3

http://stackoverflow.com/comment/44211940
type: Comment
type: QuestionComment
has text: @Quentin when I use prop/ attribute ! I check that check-box, when I see this element using firebug, it not add checked=true attribute in that element! hope u understand !!
score: 0
comment on: http://stackoverflow.com/q/27905978

http://stackoverflow.com/comment/44106898
score: 0
has text: @dandavis I stand corrected - I'd never used a "unary" operator before. Why didn't you add an answer?
comment on: http://stackoverflow.com/a/27850864
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44334369
type: Comment
comment on: http://stackoverflow.com/a/27965188
score: 1
has text: I liked the info that there is no requirement for SCE here +1 :)
type: AnswerComment

http://stackoverflow.com/comment/44220315
type: Comment
type: QuestionComment
has text: Your `.add-genre-filter` click can simply be : `if(genreLimit && !$('.dropdown .cancel').is(':animated')) $(this).parent().append(options) , genreLimit--;`
comment on: http://stackoverflow.com/q/27910287
score: 0

http://stackoverflow.com/q/27822571
has comment: http://stackoverflow.com/comment/44051956
tagged with: php
has comment: http://stackoverflow.com/comment/44051105
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44051530
tagged with: wordpress
has comment: http://stackoverflow.com/comment/44051618
has comment: http://stackoverflow.com/comment/44051603
type: Question
has comment: http://stackoverflow.com/comment/44054542
has comment: http://stackoverflow.com/comment/44051409
has comment: http://stackoverflow.com/comment/44051174
has body: My javascript is not popping up in my static home page because the forward slash is gone right after the get_stylesheet_directory_uri() even if I have correctly placed it in my functions.php file. Whenever I visit another page of my site, the forward slash is present and the alert popped up in that page. Here is my code. Functions.php <?php function custom_javascript(){ wp_enqueue_script( 'custom js', get_stylesheet_directory_uri() .'/js/custom.js' ); } add_action( 'wp_enqueue_scripts', 'custom_javascript' ); my-static-homepage-page-source (forward slash is not present) my-other-page-page-source (forward slash is present)
tagged with: javascript
has title: Why wordpress directory slash not present in static home page while present in other pages?
has comment: http://stackoverflow.com/comment/44051228
has comment: http://stackoverflow.com/comment/44051875
score: 0
tagged with: jquery

http://stackoverflow.com/comment/44174782
comment on: http://stackoverflow.com/q/27881727
type: Comment
type: QuestionComment
has text: Thank you Barmar! You solved my issue.
score: 0

http://stackoverflow.com/a/27908108
type: Answer
accepted answer of: http://stackoverflow.com/q/27903004
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44218202
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27903004
has body: To add on to @XGreen's answer, try inserting the following into waveform.coffee after line 19: # High DPI Canvas devicePixelRatio = window.devicePixelRatio || 1 backingStoreRatio = @context.webkitBackingStorePixelRatio || @context.mozBackingStorePixelRatio || @context.msBackingStorePixelRatio || @context.oBackingStorePixelRatio || @context.backingStorePixelRatio || 1 @ratio = devicePixelRatio / backingStoreRatio if devicePixelRatio isnt backingStoreRatio @canvas.width = @ratio * @width @canvas.height = @ratio * @height @canvas.style.width = "#{@width}px" @canvas.style.height = "#{@height}px" @context.scale @ratio, @ratio I've created a pull request to merge this change.

http://stackoverflow.com/comment/44096429
comment on: http://stackoverflow.com/q/27846263
score: 1
has text: Any way you could throw this in a jsfiddle with your html so we can see it working and better understand what you need?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44308122
score: 0
type: Comment
type: AnswerComment
has text: Charles — That's some javascript leveraging the jQuery library. You could write it in pure javascript too, but this is a little easier. This would have to be in an external javascript file that's linked to in every file you want the URL to be replaced in. Scott — Great minds and all!
comment on: http://stackoverflow.com/a/27956621

http://stackoverflow.com/comment/44177313
type: QuestionComment
comment on: http://stackoverflow.com/q/27881445
score: 0
has text: As a workaround, since you have access to the PHP code, instead of serving a JSON, serve a HTML, and request with URL GET parameters.
type: Comment

http://stackoverflow.com/comment/44172635
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27885670
has text: var jQuery = require('jQuery'); Would you suggest adding this inside of the client.addListener, I added it at the top of the script just like the others

http://stackoverflow.com/comment/44099383
has text: Have you tried `$(document).ready()` ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27847851
score: 1

http://stackoverflow.com/comment/57000846
comment on: http://stackoverflow.com/q/27896791
has text: Where can I set the CORS property in azure blob dashboard? Please help.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27958493
has answer: http://stackoverflow.com/a/27970728
tagged with: setfocus
tagged with: dynamics-crm-2013
type: Question
has title: How to set focus for a composite field in dynamics crm 2013?
score: 0
answer count: 2
has body: I'm trying to set focus on the address1_postalcode field during the contact form load event. However when the script is run it throws an error. Code: Xrm.Page.ui.controls.get('address1_postalcode').setFocus(); And here is the error message: I want to seek your kind help/suggestion in this manner to resolve it.
tagged with: javascript
has answer: http://stackoverflow.com/a/28846189
type: UnansweredQuestion

http://stackoverflow.com/q/27844724
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/27844878
score: 0
has body: I am trying to write a script that when you click the a tags it will add the class 'menu-toc-current' to the relevant li elements. (Obviously remove this class when the next item is clicked). So click the link cats it adds the class to the li cats etc. My code so far is ... Cat Dog Bird Show me Cats Show me Dogs Show me Birds The JQuery I have so far is ... $('a.alive').click( function(){ $('ul#menu-toc').toggleClass('menu-toc-current'); });
tagged with: jquery
has answer: http://stackoverflow.com/a/27844922
has title: How do I add a class to an li using a JQuery array?
has answer: http://stackoverflow.com/a/27845153
possible better answer: http://stackoverflow.com/a/27844878
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27844865
accepted answer: http://stackoverflow.com/a/27844865
type: Question

http://stackoverflow.com/comment/44067476
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27830350
type: Comment
has text: if i want to add another class like for example when i click `.buton` then this button autmatically added `.up{z-index:999;}` like before click ` Click Here ` after click ` Click Here `

http://stackoverflow.com/comment/44175050
comment on: http://stackoverflow.com/q/27886889
type: Comment
type: QuestionComment
has text: you can use datevalues.split(',').join();
score: 0

http://stackoverflow.com/a/27960456
answers question: http://stackoverflow.com/q/27959971
has body: It might help you!! Your HTML code-sample Your AngularJs code-sample var myApp = angular.module('myApp',[]); angular.module('myApp') .controller('myCtrl', function($scope){ $scope.subscriptions = [ { currency: { title: 'Euro', symbol: '€' }, licenses: [ { nrOfLicenses: 5, price: 500 }, { nrOfLicenses: 10, price: 750 } ] }, { currency: { title: 'SEK', symbol: 'kr' }, licenses: [ { nrOfLicenses: 5, price: 5000 }, { nrOfLicenses: 10, price: 7500 } ] }, ] $scope.selectedSubscription = $scope.subscriptions[0]; });
type: Answer
score: 0

http://stackoverflow.com/q/27821895
tagged with: d3.js
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
downvote count: 0
tagged with: javascript
has title: How to give the same boundary to multiple draggable objects?
has body: I wish to set a boundary for two rectangles in my SVG. I found this example: http://bl.ocks.org/mbostock/1557377 In the example the boundaries get worked out from the position of the object that is dragged. Every circle in the example can only move a certain distance from where it started. What I wish to do is to create one drag function and use it on multiple shapes. This drag function will stop the shapes from going out of a certain area. For example: I have a rectangle on the left side of the screen and one on the right but I don't want any of them to be able to go off screen. I started working on this but figured out this worked with regards to the position of the object getting dragged. So this works for the left hand rectangle but the right hand rectangle can go offscreen to the right but only so far to the left .on("drag", function(d) { g = this; translate = d3.transform(g.getAttribute("transform")).translate; x = d3.event.dx + translate[0], y = d3.event.dy + translate[1]; if(x&lt;-10){x=-10} if(x&gt;width-10){width-10} if(y&lt;-10){y=-10} if(y&gt;height-10){y=height-10} d3.select(g).attr("transform", "translate(" + x + "," + y + ")"); d3.event.sourceEvent.stopPropagation(); My question is: how do I impose the same boundary on anything that is dragged? i.e I don't want it to go off screen. I have variables width and height which are screen width and screen height respectively
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
answer count: 0

http://stackoverflow.com/comment/44259946
score: 0
type: Comment
type: QuestionComment
has text: @PM77-1 Unfortunately, yes, and was just reading about them. I'm completely new with PHP, so I still haven't quite figured out how to update (for example) the above code to prevent this. Any suggestions would be appreciated.
comment on: http://stackoverflow.com/q/27931177

http://stackoverflow.com/comment/44291350
has text: You've posted one ` ` in your question. I also see no element with the ID mythbuster to match `#mythbuster`. Post the rendered HTML as the PHP seems irrelevant here.
score: 4
type: QuestionComment
comment on: http://stackoverflow.com/q/27948230
type: Comment

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/27899025

http://stackoverflow.com/q/27810429
has comment: http://stackoverflow.com/comment/44029851
answer count: 0
type: UnansweredQuestion
tagged with: php
has body: i have created a native javascript code (w/o jquery) to upload using php for server side, it seems that everything is ok and going fine, but when i selected 10 or more images, not all of them are uploaded some images are having problem, here is my javascript so far: var uploadevent = function(event) { event.preventDefault(); event.stopPropagation(); var xhr = new XMLHttpRequest(); var data = new FormData(); for(var i = 0; i &lt; images.files.length; ++i) { data.append('images[]', images.files[i]); } data.append('EmailAd', EmailAd); data.append('UserID', UserID); data.append('Studentnumber', Studentnumber); data.append('album_name', document.getElementById('hidden_album_name').value); var ul_album_thumbnails = document.getElementById('ul_album_thumbnails'); var rand = Math.random().toString().split('.'); var str = rand[1]; // need this to generate unique id var newli = document.createElement('li'); newli.setAttribute('id', str); var display = document.createElement('div'); // div element that handles preview display.style.position = "relative"; display.style.height = "191px"; display.style.width = "180px"; display.style.cssFloat = "right"; display.style.border = "1px solid #a4a4a4"; display.style.background = "#fff"; display.style.zIndex = '998'; // this thumbnail container should be on the top $(display).append("&lt;progress id='progressBar' style='border:1px solid #a4a4a4;position:absolute;bottom:0px;width:178px;z-index:1' value='0' max='100'&gt;&lt;/progress&gt;"); $(display).append("&lt;div id='progressStatus' style='position:absolute;bottom:0px;width:178px;z-index:1;text-align:right;background:transparent'&gt;&lt;/div&gt;"); newli.appendChild(display); ul_album_thumbnails.insertBefore(newli, ul_album_thumbnails.childNodes[1]); xhr.upload.addEventListener('progress', function(event) { var percent = (event.loaded / event.total) * 100; document.getElementById('progressBar').value = Math.round(percent); document.getElementById('progressStatus').innerHTML = Math.roun…
has comment: http://stackoverflow.com/comment/44113755
type: Question
has comment: http://stackoverflow.com/comment/44029688
has comment: http://stackoverflow.com/comment/44031971
tagged with: javascript
has title: Multiple image upload errror on PHP using javascript
score: 0

http://stackoverflow.com/q/27893080
accepted answer: http://stackoverflow.com/a/27893963
score: 2
tagged with: cordova
upvote count: 2
tagged with: facebook
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27893963
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Phonegap/Cordova facebook login not working when already connected
has body: I'm developing and HTML5/CSS/Javascript PhoneGap app that should work as native app for android and iOS and is compiled using the PhoneGap Build service. The app uses Facebook login. The login is done through the JAVASCRIPT Api. So I have this simple HTML page: The above code works well when the user hasn't authenticated the app before. So when a user clicks the login button and the user accepts the login, the user id is returned successfully and the session will stick well when the use closes and reopens the app. The problem lies when the user uninstalls the app and reinstalls again. When they click the login button, the login dialog will open quickly and close again as the user is already authenticated in the app. The user id and access token should return in the response like the regular javascript api of Facebook. Instead the second function which is failure will be returned with the following error: session was closed and was not closed normally I tried to logout the user but I got the following error:there is no session initiated... I have added the following to the config.xml file: <gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.9.0"> </gap:plugin> Currently the Facebook app has only Website as platform. Do I need to add Android as platform while I'm using the javascript API for authentication? Is there any solution for this?
tagged with: android
possible better answer: http://stackoverflow.com/a/40079287
has answer: http://stackoverflow.com/a/40079287

http://stackoverflow.com/q/27954941
has title: Semantic-UI Modal causes my element to disappear from the DOM after closing
tagged with: semantic-ui
has answer: http://stackoverflow.com/a/46185931
score: 2
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44304914
type: Question
has comment: http://stackoverflow.com/comment/44305045
answer count: 1
downvote count: 0
has body: Really simple question here...note the code snippet first: $('#gasmask').on('click', function(){ $('#gasmask').modal('show'); }); Clicking the element with an ID of gasmask causes the Semantic-UI modal to show, quite nicely. The issue is that after I click away, causing the modal to disappear, so the does the original element... Before click: &lt;div class="content"&gt; &lt;img alt="Gasmask" class="fademein3 ui image" id="gasmask" src="https://s3.amazonaws.com/verumdesigns/gasmask.jpg" style="visibility: inherit; opacity: 1;"&gt; &lt;/div&gt; After modal closes: &lt;div class="content"&gt; &lt;/div&gt; It just straight up vanishes from the DOM. What's the dealio?
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/44305522
has text: https://github.com/angular-ui/ui-router - spend the time, you'll thank me later
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27955242
score: 1

wms
tag name: wms
tags question: http://stackoverflow.com/q/27891664
type: Tag

http://stackoverflow.com/comment/44163852
type: AnswerComment
score: 0
type: Comment
has text: ok.that means the div is resizing but the JsPlumb chart is not resizing. Can you create a fiddle of same problem.so that i can figure out it whats going on there.
comment on: http://stackoverflow.com/a/27880843

http://stackoverflow.com/q/27855806
type: Question
tagged with: javascript
tagged with: phonegap-plugins
downvote count: 0
score: 1
favorite count: 0
has body: I am using Phonegap Phonegap-SMS-reception-plugin first time and faceing some problem while running the app. I have placed SmsInboxPlugin.java and SmsReciever.java inside src package org.apache.cordova.plugin . Placed SmsInboxPlugin.js in assets/www folder. Inside config.xml <plugin name="SmsInboxPlugin" value="org.apache.cordova.plugin.SmsInboxPlugin"/> Inside index.html PhoneGap SMS Testing SMS Feature in Phonegap Start Receiving I have called this index.html from MainActivity.java extending DroidGap by saying super.loadUrl("file:///android_asset/www/index.html"). if any body can explain which path we have to mention in argument to require(), either .java path or .js path.
type: UnansweredQuestion
tagged with: android
tagged with: cordova
answer count: 0
has title: uncaught module cordova/plugin/smsinboxplugin not found (PhoneGap)
upvote count: 1

http://stackoverflow.com/a/28824513
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45920021
has comment: http://stackoverflow.com/comment/63336954
accepted answer of: http://stackoverflow.com/q/27815363
answers question: http://stackoverflow.com/q/27815363
type: AcceptedAnswer
has body: There are many inconsistencies. See https://github.com/guardian/scribe/blob/master/BROWSERINCONSISTENCIES.md for a fairly comprehensive list. I think document.queryCommandState(command) is actually an Internet Explorer thing. Irrespective of its origin, why do browser makers copy features with such poor fidelity? I don't know. Perhaps you should ask them. As for checking for sub/super in a browser independent way, you'll have to find the parent node and examine the tag.

http://stackoverflow.com/comment/44125287
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27861424
has text: @NarekMamikonyan somethink like that: `$.each($scope.toDel, function(ind, el) { if (!(el.Id in $scope.articles)) console.log(el); });`

http://stackoverflow.com/comment/44165176
score: 1
comment on: http://stackoverflow.com/q/27881773
type: Comment
type: QuestionComment
has text: Are you getting errors in the Javascript console? Before you come here, that should always be the first place you check.

http://stackoverflow.com/a/27963704
has comment: http://stackoverflow.com/comment/44357428
score: 1
downvote count: 0
has body: What you are doing is declaring an anonymous function and then calling it with a parameter called c and assigning it to a variable also called c, which is very confusing :-) Renaming variables this is what you have: var result=(function (input_parameter){...} (parameter_used_to_call_my_function)); The final (c) you ask about is the parameter to call the function. It's easier to see if you use a longer syntax: var my_function=function(input_parameter){...}; var result=my_function(result); It is also worth noting that you are calling my_function using result (although you called it c) as a parameter, which is also the name of the variable you just created to store the return value of the function. JS goes along with this because it is not strict with how you handle variables, but this is a confusing way to write code. You are declaring a variable and passing it (the variable with that name, which at that point should not exist) as a parameter to your function just in case it was declared earlier (and taking care of that case inside the function, which at least is consistent). What happens inside my_function is that you check is your parameter had a previous value (what I explained if the previous paragraph); if it was undefined you initialize it to an empty object. Then you append the a function to input_parameter and return it. I don't know if there is a name for this type of programming, but using the same variable name for different things doesn't look like a good idea :-)
answers question: http://stackoverflow.com/q/27960682
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44323262
has comment: http://stackoverflow.com/comment/44357372

http://stackoverflow.com/a/27828378
has comment: http://stackoverflow.com/comment/44062973
accepted answer of: http://stackoverflow.com/q/27827868
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27827868
score: 1
has body: This is not an elegant solution but it will work for your idea of loading in multiple instances of the video tag. In HTML put 5 video players. In CSS hide 4 of them (display:none); In JS make a global var array of the video objects var v=new Array; v[1] = document.getElementById('player1'); ... v[5] = document.getElementById('player5'); On players 1-4 add event listeners for the "end" event which calls a next function. next function(n){ v[n+].style.display='block'; v[n].style.display='none'; v[n+1].play() } }

http://stackoverflow.com/comment/44053969
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27823420
type: Comment
has text: @PSL Bingo! It was an array, even though `angular.isObject()` returned `true`. Please enter this as an answer and I will mark it as CORRECT!!

http://stackoverflow.com/q/27841739
has answer: http://stackoverflow.com/a/27841840
tagged with: php
has comment: http://stackoverflow.com/comment/44087313
score: 0
has answer: http://stackoverflow.com/a/27841906
answer count: 3
tagged with: mysql
tagged with: forms
tagged with: javascript
tagged with: populate
has comment: http://stackoverflow.com/comment/44093352
has comment: http://stackoverflow.com/comment/44093862
has comment: http://stackoverflow.com/comment/44095086
has title: How do I pull data from my MySQL database to pre populate a form on page load?
accepted answer: http://stackoverflow.com/a/27841906
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44088222
type: Question
possible better answer: http://stackoverflow.com/a/27841840
has answer: http://stackoverflow.com/a/27842087
has body: I have a site where users can register and then login with their registration information which takes them to a page with a form on it and I want to be able to pre populate certain parts of the form with data from when they registered/logged in. I assumed since the login function uses session data that I could locate their email address and identify the row by said email address and then pull the data in the fields associated with that row. I can't find an example of how this works. Once I am able to pull the data and populate the fields, the goal is to have 2 buttons; one to save and update the database so the user can return and finish the form later and the other button becomes active once all the fields are filled in and then submits the data to be printed on a confirmation page and also adds a value to the database field indicating that the form has been completed so when the user logs back in they will see that the form has been completed and is no longer able to be submitted. I tried to populate one of the fields as a test by adding a value string to it but I cant seem to find an example anywhere to show how this works. Here is my form: &lt;div style="float:left; width:450px;"&gt; &lt;div style="float:left; padding-right:7px; padding-bottom:7px; width:35px;"&gt;&amp;nbsp;&lt;/div&gt; &lt;div style="float:left; padding-right:7px; padding-bottom:7px; width:187px;"&gt;SET PART #&lt;/div&gt; &lt;div style="float:left; padding-right:7px; padding-bottom:7px; width:192px;"&gt;INSTALL DATE&lt;/div&gt; &lt;div style="float:left; padding-right:7px; padding-bottom:7px; width:35px;"&gt;1.&lt;/div&gt; &lt;div style="float:left; padding-right:7px; padding-bottom:7px; width:187px;"&gt;&lt;input type="text" id="part1" value="&lt;?php echo $_GET['first_name'];?&gt;"&gt; &lt;/div&gt; &lt;div style="float:left; padding-right:7px; padding-bottom:7px; width:192px;"&gt;&lt;input type="text" id="part1-install-date"&gt;&lt;/div&gt; &lt;div style="float:left; padding-right:7px; paddi…
has comment: http://stackoverflow.com/comment/44094611
has comment: http://stackoverflow.com/comment/44090629

http://stackoverflow.com/q/27886614
tagged with: jquery
tagged with: ajax
score: 0
has title: Storing ajax jquery into a variable and acessing it with the variable
favorite count: 0
has answer: http://stackoverflow.com/a/27886658
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has body: Can I call jquery ajax from a variable like this ? var save = $.ajax({ type: "POST", dataType: 'json', url: "functions/ajaxInsertCheck.php", data: dataString, cache: false, success: function(response){ alert(response.a); } // call ajax jquery save How can I call that request like its a function? Can anyone help?
has answer: http://stackoverflow.com/a/27886662
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/a/27948273
upvote count: 5
answers question: http://stackoverflow.com/q/27948230
type: Answer
downvote count: 0
has body: I am assuming this &lt;li&gt; is the pattern for all. Given this: id is only allowed to be used one time ... either: Change the id for each type (i.e. id="Question1", id="Question2"), or Use classes (i.e. class="Question") which will allow for selecting multiple elements at one time. While I referenced id="Question" above, this pattern should remain true. An id must be unique; this applies for: question, statement, true, false, button, button2, and any other id's you have listed.
score: 5
has comment: http://stackoverflow.com/comment/44291441

http://stackoverflow.com/q/27960282
tagged with: logic
tagged with: while-loop
has title: JavaScript while loop each data one by one passing into another function
accepted answer: http://stackoverflow.com/a/27960928
has comment: http://stackoverflow.com/comment/44314157
tagged with: maps
has comment: http://stackoverflow.com/comment/44314218
possible better answer: http://stackoverflow.com/a/27960483
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27960483
has body: I was having some logic problem with the while loop in JavaScript. So basically I am trying to loop a list of coordinate, at each coordinate, I am executing the moveNext() which will plot a marker and loop until the while loop ends. Here is the code: var k = 1; while(k &lt; pointArr.length){ var coordx = pointArr[k].x; var coordy = pointArr[k].y; window.setTimeout(function(){ moveNext(coordx, coordy, k); },500); k++; } And the moveNext() which plot a marker onto the map if the parameter k is larger than global counter variable: var counter = 0; function moveNext(coordx, coordy, k){ if(k &gt; counter){ console.log(coordx); console.log(coordy); map.graphics.clear(); var point = new esri.geometry.Point({ "x": coordx, "y": coordy, "spatialReference": { "wkid": 3414 } }); var symbol = new esri.symbol.PictureMarkerSymbol('img/transportation/currentLoc.GIF', 30, 30); var PointGraphic = new esri.Graphic(point, symbol); map.graphics.add(PointGraphic); var graphic = PointGraphic; graphic.setSymbol(symbol); map.graphics.add(graphic); counter++; } } However, with these codes, it does not execute the setTimeout point by point plotting marker onto the map. Instead, it loops all the way until the end of the while loop and plot the last marker there. Any guides? Thanks in advance.
has answer: http://stackoverflow.com/a/27960928
type: Question
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/111102
tagged with: javascript

http://stackoverflow.com/a/49358568
has comment: http://stackoverflow.com/comment/85777474
has comment: http://stackoverflow.com/comment/85717669
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27939515
has comment: http://stackoverflow.com/comment/85777865
has body: import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import org.xhtmlrenderer.pdf.ITextRenderer; import com.lowagie.text.DocumentException; public class GenratePdf { public static void generatePDF(String inputHtmlPath, String outputPdfPath) { try { String url = new File(inputHtmlPath).toURI().toURL().toString(); System.out.println("URL: " + url); OutputStream out = new FileOutputStream(outputPdfPath); //Flying Saucer part ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(url); renderer.layout(); renderer.createPDF(out); out.close(); } catch (DocumentException | IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main(String[] args) { String inputFile = "D:\\mailPages\\pdfTest.jsp"; String outputFile = "D:/mailPages/testpdf.pdf"; generatePDF(inputFile, outputFile); System.out.println("Done!"); } }

http://stackoverflow.com/a/27901542
score: 2
downvote count: 0
upvote count: 2
has body: To wrap all p element inside details, you can do like this: $('details p').wrapAll('&lt;div class="details_content" /&gt;'); With your code, that you want .first-child div to be the first-child not last, you should use prepend instead of append: $('&lt;div class="first-child"&gt;' + sum +'&lt;/div&gt;').prependTo($('details'));
answers question: http://stackoverflow.com/q/27901495
type: Answer

http://stackoverflow.com/comment/44163648
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27880128
has text: This method add and remove element, without changing any of styles. If you want to change opacity, change `alpha` value of `background-color` ***rgba(red, green, blue, alpha)***. Value can be from 0 up to 1. You can use `overlay.style.backgroundColor = "rgba(0,0,0,1);"`
type: AnswerComment

http://stackoverflow.com/comment/44152307
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27874864
type: AnswerComment
has text: Thanks. BTW, libraries like underscore or lodash have memoization functions. If you are already using one of those, you should switch from my implementation to a properly tested one.

http://stackoverflow.com/q/27945721
tagged with: javascript
tagged with: jquery
has body: I have a template: function useIt() { var content = document.querySelector('template').content; // Update something in the template DOM. var span = content.querySelector('span'); span.textContent = parseInt(span.textContent) + 1; document.querySelector('#container').appendChild( document.importNode(content, true)); } Use me Template used: 0 You can try the code here. This code basically copies the template(html5 templates does not render on your screen) into another div. This allows you to reuse the DOM. Problem: The line "span.textContent = parseInt(span.textContent) + 1;" changes the template code directly. I need to manipulate the content DOM and clone it into the container, without changing the template. This is very important since if I want to reuse the code, I need it to stay the same. I have tried multiple ways to use jQuery to mimic the above javascript code, but I can't manage to figure it out. It would be better if there is a jQuery way.
favorite count: 0
upvote count: 8
possible better answer: http://stackoverflow.com/a/52565812
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/56251362
has answer: http://stackoverflow.com/a/27947557
accepted answer: http://stackoverflow.com/a/27947557
score: 8
has comment: http://stackoverflow.com/comment/126457818
has title: How to clone and modify from Html5 Template Tag
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/52565812
type: Question
answer count: 2
downvote count: 0

http://stackoverflow.com/q/27823039
type: Question
tagged with: javascript
has title: Contact form issue using Ajax
answer count: 1
favorite count: 0
tagged with: ajax
tagged with: contact-form
has body: I added an contact form that uses ajax to my site. I got the code from a Treehouse blog post by Matt West from March, 2014. The code is below. Overall, the form works well, but I'm having two issues that I can't resolve. The first seems to be minor. It is that after the mail is sent by mailer.php, I'm getting an error message from line "http_response_code(200)" saying that there is an unidentified function. I got around this by just commenting out the http_response_code lines, but I don't know if there is something I need to do to make it function properly. The other issue is a UX issue. After the mail is sent, and the success message appears, red borders appear around all fields in the form. This doesn't appear to be handled by CSS, so it must be in jquery. I think the red borders are supposed to indicate bad data, but I don't want them to appear when the user had been successful in sending a message. Any help with this would be greatly appreciated. index.html AJAX Contact Form Demo AJAX Contact Form Demo Name: Email: Message: Clear Send style.css *, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } html { font-family: Helvetica, Arial, sans-serif; font-size: 100%; background: #333; -webkit-font-smoothing: antialiased; } #page-wrapper { width: 640px; background: #FFFFFF; padding: 1em; margin: 1em auto; border-top: 5px solid #69c773; box-shadow: 0 2px 10px rgba(0,0,0,0.8); } h1 { margin-top: 0; } .field { margin: 1em 0; } label { display: block; margin-top: 2em; margin-bottom: 0.5em; color: #999999; } input { width: 100%; padding: 0.5em 0.5em; font-size: 1.2em; border-radius: 3px; border: 1px solid #D9D9D9; } textarea { width: 100%; height: 200px; padding: 0.5em 0.5em; font-size: 1.2em; border-radius: 3px; border: 1px solid #D9D9D9; } #btns { text-align: right; padding-top: 2.3em; font-size: 0; line-height: 0; } button { display: inline-block; border-radius: 3px; border: none; font-size: 0.9rem; padding: 0.5re…
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/27824644
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/27930885
upvote count: 2
tagged with: skrollr
tagged with: scroll
has comment: http://stackoverflow.com/comment/44259292
has comment: http://stackoverflow.com/comment/44259342
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44259555
has title: Reverse mouse scroll direction
has comment: http://stackoverflow.com/comment/44259375
score: 2
linked to: http://stackoverflow.com/q/20776045
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44259528
has comment: http://stackoverflow.com/comment/44259256
type: UnansweredQuestion
has body: I've made a simple parallax page using skrollr.js, but after showing one to the client he decided that scrolling up instead of down would be better, is there a way to "rebind" mouse wheel behavior to avoid remaking all the animations? Here's a piece of a code I've tried to use: $("html, body").animate({ // executed on scroll scrollTop: st+2500, }, 1500, 'easeOutQuad'); timeouts.push(setTimeout(function(){ active = true; enable_scroll(); }, 2000) ); disable_scroll(); //disabling scroll It could work, but I couldn't scroll up from the top of a page. I've started "spaghettieing" code even more and kinda lost myself there. Maybe there's a better way of solving this problem? Cheers!
has comment: http://stackoverflow.com/comment/44259246
answer count: 0

http://stackoverflow.com/comment/44261777
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27931858
has text: ok, i just updated my code up top. It starts from my previous code, everything above it is my php and tab to enter script.
score: 0

http://stackoverflow.com/comment/44168830
type: QuestionComment
comment on: http://stackoverflow.com/q/27883478
has text: @charlietfl it has nothing to do with it. If the person who asking knows everything already, then this is not the place he is typing in then it will be his code editor. Period.
score: 0
type: Comment

http://stackoverflow.com/comment/44157643
type: QuestionComment
comment on: http://stackoverflow.com/q/27877962
has text: if you are having a link for a tag it will not work coz on click of li a tag will be triggered
score: 0
type: Comment

http://stackoverflow.com/q/27832338
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44070578
has comment: http://stackoverflow.com/comment/44070521
tagged with: javascript
has title: Parse Identifiers from String containing code (Using JavaScript)
has comment: http://stackoverflow.com/comment/44070549
score: 0
has comment: http://stackoverflow.com/comment/44070556
favorite count: 0
type: UnansweredQuestion
answer count: 0
tagged with: dynamic
tagged with: metaprogramming
has body: The problem I am trying to solve is this Given a string containing code (entered by the user via some kind of web based form), such as: "a = b + 5; return Math.abs(a);" Extract a list of tokens that are considered identifiers: a, b In general are there readily available existing solutions? If not, what is a good starting point for writing an simple algorithm for this purpose? I tried http://ace.c9.io/#nav=about, but was not able to find a method that readily returned the token type of an entire document. According to the API reference getTokens(Number row) should return the information I want. However, this method ended up returning the entire line as type text Thank you in advance
upvote count: 1

http://stackoverflow.com/q/27840222
has comment: http://stackoverflow.com/comment/44084267
linked to: http://stackoverflow.com/q/12236384
possible better answer: http://stackoverflow.com/a/27840395
has answer: http://stackoverflow.com/a/27840395
has comment: http://stackoverflow.com/comment/44084103
has body: I'm trying to load a very simple text file (eg: 0 online: or 1 online: Username or 2 online: Username, Username), from a server I control, that changes based on the number of users on a minecraft server, into a javascript var, so that I can eventually load it onto my Pebble and have it more or less live update. (read: no jquery) (also read: I have little to no idea what I'm actually doing, and if there's a better way to do it, lemme know.). I've done a lot of googling which mostly points me to using JSON and XMLHTTPRequests (edit: XMLHTTPRequests are probably necessary) but they seem overly complex for what I need (which is to take the contents of the text file served up via HTTP, stuff it in a var, and have the Pebble spit it out on the screen.) How can I, without JQuery, and maybe even without JSON, load the contents of a text file into a javascript var? Some notes: The server is eventually going to be accessed via Hamachi, but if I can get it working even locally I'll be pretty thrilled. Following this answer, I get this result. Ditto for local IP.
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/9838812
has answer: http://stackoverflow.com/a/27852676
upvote count: 2
duplicate of: http://stackoverflow.com/q/196498
has comment: http://stackoverflow.com/comment/44084207
type: Question
has title: How can I load the contents of a small text file into a javascript var wo/JQuery?
has comment: http://stackoverflow.com/comment/44084074
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: pebble-watch
linked to: http://stackoverflow.com/q/4533018
linked to: http://stackoverflow.com/q/13574930
accepted answer: http://stackoverflow.com/a/27852676
tagged with: pebble-js
answer count: 2
downvote count: 0
linked to: http://stackoverflow.com/q/196498
favorite count: 0

http://stackoverflow.com/a/41729674
type: Answer
upvote count: 15
downvote count: 0
has comment: http://stackoverflow.com/comment/110859132
score: 15
has comment: http://stackoverflow.com/comment/96148332
has body: I know there is already an accepted answer, but I thought I would add a link for people reading this question. The new version of the echarts documentation (echarts 3.4.0 as of writing this) has been converted into english. They have all the documentation including options, the api code, downloads, and many examples all in english (with a codepen type development area that you can test out your options and see the results in real time). The entry page can be found here: https://ecomfe.github.io/echarts-doc/public/en/ The library can be downloaded here: https://ecomfe.github.io/echarts-doc/public/en/download.html The getting started tutorial can be found here: ecomfe.github.io/echarts-doc/public/en/tutorial.html The multitude of options can be found here: ecomfe.github.io/echarts-doc/public/en/option.html A plethora of examples can be found here: ecomfe.github.io/echarts-examples/public/index.html An simple bar chart example and their codepen playground can be found here: ecomfe.github.io/echarts-examples/public/editor.html?c=bar-tick-align Below I have pasted their simple bar chart into the window for your viewing pleasure:
has comment: http://stackoverflow.com/comment/79665071
answers question: http://stackoverflow.com/q/27930030
has comment: http://stackoverflow.com/comment/92151375

http://stackoverflow.com/comment/44137519
type: QuestionComment
has text: `filter:{'ProductCategoryType': 'C' : true}`
score: 0
comment on: http://stackoverflow.com/q/27867523
type: Comment

http://stackoverflow.com/q/27868600
type: AnsweredQuestion
has title: how to display tomorrow's full date in javascript
has comment: http://stackoverflow.com/comment/44140619
linked to: http://stackoverflow.com/q/1056728
linked to: http://stackoverflow.com/q/9444745
possible better answer: http://stackoverflow.com/a/27868752
has body: I have the following script: document.write('&lt;p&gt;&lt;span id="date-time"&gt;', new Date().toLocaleString(), '&lt;\/span&gt;.&lt;\/p&gt;') if (document.getElementById) onload = function () { setInterval("document.getElementById ('date-time').firstChild.data = new Date().toLocaleString()", 50) } It displays: Friday, January 09, 2015 12:20 PM. How can I display tomorrow's date in the same format leaving the time off?
type: Question
has answer: http://stackoverflow.com/a/27868752
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/27868938
score: 0
has comment: http://stackoverflow.com/comment/44139656
tagged with: time
accepted answer: http://stackoverflow.com/a/27868938
has answer: http://stackoverflow.com/a/27868949
has answer: http://stackoverflow.com/a/27869000
answer count: 4

http://stackoverflow.com/comment/44246306
has text: @ColonelThirtyTwo & rpattiso I've updated the question
type: Comment
comment on: http://stackoverflow.com/q/27923461
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44316962
comment on: http://stackoverflow.com/q/27961766
type: Comment
type: QuestionComment
has text: console.log(Objcompany.companies.values[0].id);
score: 0

http://stackoverflow.com/a/27812822
type: Answer
has body: try the below code which animates to that area when you click on Forms &amp; FAQs $('[href="#Forms"]').click(function(e){ e.preventDefault(); $('html,body').animate({scrollTop:$('#Forms').offset().top - $('#siteHeader').height() + 1}) })
has comment: http://stackoverflow.com/comment/44063325
accepted answer of: http://stackoverflow.com/q/27810418
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44071458
has comment: http://stackoverflow.com/comment/44097857
score: 0
has comment: http://stackoverflow.com/comment/44089818
answers question: http://stackoverflow.com/q/27810418

http://stackoverflow.com/comment/44189249
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27892606
has text: Do you mean that you just want to add elements to the DOM? That would be broadly just a jQuery problem then, right? Inserting elements, modifying `id` and `name` elements perhaps?
score: 0

http://stackoverflow.com/comment/44070146
type: AnswerComment
has text: maybe that's all that you need, just add the code that you have in your ajax method into searchmethods.showResults
type: Comment
comment on: http://stackoverflow.com/a/27831906
score: 0

http://stackoverflow.com/a/27929838
answers question: http://stackoverflow.com/q/27929368
type: Answer
upvote count: 3
score: 3
has body: You could change your title property into a method, as follows: app.config(['$routeProvider', function($routeProvider) { $routeProvider.when('/', { templateUrl: '/partials/home.html', controller: 'home', title: function () { return "Corvid"; } }) .when('/archive', { templateUrl: "/partials/archive/all.html", controller: "archive", title: function () { return "Archive"; } }). when('/archive/:id', { templateUrl: "/partials/archive/one.html", controller: "article", title: function (Article) { return Article.get(this.id).title; } }) .otherwise({ templateUrl: "/partials/errors/404.html", title: function () { return "Something went wrong!"; } }); } ]); Then call it later, and pass the injected Article service. app.run(['$location', '$rootScope', 'Article', function($location, $rootScope, Article) { $rootScope.$on('$routeChangeSuccess', function(event, current, previous) { $rootScope.title = current.$$route.title(Article); }); } ]);
downvote count: 0

http://stackoverflow.com/comment/44288770
comment on: http://stackoverflow.com/q/27946859
type: Comment
type: QuestionComment
score: 2
has text: The Unicode character *should* work unless your page is being served with some different character set.

http://stackoverflow.com/comment/44181600
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27889930
has text: Wild guess, but could it be a turbolinks issue? Does the error occur when you directly visit the URL but not when you navigate there from links on other pages?

http://stackoverflow.com/q/27906170
has comment: http://stackoverflow.com/comment/44212435
tagged with: parse-cloud-code
score: 0
has comment: http://stackoverflow.com/comment/44214919
tagged with: parse-platform
type: UnansweredQuestion
answer count: 0
has title: Receive JSON string from client and directly convert it to JSON object and save on server?
type: Question
has body: I wanna speed up the process of saving (developement time) some objects on Parse and wonder if the following is possible: I have an object called TestObject with the columns: testCol1, testCol2 ... testCol9. If I wanted to save an object of this kind and the client has to send a value for all these columns the code on the server (cloud-code) would be quite messy (unnecessary long). Example: var col1 = request.params.col1; var col2 = request.params.col2; ... var col9 = request.params.col9; And then when setting the these values on the actual object the process has to be kinda repeated. Is there a way I can do something like: var TestObject = Parse.Object.extend("TestObject"); var testObject = new TestObject(JSON.stringify(request.params)); testObject.save();
tagged with: javascript

http://stackoverflow.com/comment/44296464
score: 0
comment on: http://stackoverflow.com/q/27950662
has text: Are you sure you get "value 1"?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44089703
comment on: http://stackoverflow.com/q/27840671
has text: According to the [documentation](http://api.jquery.com/jquery.ajax/) you can run "always" with more parameters, including the status code. If that is anything but 200, your request failed.
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/27919756
upvote count: 0
has comment: http://stackoverflow.com/comment/44237409
type: Question
has answer: http://stackoverflow.com/a/27920940
has title: How Apply CSS for only some Alphabets and numbers by finding them using jquery?
tagged with: javascript
tagged with: jquery
score: -1
has body: I am now designing a website which works on local language. I used local language font-face kit for it. Actually when i am using font-face kit for local language English content and numbers are not in good style. So I want to style it using other fonts or css by checking the English content and alphabet throughout the page. Is there any technique in jquery for solve this problem??.. Thanks in advance.
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44114328
type: QuestionComment
type: Comment
has text: If you will look on my markup you'll see a tag. What I want to do is by default dispaly inside the tag the default value of data-email which is "youremail@email.com" now when button was click it will then change to this "newemail@email.com" got it?
comment on: http://stackoverflow.com/q/27855375
score: 0

http://stackoverflow.com/comment/44181531
has text: the first code I posted the onclick handler script finds the index of the input box you click into, I need the value of the column next to it (job id) passed to a variable.
score: 0
comment on: http://stackoverflow.com/q/27887708
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27843286
tagged with: arrays
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44090650
linked to: http://stackoverflow.com/q/960866
has body: i have a problem with the following situation: I have an Array of Objects which all contains the same attribute, which is called src Before adding a new Object (with an src attribute too), I want to check if the value already exists in just one src attribute in the Objects Array. Therefore I wanted to use $.inArray() with the new src as first parameter and as array not the array of objects, but the array of the values of the attributes from the objects array. As Example: I have var arrayOfObjects = [{ src : "source1", otherAttribute : "value" }, { src : "source2", otherAttribute : "value" }]; My question is: Is there a build in function in JavaScript/jQuery which returns ["source1","source2"] when called with functionX(arrayOfObjects) ?
has title: How to get array of values of attributes from objectarray
type: UnansweredQuestion
tagged with: javascript-objects
has answer: http://stackoverflow.com/a/27843417
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27843341
type: Question
answer count: 2
upvote count: 1

http://stackoverflow.com/q/27915189
has comment: http://stackoverflow.com/comment/44249812
type: Question
tagged with: crossfilter
accepted answer: http://stackoverflow.com/a/28015404
has comment: http://stackoverflow.com/comment/44249653
tagged with: javascript
tagged with: data-structures
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44251333
has comment: http://stackoverflow.com/comment/44249994
has body: When applying a filter to a group, the changes from the filtration are not reflected in my mapreduced group. I want the changes to filter down -- or to My data is setup normally: var rides = crossfilter(data), all = rides.groupAll(), gender = rides.dimension(function(d) { return d.gender; }), gendersAvg = gender.group().reduce(reduceAddGender, reduceRemoveGender, reduceInitialGender).all(), My map reduce functions are set up as follows: function reduceAddGender(p, v) { p.count++; return p; } function reduceRemoveGender(p, v) { p.count--; return p; } function reduceInitialGender() { return { count: 0 }; } I perform my filtering like this: gender.filter(function(d){ return d === parseInt(z[1]) || d === parseInt(z[0]) }); All my dimensions reflect the filter, except one. When I seek out the values of GendersAvg post-filtration, those values don't reflect the filters. Ideas? Calling the average a second time doesn't change its values either.
has answer: http://stackoverflow.com/a/28015404
type: AnsweredQuestion
has title: Reduce does not reflect filtering of a dimension
tagged with: mapreduce

http://stackoverflow.com/q/27917427
favorite count: 0
has body: How to decide up front when building a web app between server side and client side rendering. Is there any general guideline or best practice for all websites? What should be recommended, server side rendering, client side rendering or a hybrid of two? Some people say whether to choose client/server side rendering depends on the use case. I am still not sure what cases more suit client side versus server side rendering. How do we decide up front whether to use a client rendered page or a server rendered page. Is there a middle ground on this?
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27917483
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/27918645
tagged with: javascript
has answer: http://stackoverflow.com/a/27917483
score: 4
tagged with: webpage-rendering
has title: Server side or client side rendering
has answer: http://stackoverflow.com/a/27918645
upvote count: 4

http://stackoverflow.com/comment/44219876
comment on: http://stackoverflow.com/a/27910094
type: AnswerComment
score: 0
type: Comment
has text: Yes, that does make sense. Presumably, the solution is to customize the `ko.mapping` object creation for both `products.all` and `products.selected` (i.e., to marshal them both to a viewModel specific representation)

http://stackoverflow.com/comment/44215599
type: QuestionComment
comment on: http://stackoverflow.com/q/27907327
score: 0
has text: well, at least now that I have renamed the file, there's no file with the old name lying around. Before the rename, I did check the file in the `target` folder and it had the new contents, but still I was getting the old contents in the browser.
type: Comment

http://stackoverflow.com/q/27951974
upvote count: 1
has title: How to show number of characters typed in textarea in a textbox using JavaScript
type: Question
accepted answer: http://stackoverflow.com/a/27952118
tagged with: javascript
has body: How can I get the number of characters typed into a textarea to put into one textbox, and the number of words from the textarea to put in the other, as I press Enter. &lt;textarea name="TextArea1" cols="20" rows="2"&gt;&lt;/textarea&gt;&lt;br&gt; &lt;input name="Text1" type="text" /&gt;Characters &lt;input name="Text1" type="text" /&gt;Words
has comment: http://stackoverflow.com/comment/44299030
downvote count: 4
linked to: http://stackoverflow.com/q/12742595
answer count: 1
linked to: http://stackoverflow.com/q/5533053
favorite count: 0
has comment: http://stackoverflow.com/comment/44299020
has answer: http://stackoverflow.com/a/27952118
score: -3
has comment: http://stackoverflow.com/comment/44299151
has comment: http://stackoverflow.com/comment/44299174
has comment: http://stackoverflow.com/comment/44299099
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44299097

http://stackoverflow.com/q/27941935
has comment: http://stackoverflow.com/comment/44283884
has comment: http://stackoverflow.com/comment/44284019
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44347134
has title: How to debug javascript in Visual Studio, loaded dynamically by ExtJS.Loader?
tagged with: extjs
has body: I have an ASP.NET Visual Studio 2013 Project, and a lot of javascript files in app-extjs dir (controllers, viewmodels, ...) My init code: Ext.Loader.setConfig({ enabled: true, paths: { 'MyApp.controller': 'app-extjs/controllers', 'MyApp.model': 'app-extjs/models', 'MyApp.view': 'app-extjs/views', } }); Ext.application({ name: 'MyApp', controllers: [ 'MyApp.controller.Root' ], autoCreateViewport: 'MyApp.view.main.Main', }); How to debug javascript in visual studio, loaded dynamically by ExtJS.Loader? My setConfig allows me load file, but I cannot debug it
has comment: http://stackoverflow.com/comment/44284507
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44282541
tagged with: visual-studio-2013
answer count: 0
type: Question
tagged with: debugging

http://stackoverflow.com/comment/44052222
type: Comment
type: QuestionComment
has text: you are setting up a jquery callback (ajaxSuccess) xhr isnt part of jquery, its native
score: 0
comment on: http://stackoverflow.com/q/27823187

http://stackoverflow.com/a/27915673
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27894689
has body: As I told you I am learning curve and I tried to put the same question in different forums but I could not got the answer But suddenly something trigger in my mind that why we can't use ngModal which act as ngBind which I want, so first in my directive I added require: 'ngModel', Then in my $scope.validateSingle function I added ngModel.$setViewValue($scope.value); where $scope.value I was assigning with selected value so my validateSingle function become like this $scope.validateSingle = function(item) { $scope.text = item[$scope.textField] + ($scope.textField2 !== '' ? " (" + item[$scope.textField2] + ")" : ""); $scope.value = item[$scope.valueField]; $scope.placeholder = 'placeholderBlack'; $scope.hideItems(); if (typeof $scope.callback == 'function') { $scope.callback($scope.value); } ngModel.$setViewValue($scope.value); } So bingo every thing working like charm as I was wanted. I edited my plunker also you can check on http://plnkr.co/edit/GxM78QRwSjTrsX1SCxF7?p=preview Hope it will help to some new learner
accepted answer of: http://stackoverflow.com/q/27894689

http://stackoverflow.com/comment/44454801
comment on: http://stackoverflow.com/a/27850243
has text: JavaScript doesn't have a way to know when something is done - this is where promises kick in
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27843561
has comment: http://stackoverflow.com/comment/44090878
has answer: http://stackoverflow.com/a/27843900
has title: PHP loop through form with button ID
tagged with: php
has body: I am trying to get a loop in php working, sadly, it does not do what it has to do, it quite loops the arrays etc, but when I click on button nothing happens. only the first button works. here it goes: so far the JS ^ nog the php. not posting entire code. because its quite long but here starts the for each, wich works completly. echo " Name Last Name Email Extension Numbers Datum "; foreach ($response as $key => $value) { echo " ".$value['fname']." ".$value['lname']." ".$value['email']." ".$value['ext']." "; foreach ($value['numbers'] as $key2 => $numvalue) { echo" ".$numvalue." "; } echo " "; echo("<form action='<?php echo" . $_SERVER['PHP_SELF'] . "?>' method='post'> "); echo " "; } echo " "; I suppose there is a problem right here: echo("<form action='<?php echo" . $_SERVER['PHP_SELF'] . "?>' method='post'> "); Sorry for long code..
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44091236
has comment: http://stackoverflow.com/comment/44090881
type: Question
accepted answer: http://stackoverflow.com/a/27843900
has comment: http://stackoverflow.com/comment/44091108
has comment: http://stackoverflow.com/comment/44091167
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44091205
has comment: http://stackoverflow.com/comment/44091213

http://stackoverflow.com/q/27926287
accepted answer: http://stackoverflow.com/a/27928437
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: ajax
has title: [Leaflet]How to change the color of each area and make it editable?
tagged with: http://stackoverflow.com/tag/html
has body: I have a map created in leaflet and here is the sample picture http://i58.tinypic.com/2a7xwqo.jpg Based on the picture you see is the bordered area on the left side is editable and the rest of the world is not. Now my questions is how can i make my map on right side will be same on the left? i mean both of them is editable and rest of the world is not? and also how to change their colors? Here is the code Any help would be great TY
type: AnsweredQuestion
tagged with: leaflet
has answer: http://stackoverflow.com/a/27928437

http://stackoverflow.com/q/27953920
type: Question
type: AnsweredQuestion
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27953995
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27953995
tagged with: video
has title: Javascript Video Button
has body: I'm a bit of a novice when it comes to Jquery. I'm trying to pause/play a video by clicking the video itself and also by click a play/pause button. Now, I've managed to get it working as desired when the user clicks the video. But I can't get it to work using the button as well. This what I've tried so far: $("video").trigger("play");//for auto play $('video, #pausebutton').click(function() { if ($('video').hasClass('pause')) { $("video").trigger("play"); $(this).removeClass('pause'); $("#artwork").removeClass('fadein') $(this).addClass('play'); $("#pausing").html("&amp;#9616;&amp;#9616;"); } else { $("video").trigger("pause"); $(this).removeClass('play'); $(this).addClass('pause'); $("#artwork").addClass('fadein'); $("#pausing").html("&amp;#9658;"); } }); The pause button does actually pause the video, but it doesn't resume play when clicked for a second time. It also ignores the other attributes such as add and removing classes etc. Just to clarify, all these things work when the video is clicked directly. Any help would be appreciated. Cheers

http://stackoverflow.com/q/27846931
tagged with: javascript
has comment: http://stackoverflow.com/comment/44097651
possible better answer: http://stackoverflow.com/a/27847197
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/27907471
has answer: http://stackoverflow.com/a/27847197
has comment: http://stackoverflow.com/comment/44098111
has answer: http://stackoverflow.com/a/27907471
tagged with: knockout-2.0
tagged with: foreach
type: AnsweredQuestion
has title: Use IF condition in Foreach loop for comparision of data-bind values
type: Question
tagged with: if-statement
has body: I need to compare a value which is returned from the db in a ForEach loop. I am not sure how to pik this value up (ie store it in a variable) and use it for comparison. 1 2 The data-bind="text:Contractor_Status" returns "Enrolled" or "Rejected", If Enrolled I want to show span 1 else span 2. Please can you help me with the syntax.

http://stackoverflow.com/comment/44200615
type: Comment
comment on: http://stackoverflow.com/a/27858579
type: AnswerComment
score: 0
has text: I've made a fiddle. The html part has all the aspx code and the box below has the aspx.cs code. not quite in the fiddle format but at least I can show my code lol. http://jsfiddle.net/tj8vjqdm/1/ .I've put the alert in but it doesn't show. Many thanks for your help Banana it's much appreciated.

http://stackoverflow.com/q/27881314
type: Question
has comment: http://stackoverflow.com/comment/44164700
tagged with: javascript
linked to: http://stackoverflow.com/q/17472313
score: 0
has comment: http://stackoverflow.com/comment/44164371
linked to: http://stackoverflow.com/q/20212851
has comment: http://stackoverflow.com/comment/44164525
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has body: I get the original code from here: Using Javascript FileReader with huge files But my purpose is different, the author wants to get just a part of the whole but I want them all. I'm trying modify it with loop, mixed with this technique: slice large file into chunks and upload using ajax and html5 FileReader All fails, is there anyway I can get what I want. var getSource = function(file) { var reader = new FileReader(); reader.onload = function(e) { if (e.target.readyState == FileReader.DONE) { process(e.target.result); } }; var part = file.slice(0, 1024*1024); reader.readAsBinaryString(part); }; function process(data) { // data processes here } Thank you,
has title: How to get all sliced data from the entire file

http://stackoverflow.com/comment/44155289
type: Comment
score: 2
comment on: http://stackoverflow.com/a/27875418
type: AnswerComment
has text: @acecloudsmaps: That looks like a working approach, just using the `i` variable for index instead of the hard coded values. You could turn the function expression into a named function, that way the timeout could just call that function.

http://stackoverflow.com/q/27960957
score: 1
has body: I've got the following layout: HTML // contains the table, height max 20 items Goal The idea is to make an angular directive that stretches the annotated container to the maximum height of the parent container minus all siblings. Directive (what I have yet) module App.Directive { export class AutoStretchDirective { private window: ng.IWindowService; restrict: string = "A"; constructor($window: ng.IWindowService) { this.window = $window; this.link = this.link.bind(this); } link = (scope, element, attrs) => { var combined = collection => { var heights, node, i, len; heights = 0; for (i = 0, len = collection.length; i < len; i ++) { node = collection[i]; heights += node.offsetHeight; } return heights; }; var siblings = $elm => { var elm, i, len, ref, results; ref = $elm.parent().children(); results = []; for (i = 0, len = ref.length; i < len; i++) { elm = ref[i]; if (elm !== $elm[0]) { results.push(elm); } } return results; }; angular.element(this.window).bind("resize", () => { var additionalHeight, parentHeight; additionalHeight = attrs.additionalHeight || 0; parentHeight = window.innerHeight - element.parent()[0].getBoundingClientRect().top; return element.css("height", parentHeight - combineHeights(siblings(element)) - additionalHeight); }); }; }; } The directive loads fine, however it's not working correclty. As soon as ng-repeat populates, the container is pushed down to the height required for all items. I've tried decorating the columns with height: 100% and overflow (css), but it seems to be ignored. Am I missing something? Is there a way to debug the transitions a directive is applying to the elements?
has comment: http://stackoverflow.com/comment/52444353
has title: Angular directive - auto stretch to bottom
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: angularjs
has answer: http://stackoverflow.com/a/34802515
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
linked to: http://stackoverflow.com/q/25437321
type: UnansweredQuestion
upvote count: 1
tagged with: typescript

http://stackoverflow.com/comment/44207998
type: Comment
has text: I've get up your code and do some mods to fit my task, I'll public it when it will be ready enough. I've changed calculation of the last point from formula to simply close the ellipse (compare with first point) and then it become ideal algorithm (in practise). Although - brute force not working good in this way. I don't know why, but only last approx algorithm working ideally for most cases (for more a/b ratios, and for absolutely all n>~10).
comment on: http://stackoverflow.com/a/27887568
score: 1
type: AnswerComment

http://stackoverflow.com/q/27951739
score: 2
upvote count: 2
type: Question
has title: Make a row column text bold after grid has loaded data
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27951889
tagged with: extjs
tagged with: extjs4
type: UnansweredQuestion
has body: I'm struggling to find this one now. After a grid panel's store has loaded, I want to check a couple of things and if certain conditions are met, I want to make the text of a column row bold. ColumnA ColumnB Hello World I'd like to make 'Hello' bold, but I can seem to get my hands on the html of the cell. I tried, to get the first cell grid.view.getCell(0); //nope grid.view.getCellByPosition(0); //nope Google is turning plenty of CSS examples, but I'd rather just get the text and replace it with the text. Any ideas ?

http://stackoverflow.com/comment/44097843
has text: I just tested your proposal, it works when I define my `NODE_PATH` n the terminal, but when doing `console.log(process.env.NODE_PATH = __dirname +'/src'); require('MA/MessagesBundle/MessagesBundle');` it does not work.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27842171
type: AnswerComment

http://stackoverflow.com/comment/44143417
score: 1
comment on: http://stackoverflow.com/q/27870490
has text: Please show what you want the final output data structure to look like for the `obj` input you have specified. I'm not following what you want.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44170331
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27884027
has text: The elements would not exist either case, the problem is that before getting checked with `ng-if` they will get repeated 10000 times and then each element checked for `items.length < 50`, and only then they will get removed. And it will happen only because `ng-repeat` has `priority` equal to 1000 and `ng-if` has priority `450`. By not having an ability to affect the order of directive "execution" can cause problems, does that make things clear?
score: 0

arrays
tags question: http://stackoverflow.com/q/27962916
tags question: http://stackoverflow.com/q/27861456
tags question: http://stackoverflow.com/q/27862687
tags question: http://stackoverflow.com/q/27960262
tags question: http://stackoverflow.com/q/27827958
tags question: http://stackoverflow.com/q/27853211
tags question: http://stackoverflow.com/q/27926171
type: Tag
tags question: http://stackoverflow.com/q/27888968
tags question: http://stackoverflow.com/q/27949494
tags question: http://stackoverflow.com/q/27851053
tags question: http://stackoverflow.com/q/27866534
tags question: http://stackoverflow.com/q/27884512
tags question: http://stackoverflow.com/q/27865787
tags question: http://stackoverflow.com/q/27857235
tags question: http://stackoverflow.com/q/27957592
tags question: http://stackoverflow.com/q/27932973
tags question: http://stackoverflow.com/q/27874728
tags question: http://stackoverflow.com/q/27813464
tags question: http://stackoverflow.com/q/27816291
tags question: http://stackoverflow.com/q/27897227
tags question: http://stackoverflow.com/q/27804441
tags question: http://stackoverflow.com/q/27841362
tags question: http://stackoverflow.com/q/27866292
tags question: http://stackoverflow.com/q/27890611
tags question: http://stackoverflow.com/q/27899957
tags question: http://stackoverflow.com/q/27933955
tags question: http://stackoverflow.com/q/27877705
tags question: http://stackoverflow.com/q/27821111
tags question: http://stackoverflow.com/q/27856915
tags question: http://stackoverflow.com/q/27912417
tags question: http://stackoverflow.com/q/27934179
tags question: http://stackoverflow.com/q/27875321
tags question: http://stackoverflow.com/q/27812352
tags question: http://stackoverflow.com/q/27941288
tags question: http://stackoverflow.com/q/27962992
tags question: http://stackoverflow.com/q/27926364
tags question: http://stackoverflow.com/q/27857577
tags question: http://stackoverflow.com/q/27938988
tags question: http://stackoverflow.com/q/27856721
tags question: http://stackoverflow.com/q/27903871
tags question: http://stackoverflow.com/q/27887720
tags question: http://stackoverflow.com/q/27939953
tags question: http://stackoverflow.com/q/27942074
tags question: http://stackoverflow.com/q/27806195
tags question: http://stackoverflow.com/q/27953048
tags question: http://stackoverflow.com/q/27844724
tags question: http://stackoverflow.com/q/27823901
tags question: http://stackoverflow.com/q/27806252
tags question: http://stackoverflow.com/q/27840274
tags question: http://stackoverflow.com/q/27809347
tags question: http://stackoverflow.com/q/27849034
tags question: http://stackoverflow.com/q/27883871
tags question: http://stackoverflow.com/q/27891366
tags question: http://stackoverflow.com/q/27861424
tags question: http://stackoverflow.com/q/27870490
tags question: http://stackoverflow.com/q/27861112
tags question: http://stackoverflow.com/q/27942215
tags question: http://stackoverflow.com/q/27820461
tags question: http://stackoverflow.com/q/27843673
tags question: http://stackoverflow.com/q/27804922
tags question: http://stackoverflow.com/q/27909856
tags question: http://stackoverflow.com/q/27810789
tags question: http://stackoverflow.com/q/27934153
tags question: http://stackoverflow.com/q/27883740
tags question: http://stackoverflow.com/q/27895644
tags question: http://stackoverflow.com/q/27895365
tags question: http://stackoverflow.com/q/27952494
tags question: http://stackoverflow.com/q/27923445
tags question: http://stackoverflow.com/q/27904502
tags question: http://stackoverflow.com/q/27816213
tags question: http://stackoverflow.com/q/27924356
tags question: http://stackoverflow.com/q/27808610
tags question: http://stackoverflow.com/q/27831484
tags question: http://stackoverflow.com/q/27884103
tags question: http://stackoverflow.com/q/27942507
tag name: arrays
tags question: http://stackoverflow.com/q/27898762
tags question: http://stackoverflow.com/q/27921459
tags question: http://stackoverflow.com/q/27852016

http://stackoverflow.com/comment/44157919
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27878174
score: 1
has text: this.b is just a reference to the array, so this.c = this.b assigns the same reference to c, so you are always modifying the same array. Use this.c = this.b.slice() for example to get a clone of the array.

http://stackoverflow.com/comment/44101976
has text: @PatrickQ Yes - thanks for pointing this out, I should have explained it. I've now added a section showing where I got stuck with this (just tried something new and it seems to be getting closer - but a new obstacle cropped up!). Thanks for your advice.
comment on: http://stackoverflow.com/q/27847747
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27806689
has answer: http://stackoverflow.com/a/27806848
has comment: http://stackoverflow.com/comment/44022399
score: 0
tagged with: coffeescript
type: Question
has comment: http://stackoverflow.com/comment/44022455
has title: add div class inside appended iFrame with javascript
has comment: http://stackoverflow.com/comment/44022592
tagged with: javascript
tagged with: jquery
has body: im creating and adding an iFrame as the following: $("#iframe").append setIframe(gon.user_appointments_url + "/" + calEvent.id + "/edit", 630) setIframe = (srcAttribute, height) -&gt; ifrm = document.createElement("IFRAME") ifrm.setAttribute "src", srcAttribute ifrm.style.width = 100 + "%" ifrm.style.height = height + "px" return ifrm After this, that works fine, i pretend to add a class that will set the header's color on the iFrame, depending on the element's "status". So i call the following function: setHeaderBgColor(getDivClassFromStatus(jsEvent.status)) setHeaderBgColor = (header_div_class) -&gt; $("iframe").contents().find("#appointments-form-header").addClass header_div_class But this doesnt work. I never seem to get to "#appointments-form-header" and dont find the way to do it. I'd appreciate any help. Thanks in advance.
answer count: 1
has comment: http://stackoverflow.com/comment/44022502
type: UnansweredQuestion
tagged with: iframe
tagged with: ruby-on-rails

http://stackoverflow.com/comment/44311533
comment on: http://stackoverflow.com/q/27957535
type: Comment
score: 0
type: QuestionComment
has text: how can you use ng-repeat and ng-options together?

http://stackoverflow.com/comment/44244932
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27923970
has text: @chipChocolate.py Ya, really really boring! Anyway thx for trying ;)

http://stackoverflow.com/comment/44102114
has text: @canon: This is a standard ID in ASP.NET. The prefixed text in the ID refers to the containing controls to ensure the actual ID is unique on the page.
type: Comment
comment on: http://stackoverflow.com/a/27848942
score: 1
type: AnswerComment

http://stackoverflow.com/q/27939571
has answer: http://stackoverflow.com/a/27939750
tagged with: facebook
has title: Is it insecure to expose Facebook app token in client side?
type: AnsweredQuestion
type: Question
has body: My site makes JS Facebook Graph API requests like https://graph.facebook.com/v2.2?id=http://[URL]&amp;format=json&amp;access_token=[FB app id]|[FB app token] to get the number of Facebook shares for each post. The app id is my Facebook app ID number and the app token is a long-lasting access token. Both of these values are exposed in the client side, although my app secret is private and I generate the app token server-side. Is this way of doing things insecure? Do I need to move these requests server-side and make my own endpoint to report the share count? Facebook's documentation is a bit confusing. It says: Again, for security, app access token should never be hard-coded into client-side code, doing so would give everyone who loaded your webpage or decompiled your app full access to your app secret, and therefore the ability to modify your app. This implies that most of the time, you will be using app access tokens only in server to server calls. Note that because this request uses your app secret, it must never be made in client-side code or in an app binary that could be decompiled. It is important that your app secret is never shared with anyone. Therefore, this API call should only be made using server-side code. I'm not hard-coding the app access token, and I'm keeping my app secret hidden. But I am using the app token in client to server calls. Do I need to change this?
tagged with: javascript
tagged with: security
score: 0
accepted answer: http://stackoverflow.com/a/27939750
tagged with: api
answer count: 1
tagged with: facebook-graph-api

http://stackoverflow.com/a/27849381
answers question: http://stackoverflow.com/q/27848278
score: 1
has body: Here is a solution using for loops. var newList = []; var afterId = -1; for (var i = 0; i &lt; list.length; i++) { var item; for (var j = 0; j &lt; list.length; j++) { if (list[j].afterId === afterId) { item = list[j]; break; } } afterId = item.id; newList.push(item); } http://jsfiddle.net/z3sfdo1z/1/ Starting with -1, loop through the list to place each item in order until all items have been placed. Note that this will fail if the array is missing a specific afterId.
downvote count: 0
has comment: http://stackoverflow.com/comment/44103707
type: Answer
has comment: http://stackoverflow.com/comment/44103201
upvote count: 1

http://stackoverflow.com/comment/44138843
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27868204
type: AnswerComment
has text: Very nice, but I don't think an alternate (arguably better) method helps the OP (or future readers) understand the problem. Maybe you could add some explanation?

http://stackoverflow.com/q/27807672
has title: $.getJSON won't work at all
tagged with: javascript
tagged with: jquery
has body: When I click the button, I get nothing.. My code below. Thanks in advance for any help. I've tried so many different methods and none of it works at all. I think maybe there is an error in my JQuery but I cannot find it. Or my JSON file syntax. HTML: JSON Practice Users JQuery: $("button").click( function() { $.getJSON('json_data.json', function(obj) { $.each(obj, function(key, value) { $("ul").append(" "+value.name+" "); }); }); }); JSON: { "p1": { "name": "Satish", "age": 25, "company": "Techntoip" }, "p2": { "name": "Kiran", "age": 28, "company": "Oracle" } }
score: 0
has comment: http://stackoverflow.com/comment/44024478
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44024436
answer count: 0
has comment: http://stackoverflow.com/comment/44024423
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/44024479

http://stackoverflow.com/a/27937844
has comment: http://stackoverflow.com/comment/44272425
has comment: http://stackoverflow.com/comment/44272340
has comment: http://stackoverflow.com/comment/44272820
has comment: http://stackoverflow.com/comment/44272290
has comment: http://stackoverflow.com/comment/44273052
score: 0
has comment: http://stackoverflow.com/comment/44272446
has comment: http://stackoverflow.com/comment/44272407
has comment: http://stackoverflow.com/comment/44272866
has comment: http://stackoverflow.com/comment/44272312
type: Answer
has comment: http://stackoverflow.com/comment/44272283
answers question: http://stackoverflow.com/q/27937638
has body: This will do it when they hit the enter key anywhere on the page &lt;div onclick="javascript:ToggleMenu('&lt;%# Container.DataItem.FuncID %&gt;');"&gt; &lt;script&gt; document.addEventListener("keypress", function (evt) { if (evt.keyCode === 13) { //they pressed enter //now get the divevent var div = document.querySelector('div[onclick*="ToggleMenu"]'); //trigger the event div.onclick.apply(div); } } ); &lt;/script&gt;

http://stackoverflow.com/a/27828325
has body: You need to define authentication strategies and call passport.authenticate to authenticate your users. See an example in the passport guide
has comment: http://stackoverflow.com/comment/44066916
has comment: http://stackoverflow.com/comment/44157175
has comment: http://stackoverflow.com/comment/44219229
answers question: http://stackoverflow.com/q/27824915
type: Answer
upvote count: 1
downvote count: 1
score: 0

http://stackoverflow.com/q/27858568
has comment: http://stackoverflow.com/comment/44120327
has answer: http://stackoverflow.com/a/27858977
has comment: http://stackoverflow.com/comment/44120662
linked to: http://stackoverflow.com/q/17008086
answer count: 1
linked to: http://stackoverflow.com/q/2709612
has comment: http://stackoverflow.com/comment/44120971
linked to: http://stackoverflow.com/q/27843436
has body: Note: This is not a question about classical and prototype inheritance. It's about what coding patterns to use to initialize objects. Class constructors create and initialize objects, whereas avoiding the new operator and going for Object.create() only creates the object and sets up the prototype chain. I have not yet found an online resource that explains best-practice coding patterns for doing creation and initialization when going for the Crockford Object.create() approach. If I have a constructor (in my head this makes my class, although I know classes don't technically exist yet in mainstream JavaScript) function Person(first, last) { this.name = { first: first, last: last }; } Person.prototype.tellName = function() { return this.name.first + ' ' + this.name.last; } I can then instantiate it like this var p1 = new Person('John', 'Doe'); var p2 = new Person('Sven', 'Svensson'); And change the Person.name.first and Person.name.last separately p1.tellName(); // Output: 'John Doe' p2.tellName(); // Output: 'Sven Svensson' p1.name.first = 'Peter'; p2.name.last = 'Celery'; And execute the object's function Person.tellName() with the following output p1.tellName(); // Output: 'Peter Doe' p2.tellName(); // Output: 'Sven Celery' Which is very similar to how I'd approach building such a class in C++ or Java. What patterns do I use to construct, or initiate an object where I can assign to a nested object when using the Crockford (Object.create()-ish) approach instead of new? E.g. ... // some code that does the same stuff as defining a class + constructor ... var p1 = ??????? var p2 = ??????? // The following is the code and behavior I'm looking to get p1.tellName(); // Output: 'John Doe' p2.tellName(); // Output: 'Sven Svensson' p1.name.first = 'Peter'; p2.name.last = 'Celery'; p1.tellName(); // Output: 'Peter Doe' p2.tellName(); // Output: 'Sven Celery'
favorite count: 0
has comment: http://stackoverflow.com/comment/44120264
accepted answer: http://stackoverflow.com/a/27858977
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44120479
has comment: http://stackoverflow.com/comment/44120841
has comment: http://stackoverflow.com/comment/44120310
type: Question
has comment: http://stackoverflow.com/comment/44120430
score: 5
has title: Coding patterns for initializing objects - constructors (new) vs. Object.create() (Crockford)
has comment: http://stackoverflow.com/comment/44120845
upvote count: 5
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27870183
has body: prompt() will never return false. It may return an empty string, or null (if Cancel/ESC are used) -- either of which would satisfy while (! name) -- but neither of those is strictly equal to false.
answers question: http://stackoverflow.com/q/27870147
type: Answer
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/q/27952345
has comment: http://stackoverflow.com/comment/44299859
has answer: http://stackoverflow.com/a/27952570
type: Question
tagged with: c#
tagged with: jquery-ui
answer count: 1
has comment: http://stackoverflow.com/comment/44299737
downvote count: 5
tagged with: javascript
tagged with: webforms
score: -4
has comment: http://stackoverflow.com/comment/44299711
accepted answer: http://stackoverflow.com/a/27952570
has body: I'm developing a form in which there is a field called Available From,(time should be entered in minutes for that text bod) the user if enters 2h(hours) in the text box, then as soon as it loses focus , the 2h should get converted into mins, same for when entered in days, eg: 2d should get converted into 2880 mins, should appear on the text box. If entered in mins, then should remain in mins. I'm new to java script and jQuery. Any help would be appreciated
tagged with: asp.net
favorite count: 0
upvote count: 1
has title: Convert given string to minutes when text box loses focus
type: AnsweredQuestion

validation
tags question: http://stackoverflow.com/q/27820721
tags question: http://stackoverflow.com/q/27826876
tags question: http://stackoverflow.com/q/27807141
tags question: http://stackoverflow.com/q/27833713
tags question: http://stackoverflow.com/q/27883618
tags question: http://stackoverflow.com/q/27826445
tags question: http://stackoverflow.com/q/27862197
tags question: http://stackoverflow.com/q/27926682
tags question: http://stackoverflow.com/q/27822303
tags question: http://stackoverflow.com/q/27828360
type: Tag
tag name: validation
tags question: http://stackoverflow.com/q/27945064
tags question: http://stackoverflow.com/q/27877660
tags question: http://stackoverflow.com/q/27876719
tags question: http://stackoverflow.com/q/27935339
tags question: http://stackoverflow.com/q/27882448
tags question: http://stackoverflow.com/q/27958745
tags question: http://stackoverflow.com/q/27884849
tags question: http://stackoverflow.com/q/27963929
tags question: http://stackoverflow.com/q/27858193
tags question: http://stackoverflow.com/q/27903014
tags question: http://stackoverflow.com/q/27853781
tags question: http://stackoverflow.com/q/27886425
tags question: http://stackoverflow.com/q/27935682
tags question: http://stackoverflow.com/q/27840573
tags question: http://stackoverflow.com/q/27923529
tags question: http://stackoverflow.com/q/27951545
tags question: http://stackoverflow.com/q/27844274
tags question: http://stackoverflow.com/q/27819756
tags question: http://stackoverflow.com/q/27888176
tags question: http://stackoverflow.com/q/27821770
tags question: http://stackoverflow.com/q/27904740
tags question: http://stackoverflow.com/q/27835161
tags question: http://stackoverflow.com/q/27961123
tags question: http://stackoverflow.com/q/27921553
tags question: http://stackoverflow.com/q/27963201
tags question: http://stackoverflow.com/q/27804225
tags question: http://stackoverflow.com/q/27951910
tags question: http://stackoverflow.com/q/27953713

http://stackoverflow.com/q/27826179
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27826247
score: 0
has title: Set Datetime order in JavaScript
has comment: http://stackoverflow.com/comment/44058718
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44058195
tagged with: datetime
has comment: http://stackoverflow.com/comment/44058853
type: Question
has body: Is there any way of manipulate datetime in JavaScript?? I mean, I would like to get a datetime and change to this format ('DD/MM/YYYY hh:mm A/PM'). This is my code $('#control_day_edit').val(calEvent.start._i) This returns me this: 01/07/2015 05:11 PM But I need it returns me this: 07/01/2015 05:11 PM

http://stackoverflow.com/comment/44126724
type: Comment
has text: @neelabhsingh, I have added a working demo: http://jsfiddle.net/ezanker/Lb2m318p/
comment on: http://stackoverflow.com/a/27848249
score: 0
type: AnswerComment

http://stackoverflow.com/a/50242896
has body: I would like to present a pretty simple ES5 alternative. The function gets 2 parameters - target and source that must be of type "object". Target will be the resulting object. Target keeps all its original properties but their values may be modified though. function deepMerge(target, source) { if(typeof target !== 'object' || typeof source !== 'object') return false; // target or source or both ain't objects, merging doesn't make sense for(var prop in source) { if(!source.hasOwnProperty(prop)) continue; // take into consideration only object's own properties. if(prop in target) { // handling merging of two properties with equal names if(typeof target[prop] !== 'object') { target[prop] = source[prop]; } else { if(typeof source[prop] !== 'object') { target[prop] = source[prop]; } else { if(target[prop].concat &amp;&amp; source[prop].concat) { // two arrays get concatenated target[prop] = target[prop].concat(source[prop]); } else { // two objects get merged recursively target[prop] = deepMerge(target[prop], source[prop]); } } } } else { // new properties get added to target target[prop] = source[prop]; } } return target; } cases: if target doesn't have a source property, target gets it; if target does have a source property and target &amp; source are not both objects (3 cases out of 4), target's property gets overriden; if target does have a source property and both of them are objects/arrays (1 remaining case), then recursion happens merging two objects (or concatenation of two arrays); also consider the following: array + obj = array obj + array = obj obj + obj = obj (recursively merged) array + array = array (concat) It is predictable, supports primitive types as well as arrays and objects. Also as we can merge 2 objects, I think that we can merge more than 2 via reduce function. take a look at an example (and play around with it if you want): var a = { "a_prop": 1, "arr_prop": [4, 5, 6], "obj": { "a_prop": { "t_prop": 'test' }, "b_prop": 2 } }; var b = { "a_prop":…
score: 11
downvote count: 0
answers question: http://stackoverflow.com/q/27936772
upvote count: 11
type: Answer

http://stackoverflow.com/comment/44173672
type: AnswerComment
has text: Yes thank you, this solves it. As others have pointed, I was having trouble because the cursor would start after the first match. The while loop solves it.
type: Comment
comment on: http://stackoverflow.com/a/27886162
score: 0

http://stackoverflow.com/a/27858277
has body: http://www.w3.org/2000/svg is not only an URL it is an XML namespace. XML namespaces can be URLs and must be URIs. An example for an namespace that is not an URL would be urn:ietf:params:xml:ns:vcard-4.0. The page is not meaningless. It contains informations about the XML namespace and links. XML namespaces define the format/standard an element or attribute node is part of. They have to be unique, using a domain as a part of it avoids conflicts and allows for some documentation. The reason for you problem might be that you open the html file directly from the file system and the HTTP headers are missing. This changes how a browser handles a file. How depends on the browser the OS and the file.
upvote count: 2
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27854409
score: 2
answers question: http://stackoverflow.com/q/27854409
downvote count: 0

http://stackoverflow.com/comment/44081423
has text: When is `onClipHandle` firing? Is the DOM ready yet?
score: 0
comment on: http://stackoverflow.com/q/27838505
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44063452
score: 1
type: AnswerComment
type: Comment
has text: And why would that consume memory ?
comment on: http://stackoverflow.com/a/27828731

http://stackoverflow.com/q/27880947
tagged with: javascript
tagged with: callback
score: 0
has comment: http://stackoverflow.com/comment/44163521
has body: I'm building an MVC application in Node, Express, Request...etc with a controller to repository stack. In the repo, I'm connecting with request (Simplified HTTP request client) to an external API that returns JSON. I have the following code: // The repository var request = require('request'); module.exports.getById= function (id) { var options = { url: 'http://myurl...' + id, headers: { 'Accept': 'application/json', 'Accept-Language': 'en-US', } }; request(options, callback); function callback(error, response, body) { if (!error &amp;&amp; response.statusCode == 200) { var data = JSON.parse(body); return data; } else { res.send(404); // HTTP STATUS console.log("ERROR: " + error); } } }; // The Service var myRepository = require('../repositories/myRepository'); module.exports.getById = function (id) { return myRepository.getById(id); }; How do I return data to the service, that returns it to the controller that renders it in the view? Return data from within the callback doesn't work. It also seems that I can't pass an additional callback method to the request callback in order to return it.
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44164431
tagged with: request
tagged with: node.js
linked to: http://stackoverflow.com/q/6847697
type: Question
duplicate of: http://stackoverflow.com/q/6847697
has title: Return value from node request callback
has comment: http://stackoverflow.com/comment/44164804

safari
tags question: http://stackoverflow.com/q/27926351
tags question: http://stackoverflow.com/q/27945283
tags question: http://stackoverflow.com/q/27830644
tags question: http://stackoverflow.com/q/27864314
tags question: http://stackoverflow.com/q/27938185
tags question: http://stackoverflow.com/q/27875929
tags question: http://stackoverflow.com/q/27855802
type: Tag
tags question: http://stackoverflow.com/q/27863009
tags question: http://stackoverflow.com/q/27837068
tag name: safari

http://stackoverflow.com/q/27946411
has body: I am absolutely new in JavaScript and I have the following problem. For some reason in a web page I have 2 input tag having type=submit, these: &lt;input type="submit" onclick="return myTestFunction();" value="Submit" id="submitEventButton"&gt; &lt;input id="submitButton" type="submit" style="display:none" onclick="return validateForm();" value="Submit" name="action:projectCreationAction"&gt; As you can see the second one is hidden by the use of style="display:none" Clicking on the first one I can enter into the myTestFunction() JavaScript method (that actually simply perform an alert). I need to do the following thing: when the user click on the first button (the one having id="submitEventButton") automatically the hidden second button have to be clicked. How can I do it? Thanks!
has comment: http://stackoverflow.com/comment/44287861
type: Question
has comment: http://stackoverflow.com/comment/44287920
downvote count: 0
tagged with: http://stackoverflow.com/tag/xhtml
tagged with: javascript
has title: How can automatically click on an hidden submint input tag when the user click on another shown input tag?
tagged with: jquery
has answer: http://stackoverflow.com/a/27946482
answer count: 3
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27946482
favorite count: 0
has answer: http://stackoverflow.com/a/27946529
upvote count: 1
possible better answer: http://stackoverflow.com/a/27946529
has comment: http://stackoverflow.com/comment/44287904
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27946684
score: 1

http://stackoverflow.com/a/27931858
has comment: http://stackoverflow.com/comment/44261607
has comment: http://stackoverflow.com/comment/44261388
has comment: http://stackoverflow.com/comment/44261659
has body: The working of your snippet is also depends on the event you call from , try to call your function on keydown. Below is your working code : document.body.addEventListener("keydown",function(e) { if (e.keyCode === 191) alert('Correct'); else alert('wrong'); }); keyCode may vary for different key events.
has comment: http://stackoverflow.com/comment/44261444
answers question: http://stackoverflow.com/q/27931610
has comment: http://stackoverflow.com/comment/44261777
has comment: http://stackoverflow.com/comment/44261923
score: 0
type: Answer

http://stackoverflow.com/a/27922233
answers question: http://stackoverflow.com/q/27922164
type: Answer
score: 0
has body: You should check if the element is already visible, like: if($(".content").is(':visible')) { $(".content").hide(); } and then show fadeIn with the new content.

http://stackoverflow.com/a/27818571
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27818307
type: Answer
accepted answer of: http://stackoverflow.com/q/27818307
has body: Strings are evaluated against the scope during an apply/digest cycle to check for changes. Functions are simply called during an apply/digest cycle to check for changes. Therefore, passing a string s is equivalent to passing a function like function () { return $scope.$eval(s); } passing $scope.someVar will result in one of the above depending on whether $scope.someVar evaluates to a string or a function. It will not set up a watch for the someVar variable unless $scope.someVar is the string "someVar" or a function which returns $scope.someVar.
score: 1

http://stackoverflow.com/comment/44273147
type: Comment
type: QuestionComment
has text: they are loaded dynamiccally, not fixed numbers
comment on: http://stackoverflow.com/q/27938332
score: 0

http://stackoverflow.com/q/27848540
has answer: http://stackoverflow.com/a/27849571
answer count: 4
score: 1
upvote count: 1
has body: I have the following problem when wanting to get the cell of a table where a change event is not achieving its procurement. Any idea how to get it , it would be well received . 1 $("tbody tr td input:checkbox").change(function() { id = $(this).parent().parent().children().index(this.parentNode); alert(id); });
type: Question
has answer: http://stackoverflow.com/a/27849290
has title: Failed to get a table cell
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44101195
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27848927
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44102220
has answer: http://stackoverflow.com/a/27849358

http://stackoverflow.com/a/32701484
has body: I figured a way to make this work. In your ~/.bash_rc file or ~/.zsh_rc add this line: export NODE_PATH=`which node` Open new shell or run this source ~/.bash_rc to pick up the changes
type: Answer
score: 25
upvote count: 27
has comment: http://stackoverflow.com/comment/135673131
has comment: http://stackoverflow.com/comment/64854037
has comment: http://stackoverflow.com/comment/108412132
answers question: http://stackoverflow.com/q/27876557
downvote count: 2

http://stackoverflow.com/comment/44172560
type: Comment
type: QuestionComment
has text: Essentially because, in my actual code, the element removal is in an entirely different scope from the timer, i.e. I use Angular directives to call functions that draw and remove D3 graphs, while having the actual drawing and animation code in D3-only classes. As such, I'd prefer a timer that can check the continued existence of its associated element by itself, but I guess I'll use a workaround to do what you've suggested if there's no other way.
comment on: http://stackoverflow.com/q/27883455
score: 0

http://stackoverflow.com/comment/44265982
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27932620
type: AnswerComment
has text: Thanks for the answer and providing the demo. This is what I needed.

http://stackoverflow.com/comment/44266827
type: QuestionComment
has text: They are not, each one has a "src" attribute pointing to an endpoint exposed in our asp.net application. Each image (and it's corresponding url) represents a specific page of a specific document. The service does the work of converting the original content (in one of many formats) into a PNG to be sent to the browser. I've added an example of one such PNG generated by our system above, although I'm not sure what additional compression SO/imgur will do to the image.
comment on: http://stackoverflow.com/q/27934411
score: 0
type: Comment

http://stackoverflow.com/q/27893308
tagged with: css
has comment: http://stackoverflow.com/comment/44194226
downvote count: 2
answer count: 1
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
upvote count: 0
has body: I am trying to color tr with .click event using jquery. My code has no problem with coloring the first row which is static, but other rows, created with jQuery don't want to color. I have no idea why is not working on other rows. $(function () { $('tr').click(function () { $(this).toggleClass("obarva"); }); }); Here is my existing code: `http://jsfiddle.net/1mihcc/7okvbkg2/1/
tagged with: jquery
has title: Coloring tr with jQuery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27893321
tagged with: http://stackoverflow.com/tag/html
score: -2

http://stackoverflow.com/comment/44062724
type: QuestionComment
comment on: http://stackoverflow.com/q/27828360
score: 2
has text: What does `validate()` return? It could be working on a 'truthy' value.
type: Comment

http://stackoverflow.com/comment/44103784
type: QuestionComment
comment on: http://stackoverflow.com/q/27849805
has text: what do you mean by "exported it" ?, and if this is the only code you have, this should throw a ReferenceError I guess
score: 0
type: Comment

http://stackoverflow.com/comment/44137203
score: 1
has text: You must add `dataType: "json"` to your `$.ajax` options.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27867307

http://stackoverflow.com/comment/44321151
has text: also inject the scope in your controller app.controller('imageController', function($scope){ $scope.imageList = imageJson; });
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27963212
type: Comment

http://stackoverflow.com/q/27832133
has comment: http://stackoverflow.com/comment/44070611
answer count: 3
has comment: http://stackoverflow.com/comment/44070340
has title: What is the regular expression to extract 123+43 from the String 'What is (123+43)?' in the regular expression extractor of JMeter?
has comment: http://stackoverflow.com/comment/44070390
has comment: http://stackoverflow.com/comment/44070551
has comment: http://stackoverflow.com/comment/44070530
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/44070654
has comment: http://stackoverflow.com/comment/44070269
has answer: http://stackoverflow.com/a/27833662
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44070510
has comment: http://stackoverflow.com/comment/44070122
has comment: http://stackoverflow.com/comment/44070161
has comment: http://stackoverflow.com/comment/44070233
tagged with: jmeter
has comment: http://stackoverflow.com/comment/44070478
has comment: http://stackoverflow.com/comment/44070701
has body: The actual html response contains large data among which the following piece of line comes in between What is (123+43)? The numbers within the braces vary each time and also the arithmetic operand. So How can I get the whole string within the braces using regex extractor in JMeter? I used What is /(([^)]+))/ but I am not getting anything. Also I would like to know how to perform the arithmetic operation in JMeter after extracting the String and assign it to a variable. I tried using JSR233 preprocessor, but I don't know how to send back the result to the next Http Request. PS: The closest I could achieve for extracting the expression from "What is (123+43)?" is What is (.+?\)) But it gives output as (123+43). I want to remove the braces as well. That is were I am struck. The place I added regex https://i.sstatic.net/QtugV.png
tagged with: java
has comment: http://stackoverflow.com/comment/44070439
has comment: http://stackoverflow.com/comment/44070524
downvote count: 1
has comment: http://stackoverflow.com/comment/44070516
type: Question
tagged with: testing
has comment: http://stackoverflow.com/comment/44070159
has answer: http://stackoverflow.com/a/27832514
has comment: http://stackoverflow.com/comment/44070313
has answer: http://stackoverflow.com/a/27832510
upvote count: 0
has comment: http://stackoverflow.com/comment/44070723
has comment: http://stackoverflow.com/comment/44070630
tagged with: javascript

http://stackoverflow.com/comment/44353673
score: 1
comment on: http://stackoverflow.com/a/27959783
has text: To be able to create files in the console and use them immediately.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27860355
accepted answer: http://stackoverflow.com/a/27860597
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
score: 1
has title: Gulp.js - Inject project details at the beginning of the file
type: Question
has answer: http://stackoverflow.com/a/27860597
downvote count: 0
answer count: 1
tagged with: javascript
has body: At the beginning of my JavaScript file I have a comment that host the project details like this: // { project name } // { project website } // { author } For instance it should look like this /// FoobarProject 2.0.1 /// www.foobar.com/foobarproject /// John Doe &lt;john.doe@hotmail.com&gt; ;(function(){ //... }()); What is the best way to align these details with my package.json? So when I update the version in the package.json and execute my "build" task, gulp should update the version. I do not like the idea to have two file: File "A" that uses placeholders (e.g. {{ version }}) File "B" that is the outcome of the build process where placeholders are populated with the values. I prefer the approach that the build-task replaces the values in my file directly. Furthermore after the minifier (uglify) is executed this comment should be prefixed. So my question boils down to: What is the best approach to implement "replaceFirstThreeLinesWith": gulp.task('inject-projectdetails', function(){ var header = [ util.format('// FoobarModule.js %s', pkg.version), util.format('// %s', pkg.homepage), util.format('// %s', pkg.author), ].join(''); return gulp.src('FoobarModule.js') .pipe( replaceFirstThreeLinesWith(header) ) .pipe(gulp.dest('.') ); });
tagged with: gulp
favorite count: 0

http://stackoverflow.com/comment/44207758
type: Comment
score: 0
type: AnswerComment
has text: Some data is there, I've ran the test provided by lib, [here](http://web.ist.utl.pt/antonio.afonso/www.aadsm.net/libraries/id3/), for checking `ID3` tags and the results are `{"Track": "1/12", "Comment":"", "Lyrics": ""}`. So using `console.log(tags)` should print something instead of `{}`, right?
comment on: http://stackoverflow.com/a/27904199

http://stackoverflow.com/comment/44148873
has text: @SurgeonofDeath - well, yeah! `window.open` works for everyone, just not the OP apparantly, and showing that it works in a fiddle doesn't really help the OP at all?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27873228

http://stackoverflow.com/q/27907249
has title: Shipping Cost Estimator Code
score: 0
has comment: http://stackoverflow.com/comment/44213762
has body: Our website would like to implement an "estimated shipping cost" feature on our product skus. What is the best approach given that our back-end provider (Volusion) doesn't offer the feature? I'm posting a link to a product on Amazon that shows what we want (notice the "+ 54.99 shipping" in the pricing area): http://www.amazon.com/Count-Simpson-Strong-Tie-ABU88-Standoff/dp/B00K23390I/ref=sr_1_8?ie=UTF8&amp;qid=1421081979&amp;sr=8-8&amp;keywords=abu88 The javascript they appear to be using is here: &lt; script type = "text/javascript" &gt; P.when("jQuery").execute(function($) { var form = $("#addToCart"), thirdParty = $("#soldByThirdParty"), args = { a: form.find("[name=ASIN]").val(), me: form.find("[name=merchantID]") .val() }; $('#selectQuantity [name="quantity"]').change( function() { args.qt = this.value; $.get("/gp/product/du/quantity-sip-update.html", args, function(data) { data = $(data); thirdParty.find(".price3P").html(data.filter(".price").text()); thirdParty.find(".shipping3P").html(data.filter(".plusShippingText").text()); } ); } ); }); &lt; /script&gt;
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/44213855
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44187225
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27892932
has text: I like to use services when interacting with the backend, so the controller can be free of any logic. You could create a service that uses Angular's $http service (https://docs.angularjs.org/api/ng/service/$http) in order to perform a GET operation in your backend and retrieve the data you need.

http://stackoverflow.com/comment/44112476
comment on: http://stackoverflow.com/q/27854446
score: 0
type: Comment
type: QuestionComment
has text: $("#selectboxId").attr('disable', false);

http://stackoverflow.com/comment/108267629
type: AnswerComment
comment on: http://stackoverflow.com/a/34186494
type: Comment
has text: May I know where I need to place this code to make sure this is called for every require call (typescript)?
score: 0

http://stackoverflow.com/comment/44304750
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27953777
has text: It was to show that ```margin: 0 auto;``` works to keep it in place, not to be an end all solution. The OP specifies the top margin explicitly, so that margin can be applied again, and it'll be centered.

http://stackoverflow.com/q/27836010
score: 0
has comment: http://stackoverflow.com/comment/44076954
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44076804
has title: Javascript/Jquery Help - Wordpress
has comment: http://stackoverflow.com/comment/44076734
type: UnansweredQuestion
tagged with: wordpress
type: Question
has answer: http://stackoverflow.com/a/27842753
has body: A snippet of my JS below - jQuery(document).ready(function() { jQuery.wiseguys(); }); // plugin structure used so we can use the "$" sign safely (function($) { // class constructor / "init" function $.wiseguys = function() { } })(jQuery); There is some code I have taken out and obviously code under the $.wiseguys function - but when run in Wordpress, it returns a Type Error - Undefined is not a function. I have not idea why - any thoughts? It works perfectly fine in static HTML, just not when integrated into Wordpress
has comment: http://stackoverflow.com/comment/44076698

http://stackoverflow.com/comment/44294304
score: 0
type: Comment
has text: It does not work!!! Your browser does not support the audio element.
type: AnswerComment
comment on: http://stackoverflow.com/a/27949366

http://stackoverflow.com/comment/44266166
type: Comment
has text: Just point your browser to `http://yourdomain.com/api/schools` and look at the JSON directly. That's what Angular is trying to parse.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27931390

internet-explorer
tags question: http://stackoverflow.com/q/27947912
tags question: http://stackoverflow.com/q/27919233
tags question: http://stackoverflow.com/q/27813731
tags question: http://stackoverflow.com/q/27961563
tags question: http://stackoverflow.com/q/27948319
tags question: http://stackoverflow.com/q/27883790
tag name: internet-explorer
tags question: http://stackoverflow.com/q/27905762
tags question: http://stackoverflow.com/q/27949506
tags question: http://stackoverflow.com/q/27905238
tags question: http://stackoverflow.com/q/27930870
tags question: http://stackoverflow.com/q/27941693
tags question: http://stackoverflow.com/q/27934411
tags question: http://stackoverflow.com/q/27829233
tags question: http://stackoverflow.com/q/27869356
tags question: http://stackoverflow.com/q/27841718
tags question: http://stackoverflow.com/q/27886618
tags question: http://stackoverflow.com/q/27837370
tags question: http://stackoverflow.com/q/27827616
tags question: http://stackoverflow.com/q/27812173
tags question: http://stackoverflow.com/q/27963400
tags question: http://stackoverflow.com/q/27907363
tags question: http://stackoverflow.com/q/27901159
tags question: http://stackoverflow.com/q/27876078
tags question: http://stackoverflow.com/q/27819620
tags question: http://stackoverflow.com/q/27835687
tags question: http://stackoverflow.com/q/27844407
tags question: http://stackoverflow.com/q/27902672
tags question: http://stackoverflow.com/q/27898232
tags question: http://stackoverflow.com/q/27837351
tags question: http://stackoverflow.com/q/27839766
tags question: http://stackoverflow.com/q/27872540
tags question: http://stackoverflow.com/q/27947869
type: Tag
tags question: http://stackoverflow.com/q/27853445
tags question: http://stackoverflow.com/q/27898745
tags question: http://stackoverflow.com/q/27902416
tags question: http://stackoverflow.com/q/27880453
tags question: http://stackoverflow.com/q/27945553
tags question: http://stackoverflow.com/q/27820636
tags question: http://stackoverflow.com/q/27900108
tags question: http://stackoverflow.com/q/27814920

http://stackoverflow.com/a/27837157
answers question: http://stackoverflow.com/q/27836535
score: 0
has comment: http://stackoverflow.com/comment/45149169
has body: var fit_start_time = $("#datepicker_from").val(); var fit_end_time = $("#datepicker_to").val(); var a = fit_start_time.split('/'); var start = new Date(a[2], a[1] - 1, a[0]); var b = fit_end_time.split('/'); var end = new Date(b[2], b[1] - 1, b[0]); if (start &gt; end) { } If your date separator is different than "/" then use your's in above code.
has comment: http://stackoverflow.com/comment/44111814
type: Answer
has comment: http://stackoverflow.com/comment/44110811

http://stackoverflow.com/comment/44029976
score: 0
comment on: http://stackoverflow.com/a/27810563
type: AnswerComment
type: Comment
has text: I see. I was building the code incrementally and wanted to test the functionality to clear the canvas first. Thank you for the input.

http://stackoverflow.com/comment/44186092
has text: Try `data: {value:"on"},`
comment on: http://stackoverflow.com/q/27892441
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27900738
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has body: I am creating a file picker using the skydrive/onedrive api I get a list of files using the url: https://apis.live.net/v5.0/'+folder_path+'/files?access_token='+onedrive_access_token But this doesn't return a thumbnail for the files (unlike other api's, googledrive for example). I would like to get a thumbnail for each file, if it exists. I cant find anywhere in the docs how to do this - is there a way I can?
type: Question
has answer: http://stackoverflow.com/a/28315802
has title: onedrive/ skydrive api - get file thumbnails
tagged with: javascript

http://stackoverflow.com/q/27871537
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: video
has answer: http://stackoverflow.com/a/27871983
has title: How to randomize video on click and on page load
type: Question
has answer: http://stackoverflow.com/a/27872002
has body: I have been scratching my head for a few days now with this one. Just trying to get better at javascript but no one seems to be able to figure out what I am doing wrong here. What I want is to create a data structure or array containing videos On page load I would like a random video to be loaded and begin playing After this I would like the user to be able to click the video to initiate the math.random and generate a new video in its place. Issues - 1 - With the code I have whenever I click to randomize the video just disappears no console errors or anything. 2 - The page doesn't randomize on load 3 - I am not sure if this is the best way to go about as far as data structure is concerned? This doesn't seem logically like a hard problem to solve but for me its been a real head scratcher. Any help is greatly appreciated!! HTML Your browser does not support the video element. JavaScript //Array of Videos var videos = [ [{type:'mp4', 'src':'videos/1.mp4'}, {type:'webm', 'src':'videos/1.webm'}], [{type:'mp4', 'src':'videos/2.mp4'}, {type:'webm', 'src':'videos/2.webm'}], ]; //onClick + Action $(function() { $('a.click').click(function(e) { e.preventDefault(); var randomIndex = parseInt(Math.random()*videos.length); $(this).find('videos').append(' '); }); }); //onLoad Randomize function getRandomVideo() { var number = Math.floor(Math.random()*video.length); document.write(' '); } $(function() { $('a.click').click(function(e) { e.preventDefault(); console.log("hello world"); var number = Math.floor(Math.random()*videos.length); $(this).html(' '); }); });
score: 0
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/27867706
tagged with: comments
accepted answer: http://stackoverflow.com/a/28137076
downvote count: 0
answer count: 1
tagged with: google-plus
favorite count: 0
has title: What might be causing Google+ Comments in Blogspot not to work on certain pages?
type: AnsweredQuestion
score: 1
tagged with: blogger
has answer: http://stackoverflow.com/a/28137076
upvote count: 1
tagged with: blogspot
type: Question
has body: I'm working on a blogspot custom template, and am adding compatibility with Google+ comments. In order to do that, I've included the following tag in the template code to allow these kind of comments to be displayed in each post of the blog: With this I've managed to present Google+ Comments associated to each blog post, but I've found out that this is not working with blog pages, and blog pages only. So far I've checked the template flow, and confirmed it is accessed correctly while presenting both blogs and pages. Proof is that, while examining the resulting HTML code, I can see this div element in both types of publication. The difference, though, is that in blog posts it has included the comments iframe, while the div element in the blog pages is empty. Here is an example: Blog page: Blog post: ... Both initial parameters, as included in the template, are correct in both pages and posts: expr:data-href translates into the URL of the post or page, which is correct in both cases. expr:data-viewtype translates into FILTERED_POSTMODin both cases as well. I've searched for information related to the id='undefined' attribute obtained in the blog page cases, against the id='gpluscomments' tag obtained in posts, but so far I've had no luck. I'm pretty sure there is an error in the communication between the blog and Google+, but at least the parameters in the tag, which seems to be the only input these comments have, look good, and are the same in both cases. Why could I be obtaining this behavior? What could I further test to figure it out? Any ideas? Thanks in advance, and have a nice day! Erizo
tagged with: javascript

http://stackoverflow.com/comment/44309585
type: QuestionComment
has text: Not yet.. i will update once i will find it. Its working with core PHP. But facing problem with codeigniter view page.
comment on: http://stackoverflow.com/q/27905962
score: 0
type: Comment

http://stackoverflow.com/comment/44144911
type: QuestionComment
has text: Try this instead of `data`: `'{ "type" : ' + category + ' }';`. This is an obscure case, make sure `data` variable is not duplicated or at least change its name to `_data`
score: 0
comment on: http://stackoverflow.com/q/27871123
type: Comment

http://stackoverflow.com/comment/44229208
has text: Awesome. I think it would be best if you could create a small self-contained html-only demo of your problem (eg, remove all those mysql queries) so that we can see it in action. At the moment it's really hard to figure out exactly where the problem lies because we still don't have the full picture and can't execute the code.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27914450
score: 0

http://stackoverflow.com/a/27891001
type: Answer
has body: What I want to happen is when the ".slick-next" button is clicked, the browser waits 3 seconds and then runs the loadPHP() function We could do this easily by setting a function as event handler bound to event click: $(".slick-next").on("click",function(){ setTimeout(function() { loadPHP(); }, 3000); }); The problem with your code was that you were firing the click event by calling the click function $(".slick-next").click()
score: 0
answers question: http://stackoverflow.com/q/27883641

http://stackoverflow.com/q/27909805
type: Question
has answer: http://stackoverflow.com/a/27909880
score: 1
has title: Updating Button Icon In Bootstrap
has comment: http://stackoverflow.com/comment/44219228
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44219233
favorite count: 0
accepted answer: http://stackoverflow.com/a/27909880
type: AnsweredQuestion
tagged with: twitter-bootstrap
upvote count: 1
has body: I have an app that uses Bootstrap 3. In that app, I have a menu aligned to the right of the screen. That menu can be seen in this fiddle. The code for the menu looks like this: Home Profile Messages Settings The text beside each icon is not centered vertically. My real problem though is, when a user chooses a menu item, I want to update the icon that's shown in myDrop. The icon in myDrop should change to be the icon of the chosen menu item. I was able to get the text by using the following: $('#myMenu li a').on('click', function () { var $this = $(this); var parent = $this.closest('li'); var target = $this.data('target'); var btn = $this.closest('.dropdown').find('.btn.dropdown-toggle'); var str = $this.text() + " "; parent.siblings().removeClass('active'); parent.addClass('active'); btn.html(str); $('#myTab a[href="' + target + '"]').tab('show'); }); This selects the text though. It does not use the icon. I tried using jQuery's .find function. However, I kept getting undefined. I'm not sure what I was doing wrong.

http://stackoverflow.com/comment/44042980
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27818260
has text: @TrueBlueAussie Agreed however I assume this is more about learning how callbacks work.
score: 0

http://stackoverflow.com/q/27886404
type: Question
has title: Authentication before opening a Websocket
has comment: http://stackoverflow.com/comment/44175536
answer count: 1
tagged with: websocket
tagged with: javascript
has body: What is the State-of-the-art way to secure a websocket with authentication? The problem is, that everybody can download the js file and see the host and port to which websocket the page connects. The only way which comes to my mind is: open a wss(secure websocket) and send for example credentials and close the connection on the server-side if the credentials are wrong?
has comment: http://stackoverflow.com/comment/44175330
upvote count: 3
has comment: http://stackoverflow.com/comment/44175404
has comment: http://stackoverflow.com/comment/44175463
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44175174
tagged with: node.js
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/27887975

http://stackoverflow.com/q/27848972
has comment: http://stackoverflow.com/comment/44102084
answer count: 1
has comment: http://stackoverflow.com/comment/44102324
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/44101983
has comment: http://stackoverflow.com/comment/44102334
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44102560
has comment: http://stackoverflow.com/comment/44102358
has comment: http://stackoverflow.com/comment/44102310
has comment: http://stackoverflow.com/comment/44102035
has comment: http://stackoverflow.com/comment/44102365
has comment: http://stackoverflow.com/comment/44102406
tagged with: php
has comment: http://stackoverflow.com/comment/44102242
has comment: http://stackoverflow.com/comment/44102204
has answer: http://stackoverflow.com/a/27850435
has comment: http://stackoverflow.com/comment/44101962
has comment: http://stackoverflow.com/comment/44102738
has comment: http://stackoverflow.com/comment/44102528
has title: PHP AJAX JSON autosuggest
type: Question
has body: I cannot get the dropdown field to "autosuggest". I have my main page, which is bpSearch.php, where I have a modal window with an input field that, when you begin typing, it should autosuggest data that is being called from my search file. Here is the input inside the modal: &lt;input type="text" class="autosuggest" id="partnerName" name="partnerName" placeholder="Partner Name" /&gt; &lt;div class="dropdown"&gt; &lt;ul class="result"&gt;&lt;/ul&gt; &lt;/div&gt; Here is my javascript, called searchPartner.js, that is sending the RESULT to the search file: $(document).ready(function() { $('.autosuggest').keyup(function() { var search_term = $(this).attr('value'); $.post('api/searchPartner.php', {search_term:search_term}, function(data) { $('.result').html(data); $('.result li').click(function() { var result_value = $(this).text(); $('.autosuggest').attr('value', result_value); }); }); }); }); And here is my search file, called searchPartner.php. As you can see in the JavaScript, it is located in a folder called api. Perhaps I'm not traversing to the directory correctly? Here is searchPartner.php: &lt;?php include("../include/database.php"); if(isset($_POST['search_term']) == true &amp;&amp; empty($_POST['search_term']) == false) { $search_term = mysqli_real_escape_string($_POST['search_term']); $search = "SELECT PARTNER_CODE, FULL_NAME FROM partner WHERE FULL_NAME LIKE '$search_term%'"; $query = mysqli_query($dbc, $search); while(($row = mysqli_fetch_assoc($query)) !== false) { echo '&lt;li&gt;', $row['FULL_NAME'], '&lt;/li&gt;'; } } ?&gt; I know this query works, because I've opened the page, commented out the IF statement, and I can see the LI tags with the $row{'FULL_NAME']. So all I need to do is get my main page to retrieve this data when the user begins typing.
has comment: http://stackoverflow.com/comment/44102710
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0

http://stackoverflow.com/a/27846818
answers question: http://stackoverflow.com/q/27846711
downvote count: 0
has body: You probably just want this: $('#menu-toggle').click(function() { $(this).toggleClass('menu-toggle-active'); }); You only really need on() if your element doesn't exist at page load. If you do in fact need it, do this: $(document).on('click', '#menu-toggle', function() { ... });
has comment: http://stackoverflow.com/comment/44099270
score: 1
has comment: http://stackoverflow.com/comment/44098771
has comment: http://stackoverflow.com/comment/44098364
has comment: http://stackoverflow.com/comment/44098490
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44099040
has comment: http://stackoverflow.com/comment/44098310
has comment: http://stackoverflow.com/comment/44098208
has comment: http://stackoverflow.com/comment/44098405
has comment: http://stackoverflow.com/comment/44098694

http://stackoverflow.com/a/27970904
answers question: http://stackoverflow.com/q/27921369
has body: So Finally after lot of struggle i got the answer, Fileupload binds the action to the html once it is loaded, so if you add a new html to the page , for each element you have to bind the fileupload again.( you can also use live action to add events to button, in that case you do not need to bind again) var dofileupload = function(){ $('#fileupload').fileupload({ url: '/attachments/create', dataType: 'json', done: function (e, data) { alert("done"); }, }); } $('#override_button').click(function(){ alert("hello") $('#hello12').after('\ Add Attachments... ') }).each(function () { dofileupload } This solves my problem
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27921369

http://stackoverflow.com/comment/44049499
type: QuestionComment
has text: I fully agree with @MarcB. However, this needs 'a little' basic understand of relational side of MySQL database.
comment on: http://stackoverflow.com/q/27821810
score: 1
type: Comment

http://stackoverflow.com/comment/44252063
has text: added `$scope.showNotif`
comment on: http://stackoverflow.com/q/27927249
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44274095
score: 0
comment on: http://stackoverflow.com/a/27928161
type: AnswerComment
has text: ng-if has the same behaviour. :( It generates : [code] [/code]
type: Comment

http://stackoverflow.com/q/27854957
has comment: http://stackoverflow.com/comment/44113580
favorite count: 0
linked to: http://stackoverflow.com/q/12489546
type: Question
has comment: http://stackoverflow.com/comment/44113551
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44824805
has comment: http://stackoverflow.com/comment/44113517
has answer: http://stackoverflow.com/a/27855022
downvote count: 4
has body: function get_browser() { var N = navigator.appName, ua = navigator.userAgent, tem; var M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); if (M &amp;&amp; (tem = ua.match(/version\/([\.\d]+)/i)) !== null) M[2] = tem[1]; M = M ? [M[1], M[2]] : [N, navigator.appVersion, '-?']; return M[0]; } *Its edited and no longer a Question *
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27855022
score: -3
has title: Uncaught TypeError: Cannot read property '1' of undefined during get browser function
type: AnsweredQuestion

http://stackoverflow.com/comment/44230986
comment on: http://stackoverflow.com/q/27916187
has text: Yep you can scroll using javascript to a div with id on page load.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27875085
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44151871
has comment: http://stackoverflow.com/comment/44151808
has comment: http://stackoverflow.com/comment/44152014
has answer: http://stackoverflow.com/a/27875422
has comment: http://stackoverflow.com/comment/44152516
has comment: http://stackoverflow.com/comment/44151887
score: 0
linked to: http://stackoverflow.com/q/12627443
has comment: http://stackoverflow.com/comment/44152985
has comment: http://stackoverflow.com/comment/44152087
has comment: http://stackoverflow.com/comment/44153218
accepted answer: http://stackoverflow.com/a/27875422
type: Question
has comment: http://stackoverflow.com/comment/44151940
has comment: http://stackoverflow.com/comment/44151987
has comment: http://stackoverflow.com/comment/44151898
answer count: 1
has comment: http://stackoverflow.com/comment/44151824
has body: I have been bashing my face against a keyboard trying to work out why my javascript code doesnt work inside of ionic. can someone please tell me the way to store a number inside of a variable, display that variable and increase that variable when you click a button.. I have this working no problems on a basic javascript game, but i am trying to incorporate it into ionic.. It is inside of a tab screen does that mean i have to write the javascript different? the below code includes jquery and I don't think ionic will support that easily. But if someone could help me, I just need a way to store a variable (most likely with localforage) and a way to display the variable (span?) and a way to increase taht variable with a click of a button? (with on-tap or onclick?) Thanks heaps I have been bashing my face against the keyboard for 2 days now and it does not work... It's a bit harder to link all my ionic code as it's over much more than just 3 files... var coffee = localStorage.getItem("coffee") ? localStorage.getItem("coffee") : 0.0; var totalCoffee = localStorage.getItem("totalCoffee") ? localStorage.getItem("totalCoffee") : 0.0; var cookRate = localStorage.getItem("cookRate") ? localStorage.getItem("cookRate") : 1.0; function prettify(input){ var output = Math.round(input * 1000000)/1000000; return output; } $("#coffeeButton").click(function(e) { var obj = $("#clone").clone(); var img = $("#myImg").clone(); $("body").append(obj); $("body").append(img); obj.html("+"+ cookRate); coffee += cookRate; totalCoffee += cookRate; document.getElementById("coffee").innerHTML = prettify(coffee); document.getElementById("totalCoffee").innerHTML = prettify(totalCoffee); obj.css('position','absolute'); obj.css('z-index', '2'); img.css('position','absolute'); img.show(); obj.offset({left: e.pageX-10, top: e.pageY-80}); img.offset({left: e.pageX-10, top: e.pageY-50}); obj.animate({"top": "-=80px"}, 1000, "linear", function() { $(this).remove(); }); img.animate({"top": "-=80px"}, 1000, "…
tagged with: javascript
has comment: http://stackoverflow.com/comment/44152270
has comment: http://stackoverflow.com/comment/44152172
linked to: http://stackoverflow.com/q/11213259
has comment: http://stackoverflow.com/comment/44151847
has comment: http://stackoverflow.com/comment/44152248
has comment: http://stackoverflow.com/comment/44151970
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44151877
has comment: http://stackoverflow.com/comment/44152060
has comment: http://stackoverflow.com/comment/44152156
has comment: http://stackoverflow.com/comment/44151904
has comment: http://stackoverflow.com/comment/44151976
has comment: http://stackoverflow.com/comment/44152312
has title: calling a javascript function with a button
has comment: http://stackoverflow.com/comment/44151911
has comment: http://stackoverflow.com/comment/44152823
tagged with: css
has comment: http://stackoverflow.com/comment/44152408
has comment: http://stackoverflow.com/comment/44153029

http://stackoverflow.com/a/27827161
has comment: http://stackoverflow.com/comment/44060259
score: 5
accepted answer of: http://stackoverflow.com/q/27827135
answers question: http://stackoverflow.com/q/27827135
type: AcceptedAnswer
upvote count: 5
has body: Before you've added an element to the DOM, you can't search for it with .getElementById(). That call returns null, and that's what the error is telling you. It's pointless to do that anyway, since you've already got variables that refer directly to your newly-created elements. edit oh wait, I see what you're trying to do. First, there's no reason to use .setAttribute() here. Just set properties directly on the DOM nodes you've created. You have to set the "onblur" property to a function: function create() { var textbox=document.createElement("input"); var para=document.createElement("p"); para.id = "p"; textbox.type='text'; textbox.value='asdf'; textbox.id = "textbox"; textbox.onblur = function() { para.innerHTML = textbox.value; }; document.body.appendChild(textbox); document.body.appendChild(para); }
type: Answer
downvote count: 0

http://stackoverflow.com/a/27821840
has body: You can use this: location.assign('../'+location.pathname.substring(location.pathname.lastIndexOf("/") + 1))
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27821262

titanium
type: Tag
tags question: http://stackoverflow.com/q/27943477
tag name: titanium
tags question: http://stackoverflow.com/q/27873528
tags question: http://stackoverflow.com/q/27904518
tags question: http://stackoverflow.com/q/27901767
tags question: http://stackoverflow.com/q/27892761

http://stackoverflow.com/comment/44272656
has text: @a.fauzi So do you mean you cannot change styles of the element containing the text?
comment on: http://stackoverflow.com/q/27927791
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44141824
score: 0
comment on: http://stackoverflow.com/a/27863378
type: AnswerComment
type: Comment
has text: well yes the users choice.. if the user picks the second or third radio button i would like it to still appear when the user closes his browser and reopens it.

http://stackoverflow.com/q/27855755
upvote count: 1
answer count: 1
has body: I want to use my pagination with next, previous, last and start button working. My jquery is: $(document).ready(function(){ $('#table').after('&lt;div id="nav" style="width:800px; margin:0 auto;"&gt;&lt;/div&gt;'); var rowsShown = 2; var rowsTotal = $('#table tbody tr').length; var numPages = rowsTotal/rowsShown; for(var i = 0;i &lt; numPages;i++) { var pageNum = i + 1; $('#nav').append('&lt;a href="#" rel="'+i+'"&gt;'+pageNum+'&lt;/a&gt; '); } $('#table tbody tr').hide(); $('#table tbody tr').slice(0, rowsShown).show(); $('#nav a:first').addClass('active').css("color", "blue"); $('#nav a').bind('click', function(){ $('#nav a').removeClass('active').css("color", "black");; $(this).addClass('active').css("color", "blue");; var currPage = $(this).attr('rel'); var startItem = currPage * rowsShown; var endItem = startItem + rowsShown; $('#table tbody tr').css('opacity','0.0').hide().slice(startItem, endItem). css('display','table-row').animate({opacity:1}, 300); }); }); My jsfiddle is here jsfiddle. And in the pagination i want to see only 3 number remaining should come as i click next button. Can someone help me to solve this question. I tried very hard to solve, search on net but i could not solve. If someone can solve this then please help me. thanks in advance.
accepted answer: http://stackoverflow.com/a/27856706
has comment: http://stackoverflow.com/comment/44116819
has title: I want to use next and previous button in my pagination
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27856706
score: 1

http://stackoverflow.com/q/27892344
has answer: http://stackoverflow.com/a/27893812
answer count: 1
tagged with: highcharts
tagged with: javascript
tagged with: jquery
has body: i've created a highchart and have reached a problem. At the moment the chart does not seem to start exactly at the beginning of the chart-box. How can make my area highchart begin at the chart-box and end where the chart-box is ending? $(function() { $('#chart-container').highcharts({ chart: { type: 'area', renderTo: 'container', margin: [0,0,0,0] }, title: { text: '', x: -20 //center }, subtitle: { text: '', x: -20 }, exporting: { enabled: false }, xAxis: { categories: ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'August', 'Septemper', 'Oktober', 'November', 'December'], "tickWidth": 0, lineWidth: 0, minorGridLineWidth: 0, labels: { enabled: false }, }, yAxis: { gridLineWidth: 0, minorGridLineWidth: 0, title: { text: '' }, labels: { enabled: false }, }, tooltip: { valueSuffix: ' Kr.' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, credits: { enabled: false }, series: [{ showInLegend: false, name: 'Profit', data: [0.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], color: '#cc0000', }] }); }); .t-box { background-color: #fff; border: 1px solid #cccccc; float: left; width: 100%; height: auto; } .chart-box { width: 100%; height: 300px; }
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44185852
has comment: http://stackoverflow.com/comment/44185825
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27893812
has title: set left and right margin in highchart
type: Question

computed-properties
type: Tag
tag name: computed-properties
tags question: http://stackoverflow.com/q/27920514

http://stackoverflow.com/q/27954806
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44317845
linked to: http://stackoverflow.com/q/824349
has comment: http://stackoverflow.com/comment/44312982
tagged with: google-chrome
downvote count: 1
linked to: http://stackoverflow.com/q/3338642
type: Question
has comment: http://stackoverflow.com/comment/44313005
accepted answer: http://stackoverflow.com/a/27961335
has comment: http://stackoverflow.com/comment/44312559
has title: How to clear the Google Chrome address bar?
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/44316264
has comment: http://stackoverflow.com/comment/44313171
favorite count: 0
has body: I need to clear the Google Chrome address bar when I load my extension page in the tab. THIS is my extension, and the address that needs to be cleared looks like this: chrome-extension://&lt;extension-id&gt;/page.html
tagged with: google-chrome-extension
score: 5
has answer: http://stackoverflow.com/a/27961335
has comment: http://stackoverflow.com/comment/44312906
upvote count: 6

http://stackoverflow.com/a/52868053
answers question: http://stackoverflow.com/q/27854705
has body: var somevalue=[{name:"john",country:"spain"},{name:"jane",country:"spain"},{name:"john",country:"italy"},{name:"marry",country:"spain"}]; var uniqueList = _.uniq(somevalue, function (item) {return item.country;}) //from this you will get the required output
has comment: http://stackoverflow.com/comment/92657157
score: 0
type: Answer

http://stackoverflow.com/a/27837394
score: 1
answers question: http://stackoverflow.com/q/27832358
has body: The error you mention is as follows: The problem is that the hidden field is not labelable, as you can read directly from the specifications: 4.10.2 Categories Some elements, not all of them form-associated, are categorized as labelable elements. These are elements that can be associated with a label element. button input (if the type attribute is not in the hidden state) keygen meter output progress select textarea HTML/Elements/input/hidden &lt;input type="hidden"&gt; The hidden state represents a value that is not intended to be examined or manipulated by the user.
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44300277
comment on: http://stackoverflow.com/q/27952162
has text: To be honest, I think what is happening is the intended functionality of Bootstrap's Modals. The scrollbar never appears in the modal itself, always outside. I don't know if maybe you're using an older version of bootstrap (since I don't recognize some of the syntax, like `<i class...>`), but maybe upgrading would fix it. But again, I'm not too sure there's actually an error here.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27845653
has comment: http://stackoverflow.com/comment/46200944
type: Question
has title: Meteor.js: how to delay Meteor.call() until have all data? Is this a scoping issue or an async issue?
has body: I have a Meteor app that I'm building that's a CMS. The idea is that a webpage can have many rows, and in each row, have many articles. The articles have an image, header, and paragraph. To save the images, I'm using the edgee:slingshot package. Since sendFile($img, articlesArray); is asynchronous, the code to Meteor.call() runs before the sendFile($img, articlesArray); finishes. This causes the webPage to be saved in mongodb without any row arrays saved. I am able to create the webPage without the rows (and their articles) in the database even though the console.log shows the webpage being set up correctly (with rows and articles - see bottom screenshot). It's as if the webPageAttributes are not being passed to the Meteor.call(). I am at a loss if this is a scoping problem or an async problem. Here's the generated HTML: Here is the client-side code that runs on form submit: 'submit form': function(e, template) { e.preventDefault(); var articlesArray = []; var rowDivsArray = template.findAll('.row'); _.map(rowDivsArray, function(div) { if (div.getAttribute("id") != null) { articlesArray.push(div); } }); var articles = _.map(articlesArray, function(rowDiv) { var articlesArray = []; _.each(rowDiv, function() { var $rowDiv = $(rowDiv); var $articles = $rowDiv.find('div.article-container'); $.each($articles, function(index, value) { var $img = $(value).find('input:file')[0].files[0]; // console.log("$img: ", $img); var $input = $(value).find('input.form-control'); var $text = $(value).find('textarea'); var $style = $(value).find('input:radio:checked'); var createArticle = function(downloadUrl){ console.log("createArticle() init"); var $article = { img: downloadUrl, header: $input.val(), paragraph: $text.val(), style: $style.val() }; return $article; }; var sendFile = function(img, articlesArray){ var articlesArray = articlesArray; var upload = new Slingshot.Upload("articleImgUpload"); upload.send(img, function (error, downloadUrl) { if (error) { console.log("ERROR in up…
tagged with: javascript
has answer: http://stackoverflow.com/a/28194012
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28194012
tagged with: meteor
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27845736
has answer: http://stackoverflow.com/a/27845736

http://stackoverflow.com/q/27895409
tagged with: javascript
has answer: http://stackoverflow.com/a/27895428
favorite count: 0
has title: Angular: passing data to directive during compile
tagged with: angularjs
upvote count: 2
accepted answer: http://stackoverflow.com/a/27895428
score: 2
type: AnsweredQuestion
tagged with: angularjs-scope
type: Question
tagged with: angularjs-ng-model
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/44191773
downvote count: 0
has body: Trying to do something like this: var data = {some: 'data'} var subcomponent = $compile('&lt;div component-' + componentName + ' ng-model="'+data+'"&gt;&lt;/div&gt;')($scope); $element.find('.container').html( subcomponent[0] ); I get error: Error: [$parse:syntax] Syntax Error: Token 'Object' is unexpected, expecting []] at column 9 of the expression object Object starting at [Object]] Trying to get this data to the link scope. Is there a way I should be going about passing the data to the directive scope?
answer count: 1

http://stackoverflow.com/q/27861117
type: Question
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has body: I'm having a bit of a problem. I have several a tags. I would like to assign a data attribute to each and reference the value of the data attribute using JQuery. I would then like to set the value of a hidden field in my form to this data attribute. However, I am unsure of how to do this. Currently I have this link. Say Hello In my JQuery I would like to be able to get the name value.... Something like this .... $(".myclass").click(function (e) { e.preventDefault(); console.log(e.attr('name')); }); and output the value hello
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27861143
accepted answer: http://stackoverflow.com/a/27861143
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44128430
type: AnsweredQuestion
tagged with: javascript
has title: Add a data attribute to an a tag and retrieve it using JQuery

http://stackoverflow.com/q/27936607
tagged with: javascript
has answer: http://stackoverflow.com/a/27936737
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
has title: Regex To Compare URLs for "functional equality"
has answer: http://stackoverflow.com/a/27936664
has comment: http://stackoverflow.com/comment/44270185
score: 0
type: UnansweredQuestion
has body: The problem I need to compare URL pathnames to determine if two browsers are viewing the same page. I am using document.location.pathname to get the pathname component of the URL and my problem is that this comparison must be very forgiving. Example 1: Values of document.location.pathname that are considered "the same page": 1. /subfolder/index.html 2. /subfolder/ 3. /subfolder 4. /subfolder/index.html?something=something#somewhere Example 2: A second set of pathname values that are the same page, this time without a subfolder: 1. / 2. /index.html 3. Important Notes: In the second example, #3 is literally nothing; the pathname may be nil, but the server will still add "index.html" while trying to resolve the resource specifier. When a file is omitted from the URL, the page may be any index.[something] page. It could be index.php, index.aspx, index.html, index.htm, etc. index.html and index.php cannot match. Nor can /somefolder/about.html match /somefolder, although /somefolder/index.php could match /somefolder. (You get the idea). What I Need I can write a massive chunk of JavaScript to do this, but I know there must be a nice, concise way to do it with RegEx. Googling turned up nothing but "how to match a URL pattern with Regex" junk, which is not too helpful. I'm hoping someone fluent in RegEx can help. Thanks. NB: Pure-JavaScript solutions only, please. No jQuery or other libraries; I don't have access to them in this scenario.
has comment: http://stackoverflow.com/comment/44270275
type: Question
answer count: 2
tagged with: url

http://stackoverflow.com/q/27852457
upvote count: 1
answer count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has title: How to print using jquery with styles
favorite count: 0
type: Question
tagged with: css
has body: I am trying to use jQuery to print out a webpage, but the styles are missing. I looked on GitHub and it seems that the demo that the author created seems to suffer the same problem. Does anyone know how to fix it? In this demo, the styles are not being applied http://doersguild.github.io/jQuery.print/demo/ When you click "print page" the text labelled "Element 1", "Element 2", etc show up in black, not red. What is the issue? I have "Background graphics" enabled in my browser

http://stackoverflow.com/comment/44089477
score: 0
comment on: http://stackoverflow.com/q/27810279
has text: Yes, so I gathered from your post. Which is what prompted me to post an alternative approach.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27861398
has comment: http://stackoverflow.com/comment/44125510
has answer: http://stackoverflow.com/a/27861575
type: Question
tagged with: javascript
has title: jQuery .load - Only display when all functions are complete?
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44125092
has body: I'm currently loading products onto my page via .load from a gallery page which containes several more products. Once these products (first 3) have loaded in, I then get the href that was loaded in and then .load again to get product specific information from the product page. STEP ONE: EMPTY DIV EMPTY DIV EMPTY DIV EMPTY DIV EMPTY DIV EMPTY DIV STEP TWO: LOADED PRODUCT ANCHOR AND IMAGE EMPTY DIV LOADED PRODUCT ANCHOR AND IMAGE EMPTY DIV LOADED PRODUCT ANCHOR AND IMAGE EMPTY DIV STEP THREE: LOADED PRODUCT ANCHOR AND IMAGE PRODUCT INFORMATION FROM PRODUCTSPECIFIC URL LOADED PRODUCT ANCHOR AND IMAGE PRODUCT INFORMATION FROM PRODUCTSPECIFIC URL LOADED PRODUCT ANCHOR AND IMAGE PRODUCT INFORMATION FROM PRODUCTSPECIFIC URL This is what I have and it works exactly how I want it to: $(function(){ $('.prdContainer .prdHero').each(function(i){ var $parent = $(this).closest('.prdContainer'); $(this).load(('http://www.domain.com .product:nth-child(' + (i + 1)+ ') .productMainImage'), function(){ var prdLink = $parent.find('.prdHero .productMainImage').attr('href'); $parent.find('.prdDesc').each(function(){ $(this).load(prdLink + ' ' + '.productHeading, .productReviews, .productWasPrice, .productNowPrice, .productSavePrice'); //.pluck-review-rollup-output-line }); $parent.find('#prdDetails').each(function(){ $(this).load(prdLink + ' ' + '#productDescription'); $('.prdDetails').show(); }); }); }); }); BUT!!! It loads in and displays content as soon as it gets it. I want EVERYTHING to continue to load until the last thing has loaded and display it all at once, rather than it load in and display one by one. Does anybody have any idea on how I could achieve this?
type: UnansweredQuestion

http://stackoverflow.com/comment/44766757
has text: @StevenWerner, if the error code is being truthful, that means the data you're providing in your post is breaking something on the server. Perhaps you're sending bad data?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27955935
type: AnswerComment

http://stackoverflow.com/a/27963397
has comment: http://stackoverflow.com/comment/44322555
type: Answer
answers question: http://stackoverflow.com/q/27961903
has comment: http://stackoverflow.com/comment/44322610
has comment: http://stackoverflow.com/comment/44320138
has body: You can simple use it like this RPrayerFind({userId:1},{},{'$limit':10,'$skip':300})
score: 0

http://stackoverflow.com/comment/44333902
type: Comment
comment on: http://stackoverflow.com/a/27936520
score: 0
type: AnswerComment
has text: Not really, but do you ever send anything back to the ajax call that isn't `success` ?

http://stackoverflow.com/a/62943740
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27928372
upvote count: 1
has body: In case you are running it on a Google Bucket, the simple solution to this is to consider 'index.html' for Error (404 not found) Page. To do so: In the list of buckets, find the bucket you created. Click the Bucket overflow menu (...) associated with the bucket and select Edit website configuration. In the website configuration dialog, specify the main page as the error page too.
type: Answer

http://stackoverflow.com/comment/44317139
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27956795
type: AnswerComment
has text: It is part of POST body. I am working on abstract layer so I need to if I can set the character encoding explicitly. Do you think it is not doing UTF-8 encoding? Isn't encodeURIComponent function in javascript supposed to do UTF-8 encoding?

http://stackoverflow.com/q/27882620
tagged with: javascript
tagged with: parent-child
has title: Alternative to .parentElement?
has comment: http://stackoverflow.com/comment/44167093
answer count: 1
has comment: http://stackoverflow.com/comment/44167040
favorite count: 0
has comment: http://stackoverflow.com/comment/44167006
has comment: http://stackoverflow.com/comment/44167096
has body: I have a function that needs to go through alot of parentElements to get an id. Instead of writing if( element.parentElement.parentElement.parentElement.id == "target" ){ doThis() } Is there a way in javascript just to say "If there is a parent element with "this id" doThis()" ? Instead of going through all those parentElements is there a way to just say if there is ANY element that is a parent to the current element with this ID, then doThis()? EDIT Many have said i should just getElementById and maybe that is the solution, but let me show you a example of my code so you can see a little better what I'm doing: I have alot of divs with the same function. lets call it clicked(). so say i have 20 divs that look like this: Content Lets say these divs are contained within a few other divs: Content Content2 ... my clicked function looks like: function clicked( element ){ if( element.parentElement.parentElement.parentElement.id == 'container' ){ doThis(); } }
has answer: http://stackoverflow.com/a/27882687
score: 2
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/27882687
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44167031
has comment: http://stackoverflow.com/comment/44167004
linked to: http://stackoverflow.com/q/2234979

http://stackoverflow.com/a/27945213
has comment: http://stackoverflow.com/comment/44295900
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44285697
has comment: http://stackoverflow.com/comment/44296033
answers question: http://stackoverflow.com/q/27944960
type: Answer
accepted answer of: http://stackoverflow.com/q/27944960
score: 2
has comment: http://stackoverflow.com/comment/44296332
upvote count: 2
has body: Add the return statement to the CustomerService get method and also remove the success functions which you have written in the getAll(), getProduction(), getTest() methods surchargeIndex.service('customerService', [ "$http", function ($http) { this.get = function (customerType) { var promise; if (customerType == "1") { promise = getProduction().then(function (result) { return result.data; }); } else if (customerType == "2") { promise = getTest().then(function (result) { return result.data; }); } else { promise = getAll().then(function (result) { return result.data; }); } return promise; } var getTest = function () { return $http({ method: "GET", url: "api/Customer/GetTest", }); }; var getProduction = function () { return $http({ method: "GET", url: "api/Customer/GetProduction", }); }; var getAll = function () { return $http({ method: "GET", url: "api/Customer/GetAll", }); }; controller $scope.getCustomers = function(customerType) { $scope.showContent = false; customerService.get(customerType).then(function(data) { $scope.customers = data; }); };

http://stackoverflow.com/q/27882782
has title: addEventListener in for loop adds always to last item
type: Question
tagged with: addeventlistener
tagged with: javascript
has comment: http://stackoverflow.com/comment/44167709
score: 0
tagged with: for-loop
answer count: 1
linked to: http://stackoverflow.com/q/750486
has comment: http://stackoverflow.com/comment/44167475
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27882874
has body: I'm currently writing a chrome extension, so don't mind the "chrome.*" code. Right now, I'm facing a problem and I have no idea how to solve this (tried everything I could find on google).. This is my function: function tabwlwatchlist() { document.getElementById('watchlisttable').innerHTML = ""; chrome.storage.local.get('movienames', function (resultnames) { chrome.storage.local.get('movielinks', function (resultlinks) { for (var j=0; j<resultnames.movienames.length; j++) { (function () { document.getElementById('watchlisttable').innerHTML += ' ' + resultnames.movienames[j] + ' entfernen '; console.log("test"); document.getElementById('wlt' + j).addEventListener("click", function(){ alert('works'); }, false); console.log("test2"); }()) } }); }); document.getElementById('lasthd').style.display = "none"; document.getElementById('lastserien').style.display = "none"; document.getElementById('watchlisttab').style.display = "block"; } The EventListener always adds to the last Element of the for loop. Any ideas? :/

http://stackoverflow.com/a/27806498
has body: I think the problem could be the way you have defined the style attribute. style="background-image:url("'+data[index].bg+'"); The quotation mark directly after the opening parentheses is closing your style attribute. I would think simply removing it would do the trick style="background-image:url('+data[index].bg+'); alternatively, replacing the double quote with an escaped single quote should also work style="background-image:url(\''+data[index].bg+'\');
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44022995
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27806383
accepted answer of: http://stackoverflow.com/q/27806383

http://stackoverflow.com/a/27883164
has body: What is in your data? If you have a ID field in your data then you might be able to do something like this //assume this is the data you extracted from a student table $data=array( array('id'=&gt;'1','name'=&gt;'student1'), array('id'=&gt;'2','name'=&gt;'student2') ); //your data will be something like $data={ {1,student1}, {2,student2}} foreach($data as $student){ echo "&lt;div id='col".$student['id']."'&gt;&lt;/div&gt;"; } //in your html it will produce: &lt;div id=col1&gt;&lt;/div&gt;&lt;div id=col2&gt;&lt;/div&gt;
type: Answer
answers question: http://stackoverflow.com/q/27880499
score: 0

http://stackoverflow.com/comment/44101426
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27848608
has text: @E.Maggini None of his code shows that he is producing HTML that needs to be inserted so unless that turns out to be the case then this is not a duplicate.
score: 1

http://stackoverflow.com/comment/44064450
has text: Gotcha! I was searching JSON thats probably why I was getting wrong results.
score: 0
comment on: http://stackoverflow.com/q/27829130
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27813399
answer count: 2
has answer: http://stackoverflow.com/a/27813475
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27813456
tagged with: regex
favorite count: 0
has answer: http://stackoverflow.com/a/27813456
accepted answer: http://stackoverflow.com/a/27813475
upvote count: 2
has title: In sentence how to make first letter UPPERCASE followed by dot ('.') and space (zero or more than one )
has body: var t = ".i am krishna. france" // string // regular expression to match the pattern where $1 $2 $3 are the grouping t = t.replace(/[\n]*([a-zA-Z]+[.][ \n]*)([a-zA-Z])([a-zA-Z]*)[\n]*/, '$1' + '$2'.toUpperCase() + '$3'); $('body').append(t); //to convert function convert() { return arguments[0].toUpperCase(); } &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt;&lt;/body&gt; &lt;/html&gt; Expected result: .I am krishna. France
score: 2
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/27845394
has answer: http://stackoverflow.com/a/27845475
score: 1
upvote count: 3
has comment: http://stackoverflow.com/comment/44095140
has title: External script caching
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44094760
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44094739
possible better answer: http://stackoverflow.com/a/27845475
linked to: http://stackoverflow.com/q/206783
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27845527
has comment: http://stackoverflow.com/comment/44094719
favorite count: 0
downvote count: 2
has answer: http://stackoverflow.com/a/27845527
type: AnsweredQuestion
has body: I have been taught that it is good for page loading speed and user experience to defer loading JavaScript that is non-essential for above-the-fold content. Example: $(document).ready(function() { var e = document.createElement("script"); e.src = "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"; var t = document.getElementsByTagName("script")[0]; t.parentNode.insertBefore(e, t) }); But are external JavaScript files that are deferred like this still cached by the user's browser the same way as direct calls to external JavaScript hardcoded into the HTML?

http://stackoverflow.com/comment/44115786
type: AnswerComment
has text: curious why you need to fetch data based on DOM rendering. Never had to do that, and can't see why it would ever be needed. Also directive will be called for every element, so you won't have an array like you show in code
type: Comment
comment on: http://stackoverflow.com/a/27846069
score: 0

http://stackoverflow.com/comment/59472633
type: Comment
has text: ya thanks that's how I end up doing before processing all later queries / updates. (and store intermediate results in `this`)
comment on: http://stackoverflow.com/a/27946372
score: 0
type: AnswerComment

http://stackoverflow.com/q/27939773
favorite count: 0
has answer: http://stackoverflow.com/a/27939889
linked to: http://stackoverflow.com/q/3489460
has title: toLocaleDateString() short format
has answer: http://stackoverflow.com/a/74230396
has answer: http://stackoverflow.com/a/63424504
possible better answer: http://stackoverflow.com/a/69044670
has comment: http://stackoverflow.com/comment/58978458
has body: I want to have the short notation of the Date.toLocaleDateString() but in local format. There are a lot of solutions that hard-code the yyyy-mm-dd format but I want it to be dependent on the system that is hosting the page. This is my function thus far: function getDate(dateTimeString) { var date = getDateTime(dateTimeString); var options = { year: "numeric", month: "numeric", day: "numeric" }; return date.toLocaleDateString( date.getTimezoneOffset(), options ); } but this returns it like so: Wednesday, January 28, 2015 which I don't want. Any suggestions/ideas? PS: it's not a browser and there is a pretty real possibility that the person using it does not have interwebs connection; all information is gotten from a local database so I can't use any fany stuff like this How to get visitor&#39;s location (i.e. country) using javascript geolocation.
has answer: http://stackoverflow.com/a/69534348
score: 77
has answer: http://stackoverflow.com/a/27939870
upvote count: 77
tagged with: localization
has answer: http://stackoverflow.com/a/60858473
has comment: http://stackoverflow.com/comment/67463807
type: Question
has comment: http://stackoverflow.com/comment/44275878
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35951045
accepted answer: http://stackoverflow.com/a/35951045
has answer: http://stackoverflow.com/a/76942800
has answer: http://stackoverflow.com/a/69044670
has answer: http://stackoverflow.com/a/35773271
linked to: http://stackoverflow.com/q/8469436
tagged with: javascript
has comment: http://stackoverflow.com/comment/44275961
answer count: 11
downvote count: 0
has answer: http://stackoverflow.com/a/77836858

http://stackoverflow.com/a/27944203
has comment: http://stackoverflow.com/comment/44283800
has body: Yes, you can do this in vanilla JavaScript: [].forEach.call(document.getElementsByClassName('comment'), function(element){ element.addEventListener('blur', cleanWordClipboard); // the element will be this in the cleanWordClipboard call }); Note that I assume you use class=comment instead of id=comment, as only one element in a document can have a given id.
type: Answer
has comment: http://stackoverflow.com/comment/44286036
score: 3
has comment: http://stackoverflow.com/comment/44286650
upvote count: 3
has comment: http://stackoverflow.com/comment/44285217
has comment: http://stackoverflow.com/comment/44284728
answers question: http://stackoverflow.com/q/27944164
downvote count: 0
has comment: http://stackoverflow.com/comment/44283778
has comment: http://stackoverflow.com/comment/44285156
accepted answer of: http://stackoverflow.com/q/27944164
has comment: http://stackoverflow.com/comment/44286138
has comment: http://stackoverflow.com/comment/44285671
type: AcceptedAnswer

http://stackoverflow.com/comment/44293110
comment on: http://stackoverflow.com/a/27948827
has text: Thanks for your reply. Unfortunately when I change to use reopenClass I seem to completely lose the model from the chrome ember inspector...
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27864720
has answer: http://stackoverflow.com/a/59171383
answer count: 26
has answer: http://stackoverflow.com/a/42893919
upvote count: 397
has answer: http://stackoverflow.com/a/27868548
has answer: http://stackoverflow.com/a/43299633
score: 395
has answer: http://stackoverflow.com/a/37920466
has comment: http://stackoverflow.com/comment/72286863
has answer: http://stackoverflow.com/a/28180620
downvote count: 2
has answer: http://stackoverflow.com/a/65378087
has answer: http://stackoverflow.com/a/33993179
has answer: http://stackoverflow.com/a/29308437
tagged with: properties
has answer: http://stackoverflow.com/a/39598669
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/56879315
has answer: http://stackoverflow.com/a/35337078
has answer: http://stackoverflow.com/a/53563610
has answer: http://stackoverflow.com/a/38886843
tagged with: react-router
accepted answer: http://stackoverflow.com/a/27868548
has answer: http://stackoverflow.com/a/39506061
has answer: http://stackoverflow.com/a/41139777
linked to: http://stackoverflow.com/q/37516919
has answer: http://stackoverflow.com/a/63642564
has answer: http://stackoverflow.com/a/41427716
has answer: http://stackoverflow.com/a/29720488
tagged with: reactjs
has answer: http://stackoverflow.com/a/37232137
has answer: http://stackoverflow.com/a/39027174
linked to: http://stackoverflow.com/q/111102
has answer: http://stackoverflow.com/a/31603297
has answer: http://stackoverflow.com/a/68159001
has title: react-router - pass props to handler component
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/38907715
has comment: http://stackoverflow.com/comment/72286969
possible better answer: http://stackoverflow.com/a/32761932
has body: I have the following structure for my React.js application using React Router: var Dashboard = require('./Dashboard'); var Comments = require('./Comments'); var Index = React.createClass({ render: function () { return ( Some header <RouteHandler /> ); } }); var routes = ( <DefaultRoute handler={Dashboard}/> ); ReactRouter.run(routes, function (Handler) { React.render(<Handler/>, document.body); }); I want to pass some properties into the Comments component. (normally I'd do this like <Comments myprop="value" />) What's the easiest and right way to do so with React Router?
has answer: http://stackoverflow.com/a/44708688
linked to: http://stackoverflow.com/q/55328558
has answer: http://stackoverflow.com/a/32761932

infinite-scroll
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/27855099

http://stackoverflow.com/comment/44144961
type: QuestionComment
comment on: http://stackoverflow.com/q/27864228
has text: Thx, I can use that!
score: 0
type: Comment

http://stackoverflow.com/comment/44043889
has text: Ok. What about the errors in the console?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27818808
score: 0

http://stackoverflow.com/a/27956302
has comment: http://stackoverflow.com/comment/44308226
score: 1
upvote count: 1
has body: You probably need to set the model ID attribute. The id set automatically by Backbone on the client is cid and not id. Note that a common gotcha with DBs that use a different unique key (like MongoDB) is not mapping from that key to ID as described in the docs For example: var Model = Backbone.Model.extend({ idAttribute: "_id" //other model setup code });
has comment: http://stackoverflow.com/comment/44309062
has comment: http://stackoverflow.com/comment/44310861
answers question: http://stackoverflow.com/q/27954958
downvote count: 0
type: Answer

http://stackoverflow.com/q/27875063
type: Question
has body: Working on Ionic and local notification I am going to show an alert\notification to user after 10 mins of the opening of the app. which is displaying fine using this code: setTimeout(function(){ addLocalNotification({ id: "10", date: new Date(), message: "You are welcome", title: "Hi", }); },600000) i don't want to set date in function here above (date: new Date(), ). I want to use it with setTimeout but the problem is if user open the app and closed it then setTimeout do not work. How can i enforce setTimeout to work even if the app is closed.
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: cordova
has answer: http://stackoverflow.com/a/27875095
tagged with: settimeout
score: 1
upvote count: 1
has title: setTimeout is not working when app is closed

http://stackoverflow.com/a/27864647
has comment: http://stackoverflow.com/comment/44133004
type: Answer
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/44131852
answers question: http://stackoverflow.com/q/27864423
has comment: http://stackoverflow.com/comment/44131969
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44131894
has comment: http://stackoverflow.com/comment/44132049
accepted answer of: http://stackoverflow.com/q/27864423
has body: In your example, the first { is ambiguous and the parser will interpret it as the beginning of a block. While {a, b, c} is a valid block, the following assignment operator is not valid. Wrap everything in parenthesis and it will parse correctly: ({a, b, c} = {a:1, b:2, c:3}); Example This is similar to having an object literal by itself (for whatever reasons): {"a": 42} // parse error ({"a": 42}) // works

http://stackoverflow.com/comment/97698488
score: 0
type: Comment
comment on: http://stackoverflow.com/a/55494826
has text: Marked as accepted answer to your answer! Thanks a lot!
type: AnswerComment

http://stackoverflow.com/q/27919825
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27919956
has comment: http://stackoverflow.com/comment/44237252
upvote count: 1
accepted answer: http://stackoverflow.com/a/27922300
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44237328
has title: Multiple Maker with infoWindowContent and User's Geo Location
tagged with: javascript
tagged with: google-maps-api-3
score: 0
has body: I want to Add User's Geo Location in Google Map along with my other Markers. I have successfully added My Multiple markers, But i am not able to Center/pan to the marker with user location... When the map loads, I want all my markers to show, but it should focus on user's geo location. Here is what i have done so far. jQuery(function ($) { // Asynchronously Load the map API var script = document.createElement('script'); script.src = "http://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize"; document.body.appendChild(script); }); function initialize() { var map; var bounds = new google.maps.LatLngBounds(); var mapOptions = { mapTypeId: 'roadmap' }; // Display a map on the page map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); map.setTilt(45); // Multiple Markers var markers = [ ["Alpha Game One", 33.8008, -84.3894], ["Alpha Game Two", 33.8008, -84.3894] ]; // Info Window Content var infoWindowContent = [ [' Alpha Game One <pThis is alpha Game one location here : View Locaion '], [' Alpha Game Two This is alpha Game two location here : View Location '] ]; var icons = [ "https://cdn.mapsmarker.com/wp-content/plugins/leaflet-maps-marker-pro/leaflet-dist/images/marker.png", "https://cdn.mapsmarker.com/wp-content/plugins/leaflet-maps-marker-pro/leaflet-dist/images/marker.png"] var icons_length = icons.length; // Display multiple markers on a map var infoWindow = new google.maps.InfoWindow(), marker, i; var iconCounter = 0; // Loop through our array of markers & place each one on the map for (i = 0; i < icons_length; i++) { var position = new google.maps.LatLng(markers[i][1], markers[i][2]); bounds.extend(position); marker = new google.maps.Marker({ position: position, map: map, title: markers[i][0], icon: icons[iconCounter] }); // Allow each marker to have an info window google.maps.event.addListener(marker, 'click', (function (marker, i) { return function () { infoWindow.setContent(infoWindowContent[i][0]); infoWindow.open(map,…
has answer: http://stackoverflow.com/a/27922423
answer count: 3
tagged with: google-maps
favorite count: 0
has answer: http://stackoverflow.com/a/27922300
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27919956

http://stackoverflow.com/comment/44257867
type: Comment
score: 0
has text: You create a lock file to signify someone else has the main file open. You check for that lock file before opening the file.
type: AnswerComment
comment on: http://stackoverflow.com/a/27930325

dom
tags question: http://stackoverflow.com/q/27950299
tags question: http://stackoverflow.com/q/27884222
tags question: http://stackoverflow.com/q/27863515
type: Tag
tags question: http://stackoverflow.com/q/27881536
tags question: http://stackoverflow.com/q/27889663
tags question: http://stackoverflow.com/q/27824377
tags question: http://stackoverflow.com/q/27952901
tags question: http://stackoverflow.com/q/27957118
tags question: http://stackoverflow.com/q/27905106
tags question: http://stackoverflow.com/q/27930577
tags question: http://stackoverflow.com/q/27919915
tags question: http://stackoverflow.com/q/27923605
tags question: http://stackoverflow.com/q/27871657
tags question: http://stackoverflow.com/q/27908054
tags question: http://stackoverflow.com/q/27956932
tags question: http://stackoverflow.com/q/27830547
tags question: http://stackoverflow.com/q/27893300
tags question: http://stackoverflow.com/q/27962992
tags question: http://stackoverflow.com/q/27832714
tags question: http://stackoverflow.com/q/27896407
tags question: http://stackoverflow.com/q/27901266
tags question: http://stackoverflow.com/q/27806252
tags question: http://stackoverflow.com/q/27839735
tags question: http://stackoverflow.com/q/27901146
tags question: http://stackoverflow.com/q/27813359
tags question: http://stackoverflow.com/q/27847851
tags question: http://stackoverflow.com/q/27963933
tags question: http://stackoverflow.com/q/27900379
tags question: http://stackoverflow.com/q/27867911
tags question: http://stackoverflow.com/q/27939380
tags question: http://stackoverflow.com/q/27834807
tags question: http://stackoverflow.com/q/27915167
tags question: http://stackoverflow.com/q/27886569
tags question: http://stackoverflow.com/q/27853444
tags question: http://stackoverflow.com/q/27837276
tags question: http://stackoverflow.com/q/27869258
tags question: http://stackoverflow.com/q/27905975
tags question: http://stackoverflow.com/q/27859827
tags question: http://stackoverflow.com/q/27865035
tags question: http://stackoverflow.com/q/27843984
tags question: http://stackoverflow.com/q/27843833
tags question: http://stackoverflow.com/q/27842832
tags question: http://stackoverflow.com/q/27948812
tags question: http://stackoverflow.com/q/27833018
tags question: http://stackoverflow.com/q/27950056
tags question: http://stackoverflow.com/q/27934728
tags question: http://stackoverflow.com/q/27883455
tags question: http://stackoverflow.com/q/27952217
tags question: http://stackoverflow.com/q/27830168
tags question: http://stackoverflow.com/q/27912726
tags question: http://stackoverflow.com/q/27892905
tags question: http://stackoverflow.com/q/27805944
tags question: http://stackoverflow.com/q/27838977
tags question: http://stackoverflow.com/q/27867498
tags question: http://stackoverflow.com/q/27854409
tag name: dom
tags question: http://stackoverflow.com/q/27913043
tags question: http://stackoverflow.com/q/27948287
tags question: http://stackoverflow.com/q/27934411
tags question: http://stackoverflow.com/q/27882371
tags question: http://stackoverflow.com/q/27814346
tags question: http://stackoverflow.com/q/27817688
tags question: http://stackoverflow.com/q/27949043
tags question: http://stackoverflow.com/q/27905060
tags question: http://stackoverflow.com/q/27843793
tags question: http://stackoverflow.com/q/27959498
tags question: http://stackoverflow.com/q/27825634
tags question: http://stackoverflow.com/q/27948106

http://stackoverflow.com/comment/87937344
score: 1
comment on: http://stackoverflow.com/q/27826998
type: QuestionComment
type: Comment
has text: If you plan to store sensitive data, add support for Google Drive or Dropbox into your extension and store the data there. You can further protect the data by forcing the user to sign in to retrieve their data from the cloud. However, if someone has physical access to your computer, then you've got bigger problems ;).

http://stackoverflow.com/comment/44170663
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27884559
has text: You also dynamically load buttons in PC/MAC, and it's still working?
score: 0

http://stackoverflow.com/comment/45710701
comment on: http://stackoverflow.com/a/28671643
has text: Thanks for the suggestion Styphon. I would have explained it. Will take care from next time
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44202538
score: 0
comment on: http://stackoverflow.com/q/27901561
type: Comment
type: QuestionComment
has text: `$('#amount').html(amt);`

http://stackoverflow.com/a/44130472
answers question: http://stackoverflow.com/q/27850765
has body: As the other answers didn't really work well, or did not not incorporate or work with Angular's $locale service, I wrote the following filter: Template: &lt;span&gt;&lt;/span&gt; Filter: app.filter('roundTo', function(numberFilter) { return function(value, maxDecimals) { return numberFilter((value || 0) .toFixed(maxDecimals) .replace(/(?:\.0+|(\.\d+?)0+)$/, "$1") ); } }) Rounds the number to the max number of decimals Trims all trailing zero's Removes the decimal seperator when it's not needed And Uses Angular's $locale formatting
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/27804210
answer count: 1
tagged with: grouping
has comment: http://stackoverflow.com/comment/44017487
favorite count: 0
linked to: http://stackoverflow.com/q/24302630
has answer: http://stackoverflow.com/a/27804485
accepted answer: http://stackoverflow.com/a/27804485
has comment: http://stackoverflow.com/comment/44017563
has body: I have a JSON object which has repeating email property as follows: accounts": [ { "email": "somebody@domain.com", "accountID": 1, "accountName": "Account Name", "permission": "Permission 1", "nodeID": 1 }, { "email": "somebody@domain.com", "accountID": 1, "accountName": "Account Name", "permission": "Permission 2", "nodeID": 2 }] That JSON contains repeating email fields which I want to group by. The desired resulting JSON is as follows: { “email” : ”somebody@domain.com”, “accountID” : 1, “accountName” : “Account Name”, “permissions” : [ { “permission” : “Permission 1”, “nodeID” : 1 }, { “permission” : “Permission 2”, “nodeID” : 2 } ] } So, in this way the resulting JSON won't contain more than 1 item with the same email property. Is there any way this can be achieved with jQuery? Thanks in advance.
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44017638
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has title: Group and merge JSON properties
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/44017444
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44017577

http://stackoverflow.com/a/27926636
has comment: http://stackoverflow.com/comment/44288025
type: Answer
has comment: http://stackoverflow.com/comment/74399604
upvote count: 14
has comment: http://stackoverflow.com/comment/44288577
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/69404306
score: 12
has body: According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape you should update your old scripts: This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time. A Quick Fix? Fixing it could be as simple as dropping a line into your JS to add in an unescape() method if one doesn't exist. window.unescape = window.unescape || window.decodeURI;
accepted answer of: http://stackoverflow.com/q/27926562
answers question: http://stackoverflow.com/q/27926562
has comment: http://stackoverflow.com/comment/137066936
downvote count: 2

http://stackoverflow.com/q/27810385
has title: jQuery variables objects?
has comment: http://stackoverflow.com/comment/44029584
has answer: http://stackoverflow.com/a/27810405
has comment: http://stackoverflow.com/comment/44029709
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44029772
has body: When I use JavaScript it works. var submitButton = document.getElementById("submitButton"); When I use jQuery to declare it it doesn't. var submitButton = $('#submitButton'); I realized when debugging, jQuery is creating a object for the variable. submitButton: Object[span#submitButton.wordButtonD] In JavaScript submitButton: span#submitButton.wordButtonD How do get this to be like javaScript??
has answer: http://stackoverflow.com/a/27810536
has comment: http://stackoverflow.com/comment/44029855
type: Question
has answer: http://stackoverflow.com/a/27810433
tagged with: javascript
tagged with: web
tagged with: jquery
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44029590
has comment: http://stackoverflow.com/comment/44029682

http://stackoverflow.com/comment/44311812
score: 1
comment on: http://stackoverflow.com/a/27949587
type: AnswerComment
type: Comment
has text: I learned a lot from this guy: https://egghead.io/technologies/angularjs?order=ASC

http://stackoverflow.com/comment/44300684
comment on: http://stackoverflow.com/a/27937784
score: 0
type: AnswerComment
type: Comment
has text: Awesome Tobias, thanks! It was that the onBeforeShow delegate event is specific to the page, not the view. I made some changes to the JSBin and it works as I was expecting.

http://stackoverflow.com/comment/78852927
type: Comment
has text: Hello @Leo Tavares, here you can find a guide on how format your answers on SO: https://stackoverflow.com/help/formatting.
comment on: http://stackoverflow.com/a/45946797
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44116291
has text: then why not send the html with the other data? Just makes no sense that DOM render triggers an API request to get the html needed in the DOM
comment on: http://stackoverflow.com/a/27846069
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27901504
has body: It has been some time now that i am learning and using angularjs framework, and although some of it's features are truly awesome, it seems to me as if it's key features are a bit problematic for authentication based applications. Let's look at an example. Let's say i have a website that has a user login, and once the user is logged in he can click on a link to his/hers dashboard page. On the dashboard the user can see some private data. Now, the way i'm used to do it, is run some script on the server side and then if a user is connected, return some HTML, if no then redirect the user to another location. The way angularjs encourages me to do it is by using the route feature, say like this: when('/dashboard', { templateUrl: 'dashboard.html', controller: 'DashboardController' }) This way, in case a user is not connected, angularjs will first fetch the template HTML, then the controller will fetch some data and receive an authentication error, then redirect the route to another location. To me it seems like a worse solution for more than one reason: 1) First of all, my HTML gets exposed to everyone. Although this isn't devastating, it just seems like a bad security practice (imagine that you do not even have a facebook account, but still you can see all of facebook pages HTML, and even worse, all the objects and fields of the like for example user.accessToken). 2) I would make a larger number of requests to the server, first one to fetch the template, second for authentication validation and data, third and probably fourth for the redirection. I assume angularjs cache the templates so maybe the actual number of requests is smaller than i mentioned, still, dealing with all this on the server side is only one request - and like angularjs, it can also not load the entire page but only the needed HTML throw AJAX. My case here is arguable, but still, something about it seems wrong. 3) This is maybe the most important issue for me. Everything i do on the server side has to b…
has comment: http://stackoverflow.com/comment/44279071
possible better answer: http://stackoverflow.com/a/27901958
downvote count: 0
has answer: http://stackoverflow.com/a/27901958
favorite count: 0
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/27901993
score: 2
type: AnsweredQuestion
has title: Is angularjs recommended for large scale authentication based applications?
tagged with: authentication
type: Question
accepted answer: http://stackoverflow.com/a/27901993
tagged with: javascript
tagged with: ajax
tagged with: security
answer count: 2

http://stackoverflow.com/comment/44161673
type: Comment
comment on: http://stackoverflow.com/a/27880006
has text: You may have tried to look before I made corrections.
type: AnswerComment
score: 0

http://stackoverflow.com/a/27940951
score: 1
has comment: http://stackoverflow.com/comment/44277801
has comment: http://stackoverflow.com/comment/44278173
has comment: http://stackoverflow.com/comment/44277913
has comment: http://stackoverflow.com/comment/44277871
has comment: http://stackoverflow.com/comment/44278373
has comment: http://stackoverflow.com/comment/44278604
upvote count: 1
has comment: http://stackoverflow.com/comment/44277927
has body: To run the function only for odd values you can use $even / $odd helper properties ngRepeat offers: {{some value}} UPD. Angular way of doing what you are after is to use expression like this: {{some value}}
has comment: http://stackoverflow.com/comment/44277953
type: Answer
answers question: http://stackoverflow.com/q/27940817
downvote count: 0

http://stackoverflow.com/q/27851765
tagged with: forms
has title: jQuery submit form and then disable all 'input[type="submit"]' to prevent duplicate submissions
answer count: 3
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27894294
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44107560
possible better answer: http://stackoverflow.com/a/27851804
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27851804
has answer: http://stackoverflow.com/a/27851820
has body: I've got an odd issue that the common solutions won't seem to fix. I get some funky behavior when a user clicks an html based form which is submitted if they click 'save', 'previous' or 'next'. &lt;div class="form-tab-nav form-tab-nav-bottom"&gt; &lt;input id="tab" name="tab" tabindex="25" type="hidden" value="3"&gt; &lt;input name="commit" tabindex="26" type="submit" value="Save"&gt; &lt;input id="prev_commit_bottom" name="prev_commit[bottom]" tabindex="27" type="submit" value="&lt;&lt; Prev"&gt; &lt;input class="orange" id="next_commit_bottom" name="next_commit[bottom]" tabindex="28" type="submit" value="Next &gt;&gt;"&gt; &lt;/div&gt; Using jQuery 1.6.1: $('form').submit(function() { $(this).find("input[type='submit']").prop('disabled',true); }); This will disable the button so that a second post request isn't allowed, but it disables the redirect. That is clicking 'previous' or 'next' will behave the same as clicking 'save'.
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44107941
has answer: http://stackoverflow.com/a/27894294
score: 1

http://stackoverflow.com/q/27924687
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27924958
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27924793
has answer: http://stackoverflow.com/a/27924883
has body: This is my html: Random long text here. This text takes up two lines when it is inside it's container div (inside cobcContainer). In the CSS (there is a style.css which I do not have access to) the has a background image and the width of it is 100px. There is not any other CSS in this. When I view the webpage, the container is 50% and the text appears first and then the link / icon appears below it. How do I make the link / icon appear to the right of the text (make the text aligned to the left of the icon / link)? I need this to be a responsive design so I am trying to use percentages here (other than the link / icon which has a fixed width of 100px). JQuery / JS can be used. Note: I am not allowed to use tags nor display: table-cell (these rules were set by the corporation).
has comment: http://stackoverflow.com/comment/44246426
answer count: 3
has title: Make tag remaining width of div with a link (which has an icon as a background) to the right of it
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27841634
linked to: http://stackoverflow.com/q/4599975
tagged with: css
has answer: http://stackoverflow.com/a/27841797
has comment: http://stackoverflow.com/comment/44087291
upvote count: 0
type: UnansweredQuestion
has title: Open dropdown on hover using jquery
has answer: http://stackoverflow.com/a/27843035
has body: I have one drop-down with ul and li tag. It is working on click. I'm trying to open drop-down on mouse hover not a click. How can i achieve this. Choose Anyone Computer Keyboard The output is like normal html select drop-down. But i am looking to open dropdown on mouse hover event.
type: Question
has comment: http://stackoverflow.com/comment/44087262
tagged with: javascript
score: -1
answer count: 2
downvote count: 1
linked to: http://stackoverflow.com/q/3736238
has comment: http://stackoverflow.com/comment/44087343
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44087154
has comment: http://stackoverflow.com/comment/44087341
has comment: http://stackoverflow.com/comment/44086957

http://stackoverflow.com/a/27935954
score: 2
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27935871
has body: jQuery uses css selectors. Try $('#Article') to reference an element by its id.
downvote count: 0

http://stackoverflow.com/q/27952695
favorite count: 0
tagged with: ruby
has comment: http://stackoverflow.com/comment/44302351
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/41770906
linked to: http://stackoverflow.com/q/949449
tagged with: arrays
has title: Trying to remove quotes from arrayed JSON keys
tagged with: javascript
has comment: http://stackoverflow.com/comment/44300642
has comment: http://stackoverflow.com/comment/44300613
has comment: http://stackoverflow.com/comment/44300681
has body: I have this array of javascript objects (which are actually musical notes) that are generated in my javascript front-end. In order to store it, I had to run javascript JSON.stringify(objectArray)before throwing it into a hidden input, but that automatically encases all my keys in double quotes like so: [ {"class":"barline","symbol":"standard","barline":true,"newSystem":true}, {"class":"note","rhythm":"half","duration":0.5,"symbol":"flag","hand":"R","newbar":true,"rebel":false}, {"class":"note","rhythm":"half","duration":0.5,"symbol":"flag","hand":"R","endbar":true,"rebel":false}, {"class":"barline","symbol":"standard","barline":true}, {"class":"note","rhythm":"half","duration":0.5,"symbol":"flag","hand":"R","newbar":true,"rebel":false} ] Before filtering my params in Rails, I run JSON.parse(params[:score][:notes]) to turn it from a string into a proper JSON array for storage in MongoDB (I'm specifically using Mongoid) I know it's normally proper procedure to keep keys in quotes in most cases, but I like using the dot notation for keys to grab values in all my JS. Should I switch my JS to reference everything with brackets, or can you think of a simple function that would quickly parse out the keys' quotes before sending to the hidden input?
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/41770906

http://stackoverflow.com/comment/44159620
type: AnswerComment
score: 0
type: Comment
has text: @Syd do you need the coordinates relative to the window, or the first element?
comment on: http://stackoverflow.com/a/27878906

http://stackoverflow.com/comment/77074767
has text: @Gyrocode.com, not in my case. When I apply the change footer in the footerCallback, my index column changes -- suma = api.column( 0, { filter: 'applied'} ).data().reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); $( api.column( 0 ).footer() ).html('= '+suma); -- The index 0 is not the original 0 index :( It could be a configuration error in the configuration?
type: AnswerComment
comment on: http://stackoverflow.com/a/30075650
score: 0
type: Comment

http://stackoverflow.com/a/27842557
has comment: http://stackoverflow.com/comment/44091246
type: Answer
answers question: http://stackoverflow.com/q/27842255
score: 1
has body: With ASP.NET, the ID of Controls will change to be unique when the project is run. If you wish to target an ASP control with Javascript, you have three options: Option One create a unique class identifier for each TextBox: &lt;asp:TextBox class="input1 txt-airport-pkup" ID="TextBoxAirportPkup" placeholder="Enter Flight Number" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;%-- Use 'txt-airport-pkup' in your jQuery --%&gt; However, this option defeats the purpose of classes. Alternatively (and recommended), you can do: Option Two Use the ID of the TextBox Control by using ClientID $('#&lt;%=FlightPickupBtn.ClientID%&gt;').click(function () { (...) } Option Three As provided by David Hammond, you can alternatively select the ID as follows: $("[id$='FlightPickupBtn']").click(function () { (...) }
upvote count: 1
has comment: http://stackoverflow.com/comment/44089206
has comment: http://stackoverflow.com/comment/44089492
downvote count: 0

http://stackoverflow.com/a/27840431
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44084494
accepted answer of: http://stackoverflow.com/q/27840274
upvote count: 2
has comment: http://stackoverflow.com/comment/44084594
score: 2
has body: You need to pick the value inside the change handler: myArray[this.value][0] Snippet: var myArray = { A: ['#004d94', '#0073b9'], B: ['#f6f0c1', '#b9cdaf'] }; $('#select').change(function () { $('.Bx').css('background', myArray[this.value][0]); $('.Tx').text(this.value + " = " + myArray[this.value][0]); }); A B COLOUR CHANGE SELECTED: As per the comments, if you need to pre-populate on page load.. just make sure the first options is selected and then pick that up. Something like this: var myArray = { A: ['#004d94', '#0073b9'], B: ['#f6f0c1', '#b9cdaf'] }; goChange($("#select")[0].value); $('#select').change(function () { goChange(this.value); }); function goChange(val) { $('.Bx').css('background', myArray[val][0]); $('.Tx').text(val); } A B COLOUR CHANGE SELECTED:
answers question: http://stackoverflow.com/q/27840274

http://stackoverflow.com/comment/44114592
comment on: http://stackoverflow.com/a/27855442
has text: Thanks! It works. But the toggle is not working. The CKEditors are not enabled on clicking the "Show as editor" link again.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44068094
comment on: http://stackoverflow.com/q/27830677
score: 0
type: Comment
has text: Hi, @RobG. It's my personal code, which I didn't show it here, since I think that my approach didn't work fine. I have extended the description for marginalization and multiplication, and I'm looking for a algorithm to solve those examples.
type: QuestionComment

http://stackoverflow.com/q/27930420
has comment: http://stackoverflow.com/comment/44260520
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44258500
has comment: http://stackoverflow.com/comment/44258049
tagged with: http://stackoverflow.com/tag/html
has title: Something in canvas disappear unexcepted when focus another window
answer count: 0
score: 1
upvote count: 1
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/44258037
tagged with: javascript
tagged with: canvas
has body: My code is like this: (function() { var c = $('#board')[0].getContext('2d'); $('#board').click(_tst); var _tst_idx = 0; function _tst(e) { c.fillRect(40 + (_tst_idx++) * 50, 40, 40, 40); } })(); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;canvas id="board" width="500" height="500"&gt;&lt;/canvas&gt; http://jsfiddle.net/u063s0s4/ Just click the canvas and draw a box on it. But, when I focus another window, the 2nd box disappear unexpected. Like this: http://i2.tietuku.com/8398bd6aacc39e5d.png I used Chrome 39.0.2171.95/Win 7, I don't know what's wrong with this code. Thanks. ============ more ================== I have tried to use the stealth mode of chrome or disable all extensions, the 2nd box was still disappeared. But the code works all right on the other computer of mine. That's so strange! Only the 2nd rendering to canvas will disappear. So I used this code on init to avoid it: (function(a,b){ a(function(){ b(0, 0, 1, 1); a(function(){ b(0, 0, 1, 1); }); }); })(requestAnimationFrame, c.clearRect.bind(c)); =============== more ============= When I disabled "Use hardware acceleration when available" in the chrome setting, it became fine. My GPU: NVIDIA 560TI
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27872639
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27872680
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44147768
favorite count: 0
tagged with: drag-and-drop
tagged with: http://stackoverflow.com/tag/html
tagged with: custom-element
has title: custom drag and drop HTML5
has comment: http://stackoverflow.com/comment/44147563
has body: I am trying to use drag and drop to reorder elements in the list (pure Javascript). I would like to stylise the "ghost element" during the drag operation. Since I read that there is no standard way to do that, I am creating duplicate element (styled as I want) positioned exactly where original element should be during drag operation, and its position is updated inside ondrag event. The problem is that since this duplicate element is always exactly under the cursor, it is impossible to capture dragover or dragenter events on other elements. No matter where in the DOM the "duplicate" element is, it always blocks dragover. If I move the duplicate element so it’s not under the cursor, it works, but that defeats the purpose of seamless duplicate element. Is there some way how this duplicate element would be ignored so elements that are underneath it would get the ondragover event instead? Normally event just bubble towards the parent of where the duplicate element is.
accepted answer: http://stackoverflow.com/a/27872680
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44303869
comment on: http://stackoverflow.com/q/27954399
type: QuestionComment
type: Comment
score: 1
has text: Place the `callback(false, data); ` inside the callback for `lmsSetting`

http://stackoverflow.com/comment/44219127
comment on: http://stackoverflow.com/q/27909834
score: 0
type: Comment
type: QuestionComment
has text: @KevinB - good eyes, the loop sorta messes it up if you remove the content on each iteration.

http://stackoverflow.com/q/27875808
accepted answer: http://stackoverflow.com/a/27876139
upvote count: 1
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27876139
has comment: http://stackoverflow.com/comment/44153141
type: AnsweredQuestion
tagged with: object
has body: My getter/setter function is var o={} var bValue = {}; Object.defineProperty(o, 'b', { get: function() { return bValue; }, set: function(newValue) {func(); bValue = newValue; }, }); function func() { console.log(o) } So if I define o.b={msg:"hello"} it will call the function func(). But what I want is after this if I define o.b.msg="new" I want to trigger func(). I tried a for loop but it's not working, it's showing "max stack exeeded" error. How to do this for all objects in o with pure JavaScript?
downvote count: 0
score: 1
type: Question
has title: javascript getters and setters for all children in object
tagged with: javascript

http://stackoverflow.com/q/27816627
has comment: http://stackoverflow.com/comment/44039625
has title: Angular Data Not Refreshing After Selection
tagged with: javascript
score: 0
has body: I want to refresh data every different selection. I made plunkr so you can understand what my problem is; This is some sample code: $scope.change = function(val) { if (val == "month") { $http.get("month.json") .success(function (data, status, headers, config) { $scope.transaction = data; setTimeout(function () { $scope.$apply(function () { $scope.transaction = data; }); }, 2000); }) .error(function (data, status, headers, config) { $scope.transaction = []; }); } Its get the json data but not print. Why? http://plnkr.co/edit/rReOwRuQXRElqBbXmpuG?p=preview
has comment: http://stackoverflow.com/comment/44039953
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44039496
type: Question

http://stackoverflow.com/q/27871802
has comment: http://stackoverflow.com/comment/44146584
has body: I've watched the video from this question on class-free OOP several times now, and I'm having trouble applying this to a real world example. Crockford's new constructor pattern looks like this: function constructor(spec) { let {member} = spec, {other} = other_constructor(spec), method = function () { // accesses member, other, method, spec }; return Object.freeze({ method, other, }); } Where spec is an options hash and the resulting object exposes methods which close over all of the internal members. Ignoring the destructuring (as this can be done in long-form in present-day JS,) how do I apply this pattern in a real world example? I currently have a library with a base class Module(model, id) where model is some bootstrapping data. // constructor, original flavor function Module(model, id) { this.id = id; this.model = model; } I then have several flavors of modules which inherit from this parent Module. Under Crockford's pattern, I would instead have this as a "constructor": // constructor, Crockford's Cool Ranch function module(spec) { let id = spec.id, model = spec.model; return Object.freeze({}); } How do I use Crockford's pattern (which doesn't seem to use inheritance at all, but rather composing an object from multiple sources) to share this basic construction among multiple flavors of modules? I know that id and model will become local variables in the "constructor" of each module; I am essentially asking how to avoid repeating model = spec.model for each flavor of module using Crockford's pattern.
tagged with: javascript
tagged with: inheritance
linked to: http://stackoverflow.com/q/27595749
answer count: 1
has title: How do I share "constructor" functionality in Crockford's new constructor pattern?
downvote count: 0
has comment: http://stackoverflow.com/comment/44146334
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27872715
has comment: http://stackoverflow.com/comment/44146135
has comment: http://stackoverflow.com/comment/44146244
has comment: http://stackoverflow.com/comment/44146407
score: 7
has comment: http://stackoverflow.com/comment/44146759
upvote count: 7
has comment: http://stackoverflow.com/comment/44146310
type: Question

http://stackoverflow.com/q/27919008
tagged with: css
score: 0
has body: I have a problem in a site made with bootstrap If I set an href tag from an external page that landing on a section of my page, I have a strange behavior : the link sends me to the correct section but the navbar at the top of the menu marks the next item. If the same link is typed directly from browser, instead, everything is working fine (the positioning of the page and the navbar menu).
has title: Different Behavior between a direct link and href tag in a site made in bootstrap
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44238366
has comment: http://stackoverflow.com/comment/46637857
answer count: 0
type: Question
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44082378
type: Comment
comment on: http://stackoverflow.com/a/27833773
type: AnswerComment
has text: There is a link. Then there is a quote saying to read something on *another website*. Then there is description of where to read something on *another website*. This is a link-only answer.
score: 0

http://stackoverflow.com/comment/44075471
score: 0
has text: i would suggest looking at the documentation for `angular.element()` (which is jquery if you load jquery - jQLite if not) and suggest that if you do the binding inside the scope of the controller, you could then control that it happens in a $digest cycle [see this](https://docs.angularjs.org/api/ng/type/$rootScope.Scope) which allows angular to be aware of what you are doing and create before binding - in general though, if you are going to use angular, avoid building things in jQuery and use directives or services in angular instead.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27835194

http://stackoverflow.com/q/27927820
score: 2
linked to: http://stackoverflow.com/q/4373440
has answer: http://stackoverflow.com/a/27927948
upvote count: 2
tagged with: wordpress
possible better answer: http://stackoverflow.com/a/27927948
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27928098
has comment: http://stackoverflow.com/comment/44252667
accepted answer: http://stackoverflow.com/a/27928098
type: Question
answer count: 2
has body: In my WordPress project, my Download button containing a .zip file, which onClick should be downloaded. So the HTML producing is: DOWNLOAD I'm using AJAX to refresh the download count. Everything works fine until I added the file with the link. Typically such a link will start downloading the .zip file, but even after the time taken by the AJAX call the page redirected to the download-success page without triggering the download. And it occurs most of the time, only once or twice the file starts downloading. P.S.: I tested this but it's not my case.
linked to: http://stackoverflow.com/q/20691567
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: On click file download, on success redirect to another page using AJAX
favorite count: 0
tagged with: ajax
tagged with: php

http://stackoverflow.com/comment/44165503
has text: It seems to work fine though...
comment on: http://stackoverflow.com/q/27881889
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44157294
has text: Thanks. I will try this now. Seems it should work :)
type: AnswerComment
comment on: http://stackoverflow.com/a/27876905
score: 0
type: Comment

http://stackoverflow.com/comment/44189829
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27894290
has text: just a sec.. i will change my answer
type: AnswerComment

http://stackoverflow.com/comment/44240184
type: Comment
score: 2
type: AnswerComment
has text: It's not a bug, properties aren't 2 way bindable by default. It doesn't really make sense for the title to be 2 wayable because it's not user-settable.
comment on: http://stackoverflow.com/a/27920952

http://stackoverflow.com/comment/44271597
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27931788
has text: @ChrisCummings I didn't downvote. What exactly do you mean by 'Wikipedia purist'?

http://stackoverflow.com/comment/44302566
has text: Where do you set the variable `arr`?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27953702

http://stackoverflow.com/comment/44093980
type: Comment
has text: Yes...you must initialize it -
score: 1
comment on: http://stackoverflow.com/a/27845036
type: AnswerComment

http://stackoverflow.com/comment/44057434
comment on: http://stackoverflow.com/q/27825756
has text: here you go sorry, http://jsfiddle.net/y8oL13Ld/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44173931
type: QuestionComment
comment on: http://stackoverflow.com/q/27886405
has text: I somehow get the feeling you're trying to make phishing site, that 's going to mimic the real site and send the users password to you...
score: 0
type: Comment

http://stackoverflow.com/comment/44260605
type: Comment
has text: I cannot access chat right now.. :( It is blocked here.
comment on: http://stackoverflow.com/q/27930580
score: 0
type: QuestionComment

http://stackoverflow.com/q/27817652
tagged with: javascript
tagged with: jquery
tagged with: show-hide
has answer: http://stackoverflow.com/a/27817777
has body: is there a way to check if an element is currently fading out? Something like this (Pseudo Code): while(element.isFadingOut()){ //do something } The isFadingOut() is what I need here. Does it exist somehow?
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Check if an element is fading out (Javascript/Jquery)
possible better answer: http://stackoverflow.com/a/27817750
favorite count: 0
has answer: http://stackoverflow.com/a/27817750
type: Question
has comment: http://stackoverflow.com/comment/44041524
accepted answer: http://stackoverflow.com/a/27817777
answer count: 2
tagged with: web-applications
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/44129428
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27863542
has text: Per your suggestion, I tried removing .min for both the jQuery resource and the bootstrap.js resource. But that didn’t work. (BTW, I noticed it now takes a little longer to load the . As expected.)

http://stackoverflow.com/a/28068380
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27858926
answers question: http://stackoverflow.com/q/27858926
has body: I got it after a while. This was copy/paste from some example, and it was modified to suit my needs. The trick was to remove undeclared variable "allFields" in close function. Line to remove: allFields.removeClass("ui-state-error"); If you have similar problem, check your close function for undeclared varibles, and remove them.
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/27814048
tagged with: javascript
has comment: http://stackoverflow.com/comment/44034971
has body: I have this script: function downloadIt() { var dataUri = "data:application/csv;charset=utf-8,Col1%2CCol2%2CCol3%0AVal1%2CVal2%2CVal3%0AVal11%2CVal22%2CVal33%0AVal111%2CVal222%2CVal333" var filename = "somedata.csv" $("&lt;a download='" + filename + "' href='" + dataUri + "'&gt;&lt;/a&gt;")[0].click(); } It works on Chrome but doesn't work on Firefox, without any error on the console. What is the cause and how to fix this?
has comment: http://stackoverflow.com/comment/44035019
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: cross-browser
type: AnsweredQuestion
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/27814078
accepted answer: http://stackoverflow.com/a/27814078
type: Question
has title: Make jQuery click anchor work on Firefox

http://stackoverflow.com/a/27839765
has comment: http://stackoverflow.com/comment/44098845
score: 3
has comment: http://stackoverflow.com/comment/44121491
has comment: http://stackoverflow.com/comment/44107543
upvote count: 4
has comment: http://stackoverflow.com/comment/44122274
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44123614
has comment: http://stackoverflow.com/comment/44095284
type: Answer
accepted answer of: http://stackoverflow.com/q/27836725
has comment: http://stackoverflow.com/comment/44088607
has body: You can completely decompose that code into reusable parts. Remember that promises use return statements and abstract the very base of an asynchronous value. Promises represent the value and not an operation - your dataFn is not a function but a result of a function you're just waiting n times 10 seconds and not actually performing any more calls. Let's start with a retry: // fn - arbitrary function that returns a promise, in your case this is what // generates dataFn and __not__ dataFn itself. n - the number of retries function retry(fn, n){ var reasons = []; // to keep rejection reasons return $q.when().then(function retry(){ // start the chain return fn(). // call the function catch(function(err){ // if it failed reasons.push(err); // accumulate reasons for failure of fn() if(n-- &lt;= 0) return $q.reject(reasons); // no more retries return retry(); // recursive call, note the return }); }); } Now you can retry any promise returning function any number of times, that's a decomposable bit. Let's now look at your code again. There is a lot of complection by including the $scope and the uiSpinner in the function. Let's look at that spinner. function spinUntil(fn){ uiSpinnerService.start("loaderspin"); // start spinning, here and not outside return fn().finally(function(){ // after FN resolves uiSpinnerService.stop("loaderspin"); }); } which would let your whole code look something like: spinUntil(function(){ return retry(promiseReturningFunction, 5); }).then(function(data){ // retries performed, spinner done $scope.transactionData = data; // assign here, don't complect the scope and the fn. // spinner and retries already done, $scope is not a concern of retry or spinUntil });
answers question: http://stackoverflow.com/q/27836725
has comment: http://stackoverflow.com/comment/44121548
has comment: http://stackoverflow.com/comment/44113162
has comment: http://stackoverflow.com/comment/44098532
downvote count: 1

http://stackoverflow.com/q/27903664
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44208555
tagged with: ajax
has comment: http://stackoverflow.com/comment/44206463
has body: I'm trying to save my returned JSON Array to variable in jQuery. I was looking for solution and I found this one: var ajaxjson = []; $.ajax({ async: "false", dataType: "json", url: "http://localhost:8080/mywebapp/getJSONFromCity", data: {miasto: miasto}, success: function(result) { ajaxjson = result; } }); also solutions from here: load json into variable, and here jQuery. Assign JSON as a result to a variable are not working for me: var json = (function () { var json = null; $.ajax({ 'async': false, 'global': false, 'url': my_url, 'dataType': "json", 'success': function (data) { json = data; } }); return json; })(); AJAX call is working fine, I can show my 'result' data inside my success call, but I can't assign that data to variable any way. After that AJAX call my var is still null, when I'm trying to show some object from that, e.g. if I try to log "json[0].id" I get error " Uncaught TypeError: Cannot read property 'id' of undefined" Any ideas how to fix it?
has comment: http://stackoverflow.com/comment/44206517
has comment: http://stackoverflow.com/comment/44206878
has comment: http://stackoverflow.com/comment/44206649
has comment: http://stackoverflow.com/comment/44206775
has comment: http://stackoverflow.com/comment/44212017
linked to: http://stackoverflow.com/q/14220321
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4546339
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/2177548
has title: How to set returned JSON Array to variable in jquery using AJAX
type: Question
score: 0
has comment: http://stackoverflow.com/comment/44207818
has comment: http://stackoverflow.com/comment/44207256
has comment: http://stackoverflow.com/comment/44208008
has answer: http://stackoverflow.com/a/27906313

http://stackoverflow.com/a/27853466
answers question: http://stackoverflow.com/q/27853359
has body: It's very possible that your browser is inserting end of line characters at each \ because of the way you are splitting that multi-line string, and maybe jQuery doesn't like those characters. Just researching your questions, almost every article I saw recommended against this type of line splitting. Instead, you could do a couple of things: EDIT: You are missing a \ on the last line. I would still consider one of the following changes, however. Just use regular string concatenation: $('#post-2233 > .entrytext').after( ' ' + ' Download instructions: PC / Mac, iPhone / iPad, Android ' + ' PC / Mac: ' + ' Click directly on the links to open the content. You can then download it directly from the page that opens. ' + ' Click on the iTunes logo to open the content into iTunes. ' + ' Note that the PDFs are in a zip archive that will need to extracted after download. ' + ' ' ); Use templates: Then your jQuery after() call becomes: $('#post-2233 > .entrytext').after($('#dl-instructions').html());
upvote count: 1
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/a/27847799
has body: Try changing $_POST to $_GET since your AJAX request is doing a HTTP GET and not a HTTP POST.
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/44100508
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27847747

http://stackoverflow.com/q/27949377
has comment: http://stackoverflow.com/comment/44294030
type: AnsweredQuestion
has body: I need to create a menu where hovering on a link reveals a div, but then you can click on the link to go to another page. I don't see a way to do this with jQuery tabs, but maybe I'm missing something. Sorry I don't have any code sample... I'm trying to figure out which direction to go. I've also looked at easytabs (http://os.alfajango.com/easytabs/), but that does not seem to provide for this either. Thanks!
type: Question
has answer: http://stackoverflow.com/a/27949853
accepted answer: http://stackoverflow.com/a/27949853
has title: jQuery tabs hover action AND click through to URL
tagged with: javascript
tagged with: jquery
tagged with: jquery-ui-tabs
score: 0
answer count: 1

http://stackoverflow.com/comment/44263676
has text: better try with index.php?var1=1&var2=2 ,hope if you follow this style ,it would be helpful.
score: 0
comment on: http://stackoverflow.com/q/27932803
type: Comment
type: QuestionComment

http://stackoverflow.com/a/62111201
type: Answer
has comment: http://stackoverflow.com/comment/120698044
has comment: http://stackoverflow.com/comment/120697888
has body: I just wanted to say thank you to the previous poster. His suggestion worked perfectly. And I've been struggling to find a solution to this for weeks. If you're using Svelte within your pointerdown handler function I would suggest using: const pointerDownHandler = (event) =&gt; { // whatever logic you need event.target.releasePointerCapture(event.pointerId); } He's accurate in saying this part is key. It will not work without it.
answers question: http://stackoverflow.com/q/27908339
score: 0

http://stackoverflow.com/q/27851136
score: 0
has body: I am trying to edit the content of an email inside our site's backend in visual studio. How do I put bold text? The paragraph is below: String body = "PLEASE NOTE: This message contains important and private information, including your User Name and PIN. We suggest that you save this message in a secure place, where others do not have access, for future reference." + "\n\n" I cannot find a way to type bold text using escape characters \", can I simply type the tags? String body = "PLEASE NOTE:"
tagged with: string
has comment: http://stackoverflow.com/comment/44129738
answer count: 0
type: UnansweredQuestion
tagged with: escaping
has comment: http://stackoverflow.com/comment/44128890
has title: How to use bold text inside Visual Studio String
type: Question
linked to: http://stackoverflow.com/q/8628683
tagged with: javascript
tagged with: visual-studio-2010

http://stackoverflow.com/q/27943695
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44283955
has comment: http://stackoverflow.com/comment/44283095
has title: Angular directive on generated HTML
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44282820
has comment: http://stackoverflow.com/comment/44282753
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27944342
has body: I'm working on an existing website that currently use jQuery and PHP. On a page, HTML code is generated by jQuery AJAX calling PHP code. How would one add angular directives to this HTML code ? For example, the PHP code generates : click me I would like : click me As I understand it, angular directives need to be compiled using $compile. Is there a function like jQuery's "on" function I can use ? Thanks

http://stackoverflow.com/comment/44087291
score: 0
type: QuestionComment
type: Comment
has text: There are lots and lots of tutorials out there for such functionalities. Have you checked them? If yes, provide the references or snippets. Then, mention where you have stucked and ask for help from community.
comment on: http://stackoverflow.com/q/27841634

http://stackoverflow.com/a/27886197
answers question: http://stackoverflow.com/q/27886099
has body: The website regex101.com is a great resource for figuring out the right regular expression. I've prepared two examples: /([XY]{3}_[0-3]_[XY]{3})/g will return: MATCH 1 1. [0-9] XXX_1_XXX MATCH 2 1. [10-19] XXX_2_XXX MATCH 3 1. [20-29] XXX_3_XXX MATCH 4 1. [30-39] YYY_1_YYY MATCH 5 1. [40-49] YYY_2_YYY MATCH 6 1. [50-59] YYY_3_YYY https://regex101.com/r/xS9eA5/1 and /(?:([XY]{3}_[0-3]_[XY]{3}) ([XY]{3}_[0-3]_[XY]{3}))/g will return: MATCH 1 1. [0-9] XXX_1_XXX 2. [10-19] XXX_2_XXX MATCH 2 1. [20-29] XXX_3_XXX 2. [30-39] YYY_1_YYY MATCH 3 1. [40-49] YYY_2_YYY 2. [50-59] YYY_3_YYY https://regex101.com/r/xS9eA5/2
has comment: http://stackoverflow.com/comment/44173519
has comment: http://stackoverflow.com/comment/44173702
upvote count: 2
has comment: http://stackoverflow.com/comment/44173644
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44173557
downvote count: 0

http://stackoverflow.com/q/27866138
type: Question
has answer: http://stackoverflow.com/a/27866217
has comment: http://stackoverflow.com/comment/44135117
has answer: http://stackoverflow.com/a/27866414
tagged with: duplicates
possible better answer: http://stackoverflow.com/a/27866217
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44135074
tagged with: arrays
tagged with: javascript
has title: Compare dates and create count javascript
linked to: http://stackoverflow.com/q/9229645
accepted answer: http://stackoverflow.com/a/27866414
tagged with: count
type: AnsweredQuestion
has body: I am trying to compare dates stored in the format 'Y-M-D H-i-s' from one array in the hopes of removing the duplicates and creating a count along side thr orignal date, I'm comparing the dates using the following code: function compare(a, b){ if(a.getDate() == b.getDate() &amp;&amp; a.getMonth() == b.getMonth() &amp;&amp; a.getFullYear() == b.getFullYear()){ return true; }else{ return false; }; }; This is how I am looping through them: times.forEach(function(timeOne){ times.forEach(function(timeTwo){ if(compare(timeOne, timeTwo)){ console.log("same"); }else{ console.log("different"); count.push(timeOne); }; }); }); When I do this it does not seem to work and simply removes the first 1619 values, it does not push to the count array and causes my browser to crash. Any suggestions on how to overcome this or a better way to achieve what I need. I am also unsure at the moment on how to create the count along side. Edit --- Here is the remaining code for the programme: var results = &lt;?php echo $results; ?&gt;, times = [], count = []; results.forEach(function(result){ times.push(new Date(result.time)); }); I would also like to mention that the items array is near on 30,000 entries. So I need a way that will allow to to cut down on processing time drastically.

http://stackoverflow.com/a/27906411
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27906308
upvote count: 1
has body: I'd suggest you have input boxes and don't do any converting Simply use CSS to remove the borders and add a dashed border bottom input[type=text]{ border:none; border-bottom:1px dashed #777; } &lt;!-- something like that --&gt; add a click handler to add a edited class, so you can remove the bottom border input[type=text].edited{ border:none; } That way you don't need to replace html elements, you just style them to look different

callback
tags question: http://stackoverflow.com/q/27876295
tags question: http://stackoverflow.com/q/27893675
tag name: callback
tags question: http://stackoverflow.com/q/27880947
tags question: http://stackoverflow.com/q/27925357
tags question: http://stackoverflow.com/q/27816084
tags question: http://stackoverflow.com/q/27822217
tags question: http://stackoverflow.com/q/27864294
tags question: http://stackoverflow.com/q/27849151
tags question: http://stackoverflow.com/q/27826615
tags question: http://stackoverflow.com/q/27941373
tags question: http://stackoverflow.com/q/27870123
tags question: http://stackoverflow.com/q/27862372
type: Tag
tags question: http://stackoverflow.com/q/27885255

http://stackoverflow.com/a/42663333
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/72464241
has comment: http://stackoverflow.com/comment/78330498
has comment: http://stackoverflow.com/comment/72510152
has body: arguments.callee is the function itself and doesn't get affected by the name of the function. var f = function() { console.log(arguments.callee.a); }; f.a = 'Test'; f();
type: Answer
has comment: http://stackoverflow.com/comment/72463575
has comment: http://stackoverflow.com/comment/137107187
downvote count: 1
score: 19
accepted answer of: http://stackoverflow.com/q/27887281
has comment: http://stackoverflow.com/comment/72510399
upvote count: 20
has comment: http://stackoverflow.com/comment/130769831
answers question: http://stackoverflow.com/q/27887281
has comment: http://stackoverflow.com/comment/72466687
has comment: http://stackoverflow.com/comment/72464605
has comment: http://stackoverflow.com/comment/72510038

http://stackoverflow.com/comment/44287949
comment on: http://stackoverflow.com/q/27946290
has text: Don't forget to specify the language/program you use. Many flavors of regex don't have negative look behind for example...
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27810672
has comment: http://stackoverflow.com/comment/44030244
has comment: http://stackoverflow.com/comment/44030348
type: UnansweredQuestion
has body: I want make that the width of images ocuppy entire page just like this: http://i1240.photobucket.com/albums/gg491/Nerio_Navea/Screenshots/GoogleChrome2014-12-30220149_zps99e94bc2.png but I can't find a property for this. I'm new using Jquery but I understand Javascript Please someone helpme with this i'm new on StackOverflow Sorry for my english ;D
tagged with: css
has title: ResponsiveSlides How do I make the width of the images occupy entire page?
has answer: http://stackoverflow.com/a/27810828
has answer: http://stackoverflow.com/a/27810738
tagged with: responsive-slides
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44030051
has comment: http://stackoverflow.com/comment/44030088

http://stackoverflow.com/q/27922377
has answer: http://stackoverflow.com/a/27922405
type: AnsweredQuestion
tagged with: foreach
has comment: http://stackoverflow.com/comment/44241669
type: Question
has comment: http://stackoverflow.com/comment/44249357
answer count: 2
tagged with: function
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27922405
has title: Calling class function in loop
tagged with: class
score: 0
has answer: http://stackoverflow.com/a/27922402
has body: I'm using jQuery and wrote the following code: function Test() { this.value = ''; this.someFunction = function() { // do something } this.loopFunction = function() { var array = ['one', 'two', 'three']; array.foreach(function() { // calling someFunction not possible because 'this' is defined as value of loop this.someFunction(); }); } } My problem is that i can't call the function someFunction in the loop because the keyword 'this' is now defined as value of the loop. Is there a way to do this without loosing this 'class' stucture?
possible better answer: http://stackoverflow.com/a/27922402
has comment: http://stackoverflow.com/comment/44248136

http://stackoverflow.com/q/27860772
has answer: http://stackoverflow.com/a/27860825
accepted answer: http://stackoverflow.com/a/27860864
tagged with: angularjs
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27860864
score: 1
possible better answer: http://stackoverflow.com/a/27860825
has title: Angularjs show directive only when an image in his children is loaded
type: Question
has body: I have a list that has elements with images in it. I would love to show the elements only when there images have been fully loaded. Here's what I have so far: .directive... template: '&lt;md-item ng-show="{{showItem}}" ng-transclude&gt;&lt;/md-item&gt;', link: function($scope, iElm, iAttrs, controller) { $scope.showItem = false; iElm.find('img').bind('load' , function(e) { $scope.$apply('showItem = true'); }); } There is one image about 2-3 children down the DOM, the binding function work fine, but the '$scope.$apply('showItem = true');' part doesn't do anything...
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/44092300
type: QuestionComment
has text: It should always run after the loop: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop. However, you might still get a different output, depending on how `console.log` calls are processed.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/27844230

http://stackoverflow.com/q/27887708
tagged with: javascript
tagged with: html-table
answer count: 1
has answer: http://stackoverflow.com/a/27888234
tagged with: input
has comment: http://stackoverflow.com/comment/44181531
has comment: http://stackoverflow.com/comment/44176390
type: AnsweredQuestion
has body: I've been trying to do this: When the user clicks one of the input boxes in the table to enter their username the Javascript will return the cell's value that is in the next column (job id) to a variable, so then I can use that variable which is the primary key in the mysql table to update the database with the username they enter. I have found some code that outputs the index of the input box to an alert. I need help editing this Javascript so it finds the value of the column (job id) next to the input box the user clicks into. below is the table HTML Enter Username Then Press Log On Button Job Id Log off Log on 67 Log off Log on 68 JSFIDDLE After all day searching I've found what I'm looking for, JSFIDDLE JQUERY ANSWER
tagged with: onclick
score: 0
accepted answer: http://stackoverflow.com/a/27888234
type: Question
has title: On click of input box in table return cell value on the same row as input box but different column

http://stackoverflow.com/comment/44252190
type: Comment
comment on: http://stackoverflow.com/q/27927351
score: 1
has text: The error isn't isolated to your code. `EADDRINUSE` means that there is another process on your computer that's already listening on the port you're trying to use here. You'll need to either find and kill the other process or listen on an unused port.
type: QuestionComment

http://stackoverflow.com/q/27867088
tagged with: google-chrome-extension
answer count: 1
has answer: http://stackoverflow.com/a/27870638
has body: I need to build Google Chrome plugin, what will track all clicks on all links on all pages. After click on link, instead of page opening plugin must catch click, plugin must obtain href attribute of the clicked link, change something in this URL and open page with new, changed URL. Is it possible to make?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27870638
tagged with: google-chrome-devtools
tagged with: google-chrome
has title: Track onclick actions
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/113555199
type: Comment
comment on: http://stackoverflow.com/a/27846068
has text: Any suggesions of html beautifiers on npm that can add linebreaks where none exist?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44213638
has text: @Fawn I saw your comment just after I posted this! Glad you got it sorted
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27907182
type: Comment

http://stackoverflow.com/a/27871122
answers question: http://stackoverflow.com/q/27870671
has body: Is that what you want? (fiddle) var insert = document.getElementById('insertitem'); insert.addEventListener('click', function() { var table = document.getElementById('insertfirsttable'), itemType = prompt("Enter the Item type"), filling1 = prompt("Enter the filling"), filling2 = prompt("Enter the filling"), filling3 = prompt("Enter the filling"), stock = prompt("Enter the amount in stock"), minimum_Stock = prompt("Enter the stock minimum"); for (var r = 0; r < 1; r += 1) { var x = document.getElementById('insertfirsttable').insertRow(r); for (var c = 0; c < 10; c += 1) { var y = x.insertCell(c); } table.rows[r].cells[0].innerHTML = itemType; table.rows[r].cells[1].innerHTML = filling1; table.rows[r].cells[2].innerHTML = filling2; table.rows[r].cells[3].innerHTML = filling3; table.rows[r].cells[4].innerHTML = stock; table.rows[r].cells[5].innerHTML = minimum_Stock; table.rows[r].cells[9].style.width = "100px"; var CreateBtn = document.createElement("button"); CreateBtn.innerHTML = "sell"; CreateBtn.id = "sellbtn"; CreateBtn.style.width = "100px"; CreateBtn.style.height = "25px"; CreateBtn.style.cursor = "pointer"; CreateBtn.style.fontSize = "18px"; table.rows[r].cells[9].appendChild(CreateBtn); var sellBtn = document.getElementById("sellbtn"); CreateBtn.onclick = function Sell() { var sell = prompt("Enter the amount of stock you're selling"); for (var a = 0; a < table.length; a += 1) { for (var b = 0; b < table.cells.length; b += 1) { } } table.rows[a].cells[4].innerHTML = parseInt(table.rows[a].cells[4].innerHTML) - sell; table.rows[a].cells[7].innerHTML = (parseInt(table.rows[a].cells[7].innerHTML)) ? parseInt(table.rows[a].cells[7].innerHTML) + parseInt(sell) : sell; } } }); body { margin: 0; padding: 0; background-color: #E6E6E6; font-size: 20px; } table { border-spacing: 1px; width: 100%; } th { padding: 1px; } #firsttablediv { width: 100%; } #firsttable { color: white; background-color: green; } #insertitem { width: 100%; padding: 2px; font-size: 20px; cursor: …
score: 0
type: Answer

ember-simple-auth
tags question: http://stackoverflow.com/q/27947274
type: Tag
tags question: http://stackoverflow.com/q/27818159
tag name: ember-simple-auth
tags question: http://stackoverflow.com/q/27908986

http://stackoverflow.com/a/27929436
upvote count: 3
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27928466
answers question: http://stackoverflow.com/q/27928466
has body: Like Fals mentioned you can pass in the data object as an attribute. You can then modify this value directly and the two way databinding will keep it updated in the controller. I created an example on plnkr below. angular .module('snapshot', []) .controller('snapshotCtrl', function(){ var sc = this; sc.watchData = { x : 0, y: 0, image: null }; }) .directive('snapshot', function () { return { restrict: 'E', scope: { width: "=", height: "=", watchData: '=' }, template: ' Mark ', link: function(scope, elem, attrs) { console.log(scope.dataToWatch); }, controller: function ($scope, $element) { $scope.mark = function(event) { $scope.watchData.x = event.clientX; $scope.watchData.y = event.clientY; } $scope.takeSnapshot = function() { var context = canvas.getContext("2d"); context.drawImage(video, 0, 0, $scope.width, $scope.height); $scope.gotIt = true; $scope.cameraOn = false; $scope.setMarker = true; $scope.watchData.image = canvas.toDataURL("image/jpeg"); } } } }); http://plnkr.co/edit/Tc5HigNq8Pr2nD8yUl59?p=preview
score: 3

http://stackoverflow.com/a/27851108
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: ngInit was intended for aliasing. ng-init="item = product" According to the documentation The only appropriate use of ngInit is for aliasing special properties of ngRepeat, as seen in the demo below. Besides this case, you should use controllers rather than ngInit to initialize values on a scope.
answers question: http://stackoverflow.com/q/27851078

http://stackoverflow.com/comment/44052670
comment on: http://stackoverflow.com/q/27810292
type: QuestionComment
type: Comment
has text: Thanks for your help. You didn't fix it directly, but by checking the id of the chart I was updating, I discovered I was calling the method I have to add points two extra times and passed a null value. That was my problem. Thanks.
score: 0

http://stackoverflow.com/q/27892165
has body: I have the below style of list items. &lt;li onclick="set_item('BRISBANE')" data-lat="-27.46758" data-lng="153.027892"&gt; BRISBANE QLD 4000 &lt;/li&gt; When the item is clicked its getting the information but how can I get the other 2 items in other 2 textboxes? HTML &lt;input type="text" id="country_id" onkeyup="autocomplet()"&gt; &lt;input type="text" id="latitude"&gt; &lt;input type="text" id="longitude"&gt; JavaScript function set_item(item) { $('#country_id').val(item); $('#country_list_id').hide(); var $this = $(this), lng = $this.data('lng'), lat = $this.data('lat'); $('#latitude').val(lat); $('#longitude').val(lng); alert($this.data('lng')); } I tried to use the above JS to use $this.data('lng') but not sure why its not working.
accepted answer: http://stackoverflow.com/a/27892262
possible better answer: http://stackoverflow.com/a/27892279
has comment: http://stackoverflow.com/comment/44185571
has comment: http://stackoverflow.com/comment/44185498
tagged with: javascript
tagged with: jquery
has title: jQuery get attribute on click
has comment: http://stackoverflow.com/comment/44185540
has comment: http://stackoverflow.com/comment/44185518
has comment: http://stackoverflow.com/comment/44185565
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44185485
score: 0
has answer: http://stackoverflow.com/a/27892262
type: Question
has comment: http://stackoverflow.com/comment/44185478
has answer: http://stackoverflow.com/a/27892279
answer count: 2

http://stackoverflow.com/q/27871026
has answer: http://stackoverflow.com/a/27889894
has answer: http://stackoverflow.com/a/27871908
has title: GooglePlus login handle result
accepted answer: http://stackoverflow.com/a/27889894
type: AnsweredQuestion
type: Question
tagged with: polymer
has body: On my Polymer-Page I try to login to my google-plus page and retrieve my name and cover-photo url. For that purpose I use a google-signin element that runs the following function when login finishes: loginSuccess: function(e){ console.log("Success!"); gapi.client.load('plus', 'v1', function() { var request = gapi.client.plus.people.get( {'userId' : 'me'} ); request.execute(function(retr){ console.log("Data Loaded"); console.log(retr); this.myFunction(retr); }); }); } Up to "Data Loaded" everything works great, also the console prints out the whole result object from google plus. But I am not able to execute functions (this.myFunction) or access data from polymer there. How do I store the result data from the gapi-request into my polymer variables??? Thanks, Malte
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27871908

http://stackoverflow.com/comment/44194063
has text: Note: is the correct way to write a linebreak in HTML
comment on: http://stackoverflow.com/q/27896856
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27875258
has body: Firstly Kendo Window is a specific Kendo UI widget in wherein widget element does not have k-window class but k-window-content. Class k-window is adding to element container. Secondly to get Kendo Window instance you shoult use .data('kendoWindow') method instead of .kendoWindow(). And finally if you would have more than one window open you have to iterate for all of them to perform an action individually. Therefore your code centering all Kendo windows on window.resize() event should looks like: $(window).resize(function() { var windows = $(".k-window-content"); windows.each(function(i,v){ $(v).data("kendoWindow").center(); }); }); Here is Kendo UI Dojo example: http://dojo.telerik.com/OjuwU
upvote count: 1
answers question: http://stackoverflow.com/q/27855749
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44211857
comment on: http://stackoverflow.com/q/27905978
score: 0
type: Comment
type: QuestionComment
has text: @Pointy I don't want to use attr or prop etc etc !! ! I want to see this attribute with element when it checked !! prop / attr not do that [Check this] (http://stackoverflow.com/questions/27679690/attrchecked-checked-attrchecked-true-not-adding-attribute-in-h)

http://stackoverflow.com/a/27827317
has body: You might want to try the CSS property pointer-events: img.overlay { pointer-events: none; } "The CSS property pointer-events allows authors to control under what circumstances (if any) a particular graphic element can become the target of mouse events. When this property is unspecified, the same characteristics of the visiblePainted value apply to SVG content. In addition to indicating that the element is not the target of mouse events, the value none instructs the mouse event to go "through" the element and target whatever is "underneath" that element instead." (Source: MDN)
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44061034
answers question: http://stackoverflow.com/q/27826040

http://stackoverflow.com/q/27955586
type: UnansweredQuestion
tagged with: ruby-on-rails
type: Question
has body: Can I use https://stripe.com/docs/stripe.js a full alternative of the server side code, for example, gem stripe in Ruby? I figure I can do something in stripe.js but it will only get me so far. In particular, I can't create and manage Subscriptions, Invoice, InvoiceItems in stripe.js, can I?
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27955637
score: 0
has title: Is stripe.js is full alternative to the server code (gem stripe)?
tagged with: stripe-payments
tagged with: ruby

http://stackoverflow.com/comment/44063199
type: Comment
comment on: http://stackoverflow.com/q/27828373
score: 1
has text: Add cache headers from server or use jQuery ajax cache options.
type: QuestionComment

http://stackoverflow.com/comment/44263678
has text: 2 is a javascript object, with the firstName and lastName properties.
type: QuestionComment
comment on: http://stackoverflow.com/q/27932973
type: Comment
score: 1

http://stackoverflow.com/comment/44095031
type: QuestionComment
has text: possible duplicate of [Disabling a anchor with a click event](http://stackoverflow.com/questions/8785833/disabling-a-anchor-with-a-click-event)
comment on: http://stackoverflow.com/q/27845570
score: 0
type: Comment

http://stackoverflow.com/q/27825813
score: 1
has title: Which function is the root function in javascript?
has comment: http://stackoverflow.com/comment/44057351
favorite count: 0
has comment: http://stackoverflow.com/comment/44057417
type: Question
has answer: http://stackoverflow.com/a/27825830
linked to: http://stackoverflow.com/q/23622695
linked to: http://stackoverflow.com/q/14162038
has body: I'm trying understand core javascript. it's little bit confusing. When I evaluate Object instanceof Function its true , and Function instanceof Object its also true. How and why?
has comment: http://stackoverflow.com/comment/44057420
duplicate of: http://stackoverflow.com/q/14162038
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44057517
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44057468
has comment: http://stackoverflow.com/comment/44057389
downvote count: 0

http://stackoverflow.com/q/27884120
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/44530105
favorite count: 0
has body: We are using grunt-html-angular-validate package for HTML lints. It uses W3C online validator tool under-the-hood and, so far, it did a great job in validating our angular templates. Today, it failed while checking the latest changes pulled from the repository with the following error: Validating src/login/login.html ...ERROR [L37:C108] Bad value {{regCodeRequired}} for attribute autofocus on element input. Here are the related lines where it fails: &lt;div class="auth-reg-code-block" ng-if="regCodeRequired"&gt; &lt;input class="form-control" type="text" name="regCode" id="regCode" ng-model="user.regCode" autofocus="{{regCodeRequired}}" placeholder="Registration Code" required&gt; &lt;/div&gt; This is basically a field for entering a registration code for the two-factor authentication. regCodeRequired is a boolean variable that is set to true once the user passed the first login/password authentication step. And I see the input appearing with a focus on it (using chrome 39) - it is working. Question: I'm pretty sure there is a reason for the validation tool to complain, but I'm not sure how to proceed. Are we using autofocus attribute incorrectly? How should we fix the validation error? I've looked through the W3C validator errors trying to find an explanation, but there is nothing about autofocus there. Also, nothing inside the w3cjs github repository. Here is the grunt configuration for htmlangular: htmlangular: { options: { relaxerror: [ 'Element head is missing a required instance of child element title.', 'Attribute href without an explicit value seen.', '&amp; did not start a character reference.', 'not allowed on element form at this point.', 'not allowed as child of element', 'Element img is missing required attribute src.' ], reportpath: null }, all: [ "&lt;%= app.src %&gt;/*.html", "&lt;%= app.src %&gt;/**/*.html" ] } Would appreciate any pointers.
tagged with: angularjs
score: 6
has comment: http://stackoverflow.com/comment/44170117
upvote count: 6
has comment: http://stackoverflow.com/comment/44558883
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28105103
tagged with: angular-template
has comment: http://stackoverflow.com/comment/44529430
has title: Bad value for attribute autofocus
type: Question
has comment: http://stackoverflow.com/comment/44181161
has comment: http://stackoverflow.com/comment/44524493
has comment: http://stackoverflow.com/comment/44170028
tagged with: autofocus
tagged with: javascript
has comment: http://stackoverflow.com/comment/44170024
possible better answer: http://stackoverflow.com/a/28076241
answer count: 2
has answer: http://stackoverflow.com/a/28105103
has answer: http://stackoverflow.com/a/28076241

http://stackoverflow.com/q/27933374
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/51323234
score: 3
upvote count: 3
tagged with: react-router
has body: I am firing a method : this.transitionTo('route', {},{search: this.state.search, type: this.state.type}); which passes query params in URL http://...route?search=%param10&amp;type=param2 Is there equivalent method that passes these parameters without printing in URL ??
linked to: http://stackoverflow.com/q/27891667
type: Question
has title: react-router transitionTo(routeNameOrPath, [params[, query]]) hide query from URL
tagged with: reactjs
tagged with: javascript
has answer: http://stackoverflow.com/a/29127165

http://stackoverflow.com/q/27813492
has comment: http://stackoverflow.com/comment/44091645
has comment: http://stackoverflow.com/comment/44051048
has comment: http://stackoverflow.com/comment/44051004
tagged with: javascript
has answer: http://stackoverflow.com/a/28440710
answer count: 2
has comment: http://stackoverflow.com/comment/44215312
upvote count: 1
accepted answer: http://stackoverflow.com/a/27822561
favorite count: 0
tagged with: d3.js
tagged with: c3.js
possible better answer: http://stackoverflow.com/a/28440710
has title: Incremental scatter plot in c3.js
has answer: http://stackoverflow.com/a/27822561
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I need to display data points in a scatter plot using c3.js. The data points arrive in batches, and I want to update the plot incrementally as the new points arrive. The first batch is given while initializing the plot, and displays fine. But when I use flow to update the plot, the earlier points get erased. Also, the X axis does not display the correct X coordinates. [Edit: added clarification] After the flow, the points appear at (3, 1), (4, 1), (5, 1) and not (1.5, 1), (2.5, 1), (3.5, 1) as specified in the data.] Am I missing something? JsFiddle: http://jsfiddle.net/cornea/b33usb69/ var chart = c3.generate({ data: { x: 'A', columns: [ ['A', 1.5, 2.5, 3.5], ['B', 2.0, 2.0, 2.0] ], type: 'scatter', types: { 'B': 'scatter' } }, axis: { x: { label: 'A', tick: { fit: true } }, y: { label: 'B' } } }); setTimeout(function () { chart.flow({ columns: [ ['A', 1.5, 2.5, 3.5], ['B', 1.0, 1.0, 1.0] ] }); }, 2000); Thanks.
type: Question

http://stackoverflow.com/comment/44292608
has text: Yes something like this. But there is one drawback - on the list is 17 items and when I set width and height of each item to 50px, not all items will be shown...
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27924618

http://stackoverflow.com/comment/104208246
type: Comment
has text: This is old but wanted to throw this out there, I was running into issues using .keypress and had to switch to something like the solutions below that use the .on syntax.
type: QuestionComment
comment on: http://stackoverflow.com/q/27814908
score: 0

http://stackoverflow.com/a/27940797
answers question: http://stackoverflow.com/q/27940552
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44277727
has body: if(($tds.eq(0).text() != id) &amp;&amp; ($tds.eq(1).text() != product)){ This only triggers when both fields changed, change it to a "||" Also check out this: https://developer.mozilla.org/en-US/docs/Web/Events/input for capturing contenteditable changes.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27940552
type: AcceptedAnswer

http://stackoverflow.com/a/76310938
answers question: http://stackoverflow.com/q/27951843
has body: After try korhojoa answer, it's not working and need some adjustments: To: Demo-Recipient <demo@demo.example.com> Subject: EML with attachments X-Unsent: 1 Content-Type: multipart/mixed; boundary=--boundary_text_string ----boundary_text_string Content-Type: text/html; charset=UTF-8 Example ----boundary_text_string Content-Type: application/octet-stream; name=demo.txt Content-Transfer-Encoding: base64 Content-Disposition: attachment ZXhhbXBsZQ== ----boundary_text_string Content-Type: application/octet-stream; name=demo.log Content-Transfer-Encoding: base64 Content-Disposition: attachment ZXhhbXBsZQ== ----boundary_text_string--
type: Answer
score: 0

http://stackoverflow.com/comment/44206829
has text: You can bind to `change` event.
type: Comment
comment on: http://stackoverflow.com/q/27903765
score: 0
type: QuestionComment

http://stackoverflow.com/a/27918801
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44278175
has comment: http://stackoverflow.com/comment/44316328
has comment: http://stackoverflow.com/comment/44316686
has body: I'd iterate over the needle, and try each variation manually function check(needle, haystack) { if (haystack.replace(/\s/g, '').indexOf(needle) === 0) return true; return needle.split('').some(function(char, i, arr) { var m = (i===0 ? '' : ' ') + needle.slice(0,i) +' '+ needle.slice(i); return haystack.indexOf(m) != -1; }); }
type: Answer
has comment: http://stackoverflow.com/comment/44239096
accepted answer of: http://stackoverflow.com/q/27918439
has comment: http://stackoverflow.com/comment/44242993
has comment: http://stackoverflow.com/comment/44237827
answers question: http://stackoverflow.com/q/27918439
has comment: http://stackoverflow.com/comment/44238061
has comment: http://stackoverflow.com/comment/44238404
has comment: http://stackoverflow.com/comment/44269507
has comment: http://stackoverflow.com/comment/44267045
score: 0
has comment: http://stackoverflow.com/comment/44282230

http://stackoverflow.com/comment/44072936
has text: using beta 8 let me try the upgrade real quick.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27832142

http://stackoverflow.com/a/27957185
has body: Change: var Num1 = Num1 +1;. To Num1 = Num1 +1; // or just Num1++ You are making a new local variable each time (notice the var) other than updating the global one.
accepted answer of: http://stackoverflow.com/q/27957154
has comment: http://stackoverflow.com/comment/44308926
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27957154
type: Answer

http://stackoverflow.com/comment/84605595
score: 0
type: Comment
has text: Nope,You Provide Only Local link
comment on: http://stackoverflow.com/a/46340844
type: AnswerComment

http://stackoverflow.com/comment/44142507
score: 1
type: QuestionComment
has text: According to http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$stateProvider, templateUrl can be a function which is passed the current state params... `templateUrl: function(params) { return myTemplates[params.pageId]; }`
type: Comment
comment on: http://stackoverflow.com/q/27863125

http://stackoverflow.com/comment/44340133
type: Comment
comment on: http://stackoverflow.com/a/27969115
has text: I tried your example but it doesn't fill the sub-fields (city,postal,address). Not sure if I follow - you'd like to fill the sub-fields and clear the autocomplete textbox itself? J
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44292262
has text: All good, hope you get it worked out.
comment on: http://stackoverflow.com/q/27947577
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27949211
answers question: http://stackoverflow.com/q/27882764
accepted answer of: http://stackoverflow.com/q/27882764
upvote count: 2
has body: In the function you supply to create, you can return a cleanup function to call when the observer unsubscribes from your observable. You should supply a function which stops your animation frame requests. Here's a working observable that does what you want that I wrote a few years ago: Rx.Observable.animationFrames = function () { /// &lt;summary&gt; /// Returns an observable that triggers on every animation frame (see https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame ). /// The value that comes through the observable is the time(ms) since the previous frame (or the time since the subscribe call for the first frame) /// &lt;/summary&gt; var request = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame, cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.msCancelAnimationFrame || window.msCancelRequestAnimationFrame; return Rx.Observable.create(function (observer) { var requestId, startTime = window.mozAnimationStartTime || Date.now(), callback = function (currentTime) { // If we have not been disposed, then request the next frame if (requestId !== undefined) { requestId = request(callback); } observer.onNext(Math.max(0, currentTime - startTime)); startTime = currentTime; }; requestId = request(callback); return function () { if (requestId !== undefined) { var r = requestId; requestId = undefined; cancel(r); } }; }); }; Usage: Rx.Observable.animationFrames().take(5).subscribe(function (msSinceLastFrame) { ... });
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/27876341
answer count: 1
tagged with: web
has title: Is it possible to link values between multiple web pages?
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27876435
upvote count: 1
has comment: http://stackoverflow.com/comment/44154161
has body: I have created a html/css website with different pages, it is a menu and I would like to add checkboxes which add up the total of what they wish to order. As all other aspects of the menu are separate I would like this to be separate so I have created another page and assigned values to each check box and the total works when its on the same page nut not when on different, is there any way to overcome this? This is the code: &lt;script type="text/javascript"&gt; function checkTotal() { document.listForm.total.value = ''; var sum = 0; for (i=0;i&lt;document.listForm.choice.length;i++) { if (document.listForm.choice[i].checked) { sum = sum + parseInt(document.listForm.choice[i].value); } } document.listForm.total.value = sum; } &lt;/script&gt; &lt;input type="checkbox" name="choice" value="8.99" onchange="checkTotal()"/&gt;&amp;pound;8.99&lt;br/&gt; on another page &lt;p&gt;The Total Of The Order is: &lt;input type="text" size="2" name="total" value="0"/&gt; Please help and if it isn't obvious I am a beginner
downvote count: 1
linked to: http://stackoverflow.com/q/1458724
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27876435

http://stackoverflow.com/comment/44250846
comment on: http://stackoverflow.com/a/27917817
type: AnswerComment
has text: @TedHopp My regex instances do depend on a specific order of execution as you suggest. Thanks for picking up on this.
type: Comment
score: 0

http://stackoverflow.com/a/27841097
has comment: http://stackoverflow.com/comment/44086565
has comment: http://stackoverflow.com/comment/44086719
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27841001
answers question: http://stackoverflow.com/q/27841001
has comment: http://stackoverflow.com/comment/44085841
type: Answer
has body: $('form').submit(function(event) { $(this).find('[name=yourfieldsname]').val(); }); should do the trick.
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44086644

http://stackoverflow.com/a/49747253
has body: In AngularJS you can redirect your form (on submit) to other page by using window.location.href=''; like below: postData(email){ if (email=='undefined') { this.Utils.showToast('Invalid Email'); } else { var origin = 'Dubai'; this.download.postEmail(email, origin).then(data =&gt; { ... }); window.location.href = "https://www.thesoftdesign.com/"; } } Simply try this: window.location.href = "https://www.thesoftdesign.com/";
downvote count: 1
upvote count: 6
score: 5
answers question: http://stackoverflow.com/q/27941876
type: Answer

http://stackoverflow.com/comment/109042290
comment on: http://stackoverflow.com/a/27928809
type: Comment
has text: Im working with mp4 files, it worked for me, but the file is still showing up at the original dir and when i click on the mp4 file (using my android device) it shows an error, when i try to delete it it shows another error saying i cant delete the file, any idea?
score: 0
type: AnswerComment

http://stackoverflow.com/q/27948341
has answer: http://stackoverflow.com/a/39911539
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
has comment: http://stackoverflow.com/comment/44292103
has title: how to get long press event in angular js?
has answer: http://stackoverflow.com/a/27948868
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 9
has body: I am trying to get long press event in angular js .I found the solution from here https://gist.github.com/BobNisco/9885852 But I am not able to get log on console .here is my code. http://goo.gl/ZpDeFz could you please tell me where i am getting wrong .. $scope.itemOnLongPress = function(id) { console.log('Long press'); } $scope.itemOnTouchEnd = function(id) { console.log('Touch end'); }
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/36414606
score: 9
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/comment/44092230
comment on: http://stackoverflow.com/a/27844259
type: Comment
score: 1
type: AnswerComment
has text: Or rewrite document.write as I suggested

http://stackoverflow.com/a/27906863
has comment: http://stackoverflow.com/comment/44213237
downvote count: 0
has body: AFAIK it's configurable when you create controller that handle that uploads, like: req.file('avatar').upload({ maxBytes : 2000000 // integer }, function (err, uploadedFiles) { if (err) return res.send(500, err); return res.json({ message: uploadedFiles.length + ' file(s) uploaded successfully!', files: uploadedFiles }); }); But they said it's currently still experimental. Look at this Skipper's Docs.
answers question: http://stackoverflow.com/q/27906740
type: Answer
has comment: http://stackoverflow.com/comment/44226174
score: 2
upvote count: 2

http://stackoverflow.com/comment/44185152
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27888234
type: Comment
has text: Thank you very much for your help, I've decided to use jquery, I found the code after searching all day....

http://stackoverflow.com/q/27956307
accepted answer: http://stackoverflow.com/a/27965226
score: 0
tagged with: datatables
answer count: 1
has body: I am trying to include an invisible column in a jQuery DataTable that can be set to default true in place of a null or undefined encountered in the data source. Say I am working with a 6-columns DataTable. The first 5 columns are visible. The 6th column is set to not be visible. And it must contain either a true or false, regardless of whether the data source object has the corresponding key. In the column definitions for the DataTable, I tried this but it did not work. { "defaultContent": true, "data": "existing", "visible": false } According to the API, I think defaultContent works only when data is null. Maybe that's why it does not work. I have provided the HTML, JS data and JS code for initializing the DataTable. Notice that once the DataTable is loaded and rendered, I dynamically append a row and re-draw. The data for this row contains the 6th column property and that is gets set just fine. HTML: JavaScript (data initialization): var dataSet = [ {'engine':'Webkit','browser':'Safari 1.2','platform':'OSX.3','version':'125.5','grade':'A'}, {'engine':'Other browsers','browser':'All others','platform':'-','version':'-','grade':'U'} ]; JavaScript (DataTable creation and initialization): $('#demo').html(' '); $('#example').dataTable( { "data": dataSet, "columns": [ { "sortable" : false, "data": null, "defaultContent": " Select ", "title" : "Choose" }, { "title": "Engine", "data": "engine" }, { "title": "Browser", "data": "browser" }, { "title": "Platform", "data": "platform" }, { "title": "Version", "data": "version", "class": "center" }, { "title": "Grade", "data": "grade", "class": "center" }, { "defaultContent": true, "data": "existing", "visible": false } ], initComplete: function(oSettings, json) { console.log('drawing complete'); if (oSettings.fnRecordsTotal() > 1) { $('#example').DataTable().row.add({ 'engine' : 'Presto', 'browser' : 'Opera 7.5', 'platform' : 'Win 95+ / OSX.2+', 'version' : '-', 'grade' : 'A', 'existing' : false }).draw(); } } } ); Here is the…
type: AnsweredQuestion
has title: jQuery DataTables default column value
type: Question
has answer: http://stackoverflow.com/a/27965226
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27876829
has title: Jquery - Display element on change
has answer: http://stackoverflow.com/a/27877013
downvote count: 2
has comment: http://stackoverflow.com/comment/44155200
type: AnsweredQuestion
has body: I've searched and searched but my jquery/js skills are so poor I can't get it to work. What I desire is for each option in the selection a different is displayed for further information. Is it possible to recieve mail? Yes No Yes can recieve mail. No can't recieve mail. When the value is 1 it should display 'yesmail' and option 2 should display 'nomail'. I've tried several lines of coding gathered from stackoverflow but I all had to adjust it which I can't do to this degree. Can anyone help me out here? Thanks,
score: -2
accepted answer: http://stackoverflow.com/a/27877013
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44155163

http://stackoverflow.com/comment/121561975
type: Comment
has text: You're right. I will keep it in mind the next times. Thank you
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/33502607

http://stackoverflow.com/q/27853422
upvote count: 15
tagged with: intellij-idea
downvote count: 0
has answer: http://stackoverflow.com/a/47634651
has answer: http://stackoverflow.com/a/36207009
tagged with: webstorm
has answer: http://stackoverflow.com/a/29989375
favorite count: 0
has answer: http://stackoverflow.com/a/27853492
answer count: 5
type: UnansweredQuestion
has title: how to align javascript's equals sign in webstorm
has body: all when i config my Webstorm9 settings like this ,it turns out that the sample code in the right aligns the equals sign properly but when i formatting my javascript code in the editor it doesn't work,it still shows and what i want is align the equals sign anyone who can take a look? -------EDIT------ maybe i misunderstand the checked option,but i copy the sample code to my editor then reformat it, oh,bad result..
tagged with: javascript
score: 15
has answer: http://stackoverflow.com/a/47033176
type: Question

http://stackoverflow.com/a/27892943
has comment: http://stackoverflow.com/comment/44187364
upvote count: 10
has comment: http://stackoverflow.com/comment/44187146
has comment: http://stackoverflow.com/comment/44187440
score: 10
has body: You could add the event handler to the parent element, and then determine whether one of the children elements with the desired classname is clicked: var parent = document.getElementById('parent'); parent.addEventListener('click', function (e) { if ((' ' + e.target.className + ' ').indexOf(' item ') !== -1) { // add logic here console.log(e.target); } }); Example Here or... var parent = document.getElementById('parent'); parent.addEventListener('click', function (e) { Array.prototype.forEach.call(parent.querySelectorAll('.item'), function (el) { if (el === e.target) { // add logic here console.log(e.target); } }); }); Example Here The above snippets will only work when you are clicking on the element with the specified class. In other words, it won't work if you click on that given element's child. To work around that, you could use the following: var parent = document.getElementById('parent'); parent.addEventListener('click', function (e) { var target = e.target; // Clicked element while (target &amp;&amp; target.parentNode !== parent) { target = target.parentNode; // If the clicked element isn't a direct child if (!target) { return; } // If element doesn't exist } if ((' ' + target.className + ' ').indexOf(' item ') !== -1){ // add logic here console.log(target); } }); Alternative Example var parent = document.getElementById('parent'); parent.addEventListener('click', function (e) { var target = e.target; // Clicked element while (target &amp;&amp; target.parentNode !== parent) { target = target.parentNode; // If the clicked element isn't a direct child if (!target) { return; } // If element doesn't exist } Array.prototype.forEach.call(parent.querySelectorAll('.item'), function (el) { if (el === target) { // add logic here console.log(target); } }); }); Example Here
has comment: http://stackoverflow.com/comment/44187356
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44187345
answers question: http://stackoverflow.com/q/27892905
accepted answer of: http://stackoverflow.com/q/27892905

http://stackoverflow.com/a/27940764
has comment: http://stackoverflow.com/comment/44277587
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27927588
answers question: http://stackoverflow.com/q/27927588
type: Answer
has comment: http://stackoverflow.com/comment/44277549
has body: The problem in your implementation is that you constantly add two new gelements when calling your update function. You can observe that in your JSFiddle (after a while, you have quite a bunch of gs in your svg element). How to solve that? Well, there's plenty of approaches, here's an example: First you add some containers to place your elements in: var linkContainer = svg.append('g'); var nodeContainer = svg.append('g'); (you do that right after you define the svg, i.e. outside the update function. Next, you add the elements into these containers, in the update function: var link = linkContainer.selectAll(".link").... and likewise for the nodes. This should fix the issue, I hope. Another approach would be binding the groups in the svg element to some random fixed data and use .enter().append() on that (thus making sure it's only added once, for the data is fixed...) I hope this helps!
upvote count: 1
score: 1

http://stackoverflow.com/a/27930537
type: Answer
answers question: http://stackoverflow.com/q/27930396
upvote count: 1
has body: Do you mean information about the image itself? If you want for example the value of src or perhaps title or some other attribute, you could do something like: Welcome blabla The p tag will be overwritten to include the title and src of the image (in this example)
downvote count: 0
score: 1

http://stackoverflow.com/comment/44136454
score: 1
comment on: http://stackoverflow.com/a/27866723
type: AnswerComment
has text: Thanks! I had a feeling there was a reason I couldn't get this to work! Thanks for the great explanation.
type: Comment

http://stackoverflow.com/comment/44180032
score: 1
comment on: http://stackoverflow.com/q/27889337
type: Comment
type: QuestionComment
has text: bower can resolve dependencies via git, you should look into that. in other words you can state a github project, either if it's not a bower project as a dependency

http://stackoverflow.com/q/27809224
score: 1
tagged with: date
upvote count: 1
tagged with: highcharts
answer count: 1
tagged with: javascript
favorite count: 0
has title: Error on rendering Highstock date
downvote count: 0
type: UnansweredQuestion
has body: Well, I'm trying to create highstock chart... But when I try to render the chart, the date value is wrong! You can see, my first date was 2012-11-7 (yyyy-MM-dd)... and my last date was 2012-12-7. But when the chart was rendered the date range was between 2012-12-7 2013-01-7... And I really don't know why... $(function () { Highcharts.setOptions({ credits: { enabled: false }, //0000fe colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c', '#8085e9', '#f15c80', '#e4d354', '#8085e8', '#8d4653', '#91e8e1'], lang: { loading: 'Aguarde...', months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'], weekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'], shortMonths: ['Jan', 'Feb', 'Mar', 'Abr', 'Maio', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], exportButtonTitle: "Exportar", printButtonTitle: "Imprimir", rangeSelectorFrom: "De", rangeSelectorTo: "Até", rangeSelectorZoom: "Período", downloadPNG: 'Download imagem PNG', downloadJPEG: 'Download imagem JPEG', downloadPDF: 'Download documento PDF', downloadSVG: 'Download imagem SVG' } , global: { useUTC: true } }); // Create the chart $('#container').highcharts('StockChart', { rangeSelector: { enabled: false }, navigator: { enabled: false }, title: { text: '' }, legend: { enabled: true, align: 'center', backgroundColor: '#FCFFC5', borderColor: 'black', borderWidth: 1, layout: 'vertical', verticalAlign: 'top', y: 0, shadow: true }, yAxis: { title: { text: 'Valores' }, max: 5.86, min: 4.83, showEmpty: true, plotLines: [{ value: 5.86, // val_superior color: 'green', dashStyle: 'shortdash', width: 2, label: { text: 'Limite superior' }, zIndex: 99 }, { value: 4.83, // val_inferior color: 'red', dashStyle: 'shortdash', width: 2, label: { text: 'Limite inferior' }, zIndex: 99 }] }, series: [{name: 'Água Bruta - pH', data: [ [Date.UTC(2012,11,7,9,20,0),5.19],[Date.UTC(2012,11,7,10,20),5.17],[Date.UTC(2012,11,7,11,20),5.07],[Date.UT…
has answer: http://stackoverflow.com/a/27809510
type: Question
has comment: http://stackoverflow.com/comment/44027811

http://stackoverflow.com/comment/44122455
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27858105
has text: I tried this console.log (change(50,50,20,10)); function change(amount, coins) { var res = {}; for (var i = 0; amount > 0 && i < coins.length; i++) { var value = coins[i]; if (value <= amount) { res[value] = Math.floor(amount / value); amount -= value * res[value]; } } return res; }
score: 0

http://stackoverflow.com/comment/44653477
type: Comment
comment on: http://stackoverflow.com/a/28025770
type: AnswerComment
has text: number 1 or 2. I just want to open camera no recording or photos
score: 0

http://stackoverflow.com/a/27934501
answers question: http://stackoverflow.com/q/27934400
has body: http://jsfiddle.net/cm280s9z/3/ Use alert($(":checkbox:checked").length); to get the sum of all marked checkboxes. There are several other ways of doing this too, as pointed out in this thread, such as doing it by classes on a checkbox: calculate the number of html checkbox checked using jquery
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44266655
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44266616
accepted answer of: http://stackoverflow.com/q/27934400

http://stackoverflow.com/q/27930515
has comment: http://stackoverflow.com/comment/44258472
answer count: 3
linked to: http://stackoverflow.com/q/10113366
has comment: http://stackoverflow.com/comment/44258325
has comment: http://stackoverflow.com/comment/44258341
linked to: http://stackoverflow.com/q/3003145
upvote count: 2
has answer: http://stackoverflow.com/a/27930847
has comment: http://stackoverflow.com/comment/44258393
accepted answer: http://stackoverflow.com/a/27930726
downvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44258301
possible better answer: http://stackoverflow.com/a/27930847
has title: Convert jQuery to JavaScript code equivalent
has body: I know how to use jQuery well, but I don't know so much pure JavaScript. This is my jQuery code: $(document).ready(function() { $.get('http://jsonip.com/', function(r){ var ip_address = r.ip; my_function(ip_address); }); function my_function(ip_address){ var url = "Url_to my server hosted on a different domain"; var data = {number:"1286", ip: ip_address}; $.ajax({ url: url, type: "POST", dataType: 'json', crossDomain: true, data: {data: data}, success: function (data) {console.log(JSON.stringify(data));}, error: function (xhr, error) {console.log("There was an error and data was not posted.");}});} }); What it does: it is pasted in any website, then it picks any visitors ip address and send that as JSON to my server as variable data. Problem: the code is working perfectly okay in some sites but not all the sites due to jQuery dependency. And I want to remove this and use pure JavaScript. I am getting great answers but CORS is not working, there failing them. I am using different domains since the site we are sending data to is hosted on another server.
has answer: http://stackoverflow.com/a/27930701
tagged with: javascript
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27930726
favorite count: 0
tagged with: ajax

http://stackoverflow.com/a/27953461
score: 2
has body: You can use $filter please see demo below app = angular.module("app", []); app.controller("Ctrl", Ctrl); function Ctrl($scope) { $scope.students = [{ firstname: 'Buster', lastname: 'Bluth', tagid: '4134' }, { firstname: 'John', lastname: 'McClane', tagid: '9845' }, { firstname: 'Mister', lastname: 'Spock', tagid: '0905' }]; $scope.ratings = [{ matter: 'Mathematics', note: '12', tagid: '4134' }, { matter: 'Biology', note: '13', tagid: '9845' }, { matter: 'Lenguage:', note: '14', tagid: '0905' }]; } {{student.firstname}} {{student.lastname}} | {{rating.matter}} {{rating.tagid}}
accepted answer of: http://stackoverflow.com/q/27953331
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27953331
upvote count: 2
type: Answer

http://stackoverflow.com/comment/44028574
score: 1
has text: I wouldn't think this'd be possible using the JS console, since that's sandboxed to each web page and would pose a security risk if it could access top-level browser elements. You could do this using the Chrome Extensions API though (here are the docs specific to working with tabs: https://developer.chrome.com/extensions/tabs)
comment on: http://stackoverflow.com/q/27809688
type: Comment
type: QuestionComment

polymer
tags question: http://stackoverflow.com/q/27860120
tags question: http://stackoverflow.com/q/27862450
tags question: http://stackoverflow.com/q/27882877
tags question: http://stackoverflow.com/q/27952525
tags question: http://stackoverflow.com/q/27948373
tags question: http://stackoverflow.com/q/27861875
tags question: http://stackoverflow.com/q/27871026
tags question: http://stackoverflow.com/q/27827325
tags question: http://stackoverflow.com/q/27882773
tag name: polymer
tags question: http://stackoverflow.com/q/27867845
tags question: http://stackoverflow.com/q/27850143
tags question: http://stackoverflow.com/q/27943365
tags question: http://stackoverflow.com/q/27831981
tags question: http://stackoverflow.com/q/27880333
tags question: http://stackoverflow.com/q/27924745
tags question: http://stackoverflow.com/q/27873277
tags question: http://stackoverflow.com/q/27871931
tags question: http://stackoverflow.com/q/27831125
tags question: http://stackoverflow.com/q/27946059
tags question: http://stackoverflow.com/q/27807410
tags question: http://stackoverflow.com/q/27864990
tags question: http://stackoverflow.com/q/27822291
tags question: http://stackoverflow.com/q/27954839
tags question: http://stackoverflow.com/q/27928340
type: Tag
tags question: http://stackoverflow.com/q/27843056
tags question: http://stackoverflow.com/q/27934197
tags question: http://stackoverflow.com/q/27892976
tags question: http://stackoverflow.com/q/27833552
tags question: http://stackoverflow.com/q/27887296

http://stackoverflow.com/comment/44229909
comment on: http://stackoverflow.com/q/27915109
score: 0
has text: 1) "asking for expert opinion" - opinion questions are why library recommendations are off-topic in the first place. 2) It is not Chrome API, it is HTML5 API that Webkit browsers happen to implement. 3) jQuery cannot do anything that JavaScript cannot do, so asking for a jQuery API makes no sense. 4) The snippet above clearly states what you need to do to to have any chance of being put off hold. Being belligerent is not one of those things. 5) I actually answered both your initial question as well as the follow-up. Thank you for your rudeness in return.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44260352
has text: ok. it wont work like that because both the directives have different instances of the controller `OfficeUIRibbon` and both are isolate scoped.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27930580

http://stackoverflow.com/comment/44121919
type: QuestionComment
has text: maybe this thread can help you topic tail of logfiles with php http://stackoverflow.com/questions/1102229/how-to-watch-a-file-write-in-php
score: 0
comment on: http://stackoverflow.com/q/27859671
type: Comment

http://stackoverflow.com/q/27899035
has comment: http://stackoverflow.com/comment/44198422
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44198580
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44198140
has title: innerHTML not working properly in firefox?
has comment: http://stackoverflow.com/comment/44198241
has comment: http://stackoverflow.com/comment/44198773
has comment: http://stackoverflow.com/comment/44198320
tagged with: innerhtml
has comment: http://stackoverflow.com/comment/44198472
type: Question
has comment: http://stackoverflow.com/comment/44198100
has answer: http://stackoverflow.com/a/27899813
has comment: http://stackoverflow.com/comment/44198390
has comment: http://stackoverflow.com/comment/44199056
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44198224
answer count: 1
tagged with: jquery
has body: I am setting the value of a form field using javascript. Now when I select the HTML content of that field using innerHTML the value gets disappeared. Here is the code. function test() { document.getElementById("fname").value = "Deepak"; } function test2() { alert(document.getElementById("testform").innerHTML); } &lt;form id="testform"&gt; &lt;input type="text" name="fname" id="fname"&gt; &lt;/form&gt; &lt;input type="button" value="Set Value" onclick="test()"&gt; &lt;input type="button" value="Show Inner HTML" onclick="test2()"&gt; I can not use jquery in this , so have to do it using JS only. The output should be &lt;input name="fname" id="fname" type="text" value="Deepak"&gt; But currently it shows, &lt;input name="fname" id="fname" type="text"&gt; Any workaround to solve this issue? This works fine on IE.

http://stackoverflow.com/q/27925304
upvote count: 1
has title: Minimizing reflow with Marionette
has answer: http://stackoverflow.com/a/27926167
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27947936
favorite count: 0
has answer: http://stackoverflow.com/a/27928947
answer count: 3
tagged with: marionette
score: 1
has body: I have a web application using Marionette that frequently needs to render large trees of nested views. I would like to avoid having as much reflow as possible by ensuring that the child elements are rendered and placed in the parent containers before the parent containers are placed in the DOM. How do I render these child elements to achieve this? I'm currently rendering all children views in the onRender function, and as far as I can tell, they show up at the same time as the parent, but I can't find any documentation that tells me this is what its intended use is. I've also considered the use of onBeforeShow, which I know for sure is called before the view is placed in the DOM, but it makes rerendering much more complicated, since I can't just call render then. As requested, here's a bit of code to give a better idea of what my situation is: var Layout = LayoutView.extend({ //... initialize: function() { listenTo(this.model, "some event indicating that data changed", this.render); }, onRender: function() { //Will this new view render at the appropriate time to minimize page reflows? this.someRegion.show(new view(new model())); } }); If I opt to use onBeforeShow instead, then I can either pass a reference to the container region var Layout = LayoutView.extend({ //... initialize: function() { listenTo(this.model, "some event indicating that data changed", this.callback); }, callback: function() { this.container.show(this, {forceShow: true}); }, onBeforeShow: function() { //Does not cause a page reflow, but this solution isn't pretty. this.someRegion.show(new View(new Model())); } }); var LayoutContainer = LayoutView.extend({ //... onRender: function() { var model = new LayoutModel(); var layout = new Layout({ model: model, container: this.containerRegion }); this.containerRegion.show(layout); } }); Or have a parent object listening and telling the view when to render var Layout = LayoutView.extend({ //... onBeforeShow: function() { //Does not cause a page reflow, bu…
type: UnansweredQuestion

http://stackoverflow.com/a/27819905
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27819756
has body: If You are using dynamic values then pass dynamic ids to the javascript function and then do the validation For example : for(i=0;i&lt;results;i++) { &lt;input type="text" size="20" name="age[]" id="age"&lt;?php echo i; ?&gt; &gt; } And in the javascript function read all the dynamic ids and do the validation.

http://stackoverflow.com/a/27904446
upvote count: 3
has comment: http://stackoverflow.com/comment/44209951
score: 3
accepted answer of: http://stackoverflow.com/q/27904331
has body: Can I count on implementations to always invoke the match function in ascending order of occurrence? Absolutely, yes. Matches are handled from left to right in the source string because left-to-right is how regular expression engines work their way to a string.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44208449
has comment: http://stackoverflow.com/comment/44208054
type: Answer
answers question: http://stackoverflow.com/q/27904331
has comment: http://stackoverflow.com/comment/44209016

http://stackoverflow.com/comment/44228961
type: Comment
type: QuestionComment
score: 0
has text: Not really, as stated in my comments, its because of the content type your server delivers it with.
comment on: http://stackoverflow.com/q/27914693

http://stackoverflow.com/q/27903781
score: 1
has answer: http://stackoverflow.com/a/27909906
has answer: http://stackoverflow.com/a/27933165
has body: It's possible this should be on code review, but here we go! I have a fairly large application with a lot of ajax calls. I started using Q for some async stuff, and figured I would wrap the ajax calls in Q to ensure all async methods have the same signature. I'm using a global facade method, so my ajax calls look like: App.ajax( config ).then( doWhatever ); with App.ajax looking something like this: ajax: function( config ){ var ajaxReturn = $.ajax( config ); ajaxReturn.error(function( xhr ){ // some custom error handling }); return ajaxReturn; } I modified App.ajax to look like this: ajax: function( config ){ var dfd = Q.defer(); var ajaxReturn = $.ajax( config ); ajaxReturn.done(function( results, status, xhr ){ delete xhr.then; dfd.resolve( results ); }); ajaxReturn.error(function( xhr ){ // some custom error handling dfd.reject( "some message generated by error handling" ); }); return dfd.promise; } This works, 0 changes needed on individual ajax calls themselves, but it caused the Ajax calls that cared about the "status" and "xhr" parts of the $.ajax return to stop working. I've read Q's docs about coming from jQuery, and it basically just suggests "you should treat promise-returning functions like normal synchronous functions, in that you should assume they only return a single object" Now, I didn't want to have to refactor all the calls that care about the xhr object to either take an object or use spread instead of then/done. So I added this code right before returning the Q promise: dfd.promise.then = function( callback ){ dfd.promise.then = Q().then; return dfd.promise.spread( callback ); }; and changed my resolve line to: dfd.resolve( [ results, status, xhr ] ); and now App.ajax looks like this: ajax: function( config ){ var dfd = Q.defer(); var ajaxReturn = $.ajax( config ); ajaxReturn.done(function( results, status, xhr ){ delete xhr.then; dfd.resolve( [ results, status, xhr ] ); }); ajaxReturn.error(function( xhr ){ // some custom error handling dfd.re…
type: Question
has comment: http://stackoverflow.com/comment/44212021
has title: Wrapping jQuery $.ajax behind a facade in q.js without refactoring
tagged with: javascript
has comment: http://stackoverflow.com/comment/44210483
tagged with: jquery
tagged with: http://stackoverflow.com/tag/q
has answer: http://stackoverflow.com/a/27909449
tagged with: ajax
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/44219296
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/44208290
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44211550
has comment: http://stackoverflow.com/comment/44218252
downvote count: 0

http://stackoverflow.com/q/27911124
has comment: http://stackoverflow.com/comment/44221825
has comment: http://stackoverflow.com/comment/44222447
tagged with: closures
has comment: http://stackoverflow.com/comment/44221915
tagged with: javascript
has comment: http://stackoverflow.com/comment/44221945
has comment: http://stackoverflow.com/comment/44221898
has comment: http://stackoverflow.com/comment/44222489
has comment: http://stackoverflow.com/comment/44224142
has comment: http://stackoverflow.com/comment/44222052
has comment: http://stackoverflow.com/comment/44222206
has comment: http://stackoverflow.com/comment/44224080
has comment: http://stackoverflow.com/comment/44222320
has comment: http://stackoverflow.com/comment/44222169
downvote count: 0
has comment: http://stackoverflow.com/comment/44223885
has title: getOwnPropertyDescriptor of a closured var
favorite count: 0
has comment: http://stackoverflow.com/comment/44221875
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44222137
has comment: http://stackoverflow.com/comment/44222081
has comment: http://stackoverflow.com/comment/44222175
has comment: http://stackoverflow.com/comment/44224503
has comment: http://stackoverflow.com/comment/44222509
score: 2
has comment: http://stackoverflow.com/comment/44222086
has comment: http://stackoverflow.com/comment/44222026
has comment: http://stackoverflow.com/comment/44224240
has comment: http://stackoverflow.com/comment/44222241
has comment: http://stackoverflow.com/comment/44224403
has comment: http://stackoverflow.com/comment/44222121
has comment: http://stackoverflow.com/comment/44222174
type: Question
has comment: http://stackoverflow.com/comment/44222488
has comment: http://stackoverflow.com/comment/44225674
has body: EDIT: What I am trying to do is safely access a the information about a variable without causing any side effects. "var x = 5;" can safely be changed to "var x; x = 5;". "var x" cannot however be changed to "var x; x" I believe, because under certain circumstances that could call a getter, hence me wanting to do "var x; Object.getOwnPropertyDescriptor(?, "x")" If I have a var: function x() { var y = whatever; } Is it possible to access its property descriptor?: function x() { var y = whatever; Object.getOwnPropertyDescriptor(???, "y"); }

http://stackoverflow.com/a/27870638
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27867088
has body: With the Content Scripts you can pass your own JS library into any (or particular) page, intersect clicks and prevent defaults (with regular JS API) and finally you can pass link back to the background page and use chrome.tabs API to open the window.
type: Answer
score: 1
answers question: http://stackoverflow.com/q/27867088

http://stackoverflow.com/q/27886398
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27886622
score: 0
has body: want to check if current url doesn't contains location.search do redirect to home before loading page search page must have search location like : example.com/s/page.html?search=some+query var home = "example.com", searchpage="example.com/s/page.html"; check if current page url load example.com/s/page.html without ?search=some+query redirect to home how to translate "doesn't contains" in javascript / jquery var search = window.location.search; if(window.location.href!=search) { window.location.href=home; }); I know that's wrong hope to redirect before page load content thanx alot in advance
tagged with: window.location
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44174030
type: UnansweredQuestion
upvote count: 1
has title: if current url doesn't contain location.search redirect to home
has comment: http://stackoverflow.com/comment/44173910
has comment: http://stackoverflow.com/comment/44174106
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44173911
tagged with: contains

http://stackoverflow.com/a/47913071
downvote count: 0
type: Answer
upvote count: 1
has body: Another option could be to call a webservice in your cake app.. with that in mind you can call it from any language or app... with this you are using the mechanics of cake like mark said "use the existing class" but in another form...
score: 1
answers question: http://stackoverflow.com/q/27874713

http://stackoverflow.com/q/27961647
has body: I am showing the month view in the Full Calendar. When i click a day in the month view it should display the Day/Agenda View for that particular day. Below is the code - But it shows the present days agenda view instead the one clicked. dayClick: function(date, allDay, jsEvent, view) { if (allDay) { // Clicked on the entire day $('#calendar') .fullCalendar('changeView', 'agendaDay'/* or 'basicDay' */) .fullCalendar('gotoDate', date.getFullYear(), date.getMonth(), date.getDate()); } },
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27995277
type: Question
possible better answer: http://stackoverflow.com/a/66823364
has title: FullCalenday Clicking Day change to Agenda View of that particular date
tagged with: plugins
has answer: http://stackoverflow.com/a/66823364
score: 0
answer count: 2
upvote count: 1
accepted answer: http://stackoverflow.com/a/27995277
downvote count: 1
tagged with: javascript
tagged with: fullcalendar
type: AnsweredQuestion

http://stackoverflow.com/q/27892224
has comment: http://stackoverflow.com/comment/44185778
has comment: http://stackoverflow.com/comment/44186062
has comment: http://stackoverflow.com/comment/44185738
type: Question
answer count: 2
tagged with: javascript
has title: Increase and decrease element width on window resize
score: 0
linked to: http://stackoverflow.com/q/34112037
has body: Imagen a responsive layout with an content area which is centered in browser window. When ever the window gets minimized/maximized the content area should fit the remaining space to the left and right, so no free space is wasted on smaller screens. In order to achieve that I've made a small javascript which would do the job, but it causes high amount of cpu. Is there a way to enlarge or reduce the width of the content area dynamicly with pure css? "use-strict"; (function(){ function init(){ var foo = new bar(getView()); function getView(){ return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; } window.onresize = function(){ foo(getView()); } } function bar(i) { return function(y){ if(y &gt; i) console.log('max'); if(y &lt; i) console.log('min'); i = y; } } window.addEventListener('load', init, false); })();
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/59802228
tagged with: css
has answer: http://stackoverflow.com/a/30306529

http://stackoverflow.com/a/27947431
answers question: http://stackoverflow.com/q/27940335
score: 0
type: Answer
has body: One way would be to just add something like: .click(function() { window.location='http://www.google.com'; }) to each path.

http://stackoverflow.com/q/27835305
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28107571
has comment: http://stackoverflow.com/comment/44366551
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/27857112
answer count: 2
has answer: http://stackoverflow.com/a/27857112
tagged with: webview
has body: In webview I will be loading static html file with css. webView.loadUrl("file:///android_asset/customhtml.html In that html I have also set encoding in meta tag as &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt; After this file is loaded I will be setting content as webView.loadUrl("javascript:setContent(" + JSONObject.quote(content)+")"); here is javascript `function setContent(contentToSet) { setBaseURL(); var mailContentElement = document.getElementById('mailcontentid'); mailContentElement.innerHTML = "" handleContentinHTML($('mailcontentid'),contentToSet); androidResponse(true); //method to call android js interface } function handleContentinHTML (contentEl, value) { contentEl.innerHTML = value; }` Problem: When setting contentlike filename=0000%3Cimg%20src%3da%20onerror%3dalert(test)%3Eb4911111 this gets converted to html image tag and alert message is shown. This content is not displayed exactly as in text form. some tests I tried: 1 - settinge encoding in webview settings settings.setDefaultTextEncodingName("utf-8"); 2 - convert the html file to string and load as myWebView.loadDataWithBaseURL(null, convertfiletohtmlString, "text/html", "utf-8", null); and setting the content using javascript. 3 - using escape(contentToSet) in javascript ; Nothing seems to work. Please help me an post your suggestions.
accepted answer: http://stackoverflow.com/a/28107571
linked to: http://stackoverflow.com/q/1219860
has title: Encoding issue when setting a content using javascript in android
tagged with: javascript
tagged with: jquery
tagged with: xss

http://stackoverflow.com/comment/44193871
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27896641
has text: `datatype: "xml",` change it to `datatype: "json",` and return json like this: `[{}]` an array of object/s.

http://stackoverflow.com/comment/44203454
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27901760
has text: This works for me as is in Chrome 39 and Firefox 33. Which browser are you using?
score: 0

http://stackoverflow.com/comment/44060718
score: 0
comment on: http://stackoverflow.com/q/27827337
has text: Here's a [list of template engines that support Node.js](https://github.com/joyent/node/wiki/modules#templating). Popular ones include **Jade**, **Kiwi**, **Swig**, and **Twig**, just to name a few.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27956419
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44307606
has answer: http://stackoverflow.com/a/27956601
has body: In my program there are multiple buttons, and what I want to happen is for there to be a function that would only run if all of them were pressed. I was thinking of having an if statement which would require all three buttons to be clicked, and then the function would run. Is this possible?
has answer: http://stackoverflow.com/a/27956482
has comment: http://stackoverflow.com/comment/44307714
has title: Is it possible to create an if statement involving buttons?
has comment: http://stackoverflow.com/comment/44307598
has comment: http://stackoverflow.com/comment/44307579
downvote count: 1
type: Question
answer count: 2
tagged with: if-statement
upvote count: 0
has comment: http://stackoverflow.com/comment/44307556
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44307549
tagged with: button

http://stackoverflow.com/q/27944570
has title: MS SQL Server procedure from php fails with 500 when returning query is not empty
has comment: http://stackoverflow.com/comment/44311665
score: 0
tagged with: php
answer count: 1
accepted answer: http://stackoverflow.com/a/27962319
tagged with: stored-procedures
has comment: http://stackoverflow.com/comment/44300519
tagged with: javascript
has body: I have a stored procedure, which runs ok in Management Studio. Then I have a php code, where I call it: $sql = "EXEC MyProc @Param1=1, @Param2 = 2, @Param3 = '3'"; $stmt = sqlsrv_query($conn, $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) { // and so on ... } it runs ok, with some set of parameters, that return 0 records (I simply get an empty array). But when I change the params to return values, I get 500 error in JavaScript, which is calling the PHP script. Here's how it's called in JS: dojo.xhrPost({ url: "/mySuperPhpCode.php", handleAs: "text", content: { Param1: 1, Param2: 2, Param3: 3 }, load: function (response, ioArgs) { // some actions }, error: function(response, ioArgs) { // some actions } }); I know, that 500 error can point to many troubles, but I'm out of ideas for now. My configuration: IIS 7.5, PHP 5.3.19. Ask, if any additional details needed. Upd 1: The code for processing results (inside while-loop): $rez = array(); foreach ($row as $key =&gt; $value) { if (($key=="SomeDateFieldName1"||$key=="SomeDateFieldName2"|| $key=="SomeDateFieldName3"||$key=="SomeDateFieldName4"|| $key=="SomeDateFieldName5") &amp;&amp; !is_null($value) ){ $d=get_object_vars($value); $d=$d["date"]; $zn=$d; } else { $zn=$value; } $rez[$key] = $zn; } $t[]=$rez ; $t - will be returned from php-script. One more addition: this php-file contains few calls to procedures (incoming parameters determines, which one will be called). Some of them work perfectly (in both cases: where no results and when there some records returned) and being processed with this code with no problems.
tagged with: sql-server
type: Question
has answer: http://stackoverflow.com/a/27962319
type: AnsweredQuestion

http://stackoverflow.com/comment/44146407
score: 0
comment on: http://stackoverflow.com/q/27871802
has text: @dandavis can you give an example of that as an answer? I recognize that this object relationship is neither prototypical nor classical inheritance, and I'm trying to understand how to use it correctly (and even how to think about it correctly, as evidenced by my confusion.)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44174208
has text: In IE for example you can write code in a BHO that interacts with the DOM with C++ and C# and any other .net language. In Chrome you can use C and C++ with the [Native Client](https://developer.chrome.com/native-client). Don't expect either of these to be faster - the DOM is pretty fast in JavaScript after all and there are libraries that maintain a virtual dom and do updates in bulks very fast like React.
comment on: http://stackoverflow.com/q/27886569
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44083407
comment on: http://stackoverflow.com/q/27839486
type: Comment
has text: Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve).
score: 0
type: QuestionComment

http://stackoverflow.com/q/27846634
accepted answer: http://stackoverflow.com/a/27846769
upvote count: 3
linked to: http://stackoverflow.com/q/3059044
downvote count: 1
score: 2
possible better answer: http://stackoverflow.com/a/27846783
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27846783
has title: Google Maps API marker click event not firing
has answer: http://stackoverflow.com/a/27846769
type: Question
answer count: 2
has body: Problem with the following code is that the click event is not fired. The markers appear on the map as expected, but when clicked, nothing appears in the console. I've been searching for a while now, but all the answers I find are not relevant to my code. /* * Connect to Google API, load map and markers */ function drawMarkers(markerInfo) { var mapOptions = { center: { lat: 50.601079, lng: 4.4764595}, zoom: 8, scrollwheel: false, styles: style }; var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions); for (var i = 0; i &lt; markerInfo.length; i++) { var Latlng = new google.maps.LatLng(markerInfo[i][0],markerInfo[i][1]); var title = markerInfo[i][2]; var marker = new google.maps.Marker({ position: Latlng, animation: google.maps.Animation.DROP, map: map, title:title, icon: markerUrl }); }; google.maps.event.addListener(marker, 'click', function() { console.log('test'); }); }; google.maps.event.addDomListener(window, 'load', getmarkerInfo); I've got no idea what the problem could be, because there are no errors, and I can't seem to find the problem... EDIT: When I refresh the page and I zoom out, so a marker which wasn't visible yet get's loaded in, only that one responds to the click event.
tagged with: addeventlistener
tagged with: javascript
duplicate of: http://stackoverflow.com/q/3059044
favorite count: 0
tagged with: google-maps-api-3

http://stackoverflow.com/q/27876295
has comment: http://stackoverflow.com/comment/44155178
type: Question
tagged with: javascript
tagged with: callback
has body: I need to pass some values from server-side to client-side during callback. What I need to do is to show some alert window with values form server-side. During a postback is quite easy using Page.ClientScript.RegisterStartupScript, but how to initialize a client javascript variable during a generic callback?
score: 0
has comment: http://stackoverflow.com/comment/44153992
tagged with: asp.net
has title: How to pass values from server side to client side during callback in asp.net?
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44182289

http://stackoverflow.com/comment/44109996
comment on: http://stackoverflow.com/q/27852861
has text: Does your html `modal-new-case.html` start with ` ` ? if so why dont you just provide modal controller as `CreateCaseFormCtrl` and inject `$modalInstance` and use its `close(data)` method.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44103405
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27849329
has text: One more thing when disc trigger is clicked, the slideshow starts from one slide behind the clicked trigger...
type: AnswerComment

http://stackoverflow.com/q/27950081
tagged with: rss
type: Question
has body: I'm trying to fix something which, in my mind should work ^_^ I have this PHP code: <?php class XmlToJson { public static function Parse ($url) { $fileContents= file_get_contents($url); $fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents); $fileContents = trim(str_replace('"', "'", $fileContents)); $simpleXml = simplexml_load_string($fileContents); $json = json_encode($simpleXml); return $json; } } ?> Here I read out my Xml(RSS feed) and make a Json out of it. In my showfeed.php I have this code: <?php include 'encode.php'; $json = XmlToJson::Parse("http://rss.cnn.com/rss/edition.rss"); ?> Document <?php echo $json; ?> I'm not hiding the Echo $json so I can see if it still works, else I'll just put the div on hidden. But what i'm trying to fix is, to echo the $json, then I want var myData en myData2 to have the value of the Json. From here on I try to create an array out of the Json so I can use it to draw the chart. And if this works I figured I can use for instance the title's as labels in the chart and a number from the Json as data. But I'm either making it way too difficult and there might be an easier way, or I made a mistake in my code or thinking. So what I want to do is: Read an RSS feed and use specific info to create a Chart.js. I figured this is easiest when turning the RSS into Json, but that might just be me. But with this code all I get is an empty chart, so how can I read the Json variable I made and actually use the titles from the RSS as Labels? Hopefully someone here can help. (the plugin for the charts is Chart.js) EDIT My $jsone echo's this: {"@attributes":{"version":"2.0"},"channel":{"title":"CNN.com - Top Stories","link":"http:\/\/edition.cnn.com\/index.html?eref=edition","description":"CNN.com delivers up-to-the-minute news and information on the latest top stories, weather, entertainment, politics and more.","language":"en-US","copyright":"Copyright 2015 Cable News Network LP, LLLP.","pubDate":"Wed, 14 Jan 2015 14:03:23 ES…
answer count: 2
tagged with: php
has title: Reading converted rss to json file with chart.js not working
tagged with: chart.js
score: 0
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27950295
has answer: http://stackoverflow.com/a/27950193

http://stackoverflow.com/comment/44312437
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27958445
has text: If you're writing an application complicated enough to need something like Backbone, you'll usually have put the data in a more complex data structure on the client first.
score: 0

http://stackoverflow.com/q/27867911
has comment: http://stackoverflow.com/comment/44138326
has comment: http://stackoverflow.com/comment/44138445
has comment: http://stackoverflow.com/comment/44138363
has answer: http://stackoverflow.com/a/27868035
has comment: http://stackoverflow.com/comment/44138616
tagged with: dom
possible better answer: http://stackoverflow.com/a/27868606
has answer: http://stackoverflow.com/a/27868606
has comment: http://stackoverflow.com/comment/44138512
has answer: http://stackoverflow.com/a/27868720
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44138606
has title: Last If statement ignored
favorite count: 0
has comment: http://stackoverflow.com/comment/44138678
has body: My last if statement is ignored when executing. When trying to debug I added console.log to the if statement and it functioned as expected. $(document).ready(function() { // set HTML var myVar = 'Null'; if ( document.location.href.indexOf('?1501aa') &gt; -1 ) { myVar = '01'; } if ( document.location.href.indexOf('?1501ab') &gt; -1 ) { myVar = '02'; } if ( document.location.href.indexOf('?1501ac') &gt; -1 ) { myVar = '03'; } if ( document.location.href.indexOf('?1501ad') &gt; -1 ) { myVar = '04'; } if ( document.location.href.indexOf('?1501ae') &gt; -1 ) { myVar = '05'; } if ( document.location.href.indexOf('?1501af') &gt; -1 ) { myVar = '06'; } if ( document.location.href.indexOf('?1501ag') &gt; -1 ) { myVar = '07'; } if ( document.location.href.indexOf('?1501ah') &gt; -1 ) { myVar = '08'; //console.log('myVar set to' + myVar); } if ( document.location.href.indexOf('?1501aj') &gt; -1 ) { myVar = '09'; //console.log('myVar set to' + myVar); } else { setText(); } function setText() { $('&lt;label for="name"&gt;' + myVar + '&lt;/label&gt;').insertBefore($('#name')); } }); The jsFiddle example isn't perfect due to the way they handle URLs. How can I get the last if statement to return true and execute?
has comment: http://stackoverflow.com/comment/44138334
answer count: 5
has answer: http://stackoverflow.com/a/27868204
accepted answer: http://stackoverflow.com/a/27868035
has answer: http://stackoverflow.com/a/27868002
type: AnsweredQuestion
downvote count: 3
score: -3
has comment: http://stackoverflow.com/comment/44138449
has comment: http://stackoverflow.com/comment/44138630
type: Question

html-head
tag name: html-head
type: Tag
tags question: http://stackoverflow.com/q/27841296

http://stackoverflow.com/q/27895805
has title: on value set function in jquery or javaScript?
tagged with: jquery
has comment: http://stackoverflow.com/comment/44192479
has comment: http://stackoverflow.com/comment/44192434
favorite count: 0
has body: I create a sample when you type in input element run a function But I need when it change by another function , run a function ! see it and help me : http://jsfiddle.net/pxfunc/5kpeJ/ $('#modern').bind('input', function() { $(this).next().stop(true, true).fadeIn(0).html( $(this).val()).fadeOut(2000); }); when click on button function not Run !
has comment: http://stackoverflow.com/comment/44192398
has answer: http://stackoverflow.com/a/27896009
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44192417
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27896009
score: 0
has comment: http://stackoverflow.com/comment/44192449
has comment: http://stackoverflow.com/comment/44192516
has comment: http://stackoverflow.com/comment/44192458
answer count: 1

http://stackoverflow.com/comment/44032294
score: 0
type: Comment
has text: Wow, that is amazing thank you so much. I would have never figured that out.
comment on: http://stackoverflow.com/a/27812366
type: AnswerComment

http://stackoverflow.com/a/27852676
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44150045
score: 2
has body: This is very easy to do, just include this wrapper for the XmlHttpRequest at the beginning of your script (it makes it easier to use): var xhrRequest = function (url, type, callback) { var xhr = new XMLHttpRequest(); xhr.onload = function () { callback(this.responseText); }; xhr.open(type, url); xhr.send(); }; And then call it like this: xhrRequest(url, 'GET', function(responseText) { console.log("This is the content you got: " + responseText); }); If you format your content in JSON it will actually make things easier for you because you will not have to parse the file and you can use JavaScript to parse it for you automatically: For example if the reply is: { onlineCount: 42, usernames: [ "Alice", "Bob", "Charlie", "etc" ] } Then you can process it like this: xhrRequest(url, 'GET', function(responseText) { // responseText contains a JSON object var json = JSON.parse(responseText); // Now you can process this as a JavaScript dictionary console.log("Number of online players: " + json.onlineCount); console.log("First player: " + json.usernames[0]); // And send messages to Pebble Pebble.sendAppMessage({ 0: json.onlineCount }); } ); For a complete example and the C side (on Pebble), you should take a loot at Step 3 of the Pebble Tutorial, it does exactly this with weather data.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27840222
answers question: http://stackoverflow.com/q/27840222

http://stackoverflow.com/comment/44297899
type: Comment
comment on: http://stackoverflow.com/a/27951181
type: AnswerComment
has text: Thank you. That was the problem with assignment of the variable link. Now works like a charm
score: 0

http://stackoverflow.com/a/27848927
answers question: http://stackoverflow.com/q/27848540
has body: Try a simpler $(function() { $("table [type='checkbox']").on("change", function() { console.log($(this).parent().prev().html()); }); }); jQuery selector meaning : "anything in the table having type=checkbox"
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44102208
type: Answer

http://stackoverflow.com/q/27805861
accepted answer: http://stackoverflow.com/a/27806220
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44020868
type: AnsweredQuestion
upvote count: 5
has title: Is it possible for an input element to have a cursor without focus?
has comment: http://stackoverflow.com/comment/44020900
type: Question
has body: Okay so this is a unique scenario. This is a web app that is not accessed anywhere but on a set top box. The peripheral for this application is a TV remote control. i.e: NO keyboard, NO mouse. Of course normally, when an input element is focused, a cursor appears and blinks at the current position. You type characters, they show up, and the cursor automagically advances. whoohoo! But what we need to do is replicate that behavior when the input element is not focused. This behavior is seen mostly in video games and other TV/large screen interfaces. You have an onscreen keyboard and you choose characters by navigating to a letter or number and hitting enter/select or whatever button is "select" for that platform (like maybe the 'X' button on a Playstation). The letter shows up in the input field, the cursor advances, but the actual element with focus is the current key on the onscreen keyboard. We tried making the keyboard using &lt;div&gt; tags, but then we lose the behavior of the very convenient placeholder attr, and it is just a mess of logic recreating what a cursor and placeholder should do. I would love for the cursor to ALWAYS be on an input element, just after the last character, and NOT present when the input has no value, showing only placeholder="Search". Almost sounds like I need to be able to have two elements on a page with focus, which is not possible as far as I know. But is it possible to have an input element not focused and still see a cursor? Or are we stuck using other tags and recreating that behavior from scratch? Scouring the internet, I have found no solution. jQuery solutions are acceptable.
score: 5
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44020674
has answer: http://stackoverflow.com/a/27806220
favorite count: 0
tagged with: television
has comment: http://stackoverflow.com/comment/44036321

http://stackoverflow.com/q/27827216
has answer: http://stackoverflow.com/a/27827316
type: Question
has comment: http://stackoverflow.com/comment/44060451
upvote count: 1
tagged with: function
has answer: http://stackoverflow.com/a/27830074
tagged with: javascript
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/27827520
tagged with: simplify
has answer: http://stackoverflow.com/a/27827541
downvote count: 0
has answer: http://stackoverflow.com/a/27827637
has comment: http://stackoverflow.com/comment/44060533
has comment: http://stackoverflow.com/comment/44060357
type: AnsweredQuestion
has body: Here's a bit of code which works fine but I think could be simplified / shortened. It's basically clicking on a list item, getting it's id and then showing / hiding / removing elements based on the id. Suggestions on how to simplify this with a function or loop? $("#btn_remove_event_type").click(function() { var selectedId = $(".selected-type").attr("id"); if (selectedId == "temperature_event") { $("#poplist_temp").show(); $(".temperature-params").hide(); $("#temperature_event").remove(); } else if (selectedId == "load_event") { $("#poplist_load").show(); $(".load-params").hide(); $("#load_event").remove(); } else if (selectedId == "price_event") { $("#poplist_price").show(); $(".price-params").hide(); $("#price_event").remove(); } else if (selectedId == "duty_event") { $("#poplist_duty").show(); $(".duty-params").hide(); $("#duty_event").remove(); } else { $("#poplist_program").show(); $(".program-params").hide(); $("#program_event").remove(); } });
score: 1
has comment: http://stackoverflow.com/comment/44062176
accepted answer: http://stackoverflow.com/a/27830074
has comment: http://stackoverflow.com/comment/44060299
has title: Simplify / elegantize this code?
possible better answer: http://stackoverflow.com/a/27827316

http://stackoverflow.com/a/27877505
answers question: http://stackoverflow.com/q/27876541
accepted answer of: http://stackoverflow.com/q/27876541
score: 0
type: AcceptedAnswer
type: Answer
has body: Either do a module.exports = class Template in your template.coffee and instantiate it using Template = require "./template" AppTemplate = new Template() or instantiate the class on export like this module.exports = new class PluginManager

http://stackoverflow.com/comment/44253711
score: 0
type: AnswerComment
type: Comment
has text: savard honstly i'm not using the captcha thing , i'm programming a javascript code that fill a form automatically and i'm encoutered the same captcha type that i demonestrated in the website link , but for a deffirent website . so i don't know what i'm dealing with .
comment on: http://stackoverflow.com/a/27928253

http://stackoverflow.com/comment/44208930
score: 0
type: AnswerComment
type: Comment
has text: Ah. ok so it is much more complicated than what is in the example. Can you adjust your question? I'll try and work out my answer.
comment on: http://stackoverflow.com/a/27904791

http://stackoverflow.com/comment/44317423
type: QuestionComment
comment on: http://stackoverflow.com/q/27961881
has text: that's very weird. does this link work for you? http://jsfiddle.net/ez8ya0ov/1/#&togetherjs=dA4TM1PnGO
score: 0
type: Comment

http://stackoverflow.com/q/27873075
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44177124
has body: I have a pentagon graph made up with SVG coding. So I made the pentagon with codes like so: &lt;svg&gt;&lt;path cs="100,100" d="M0.5,-62.5 L60.5,-18.5 L37.5,51.5 L-36.5,51.5 L-59.5,-18.5 L0.5,-62.5 M0,0 L0,0"&gt;&lt;/svg&gt; Right now, on a graph perspective, the pentagon is showing values of 30 for each side. I am trying to find a way to change the values without always having to go inside PATH CS to change the degree values. Anyone have an idea, I have been looking it up and found that connecting it with a javascript would be the best case but I have no idea how to write the proper javascript. Could anyone help?
score: 1
has title: Values of a graph
type: Question
tagged with: graph
upvote count: 1
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27887776
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0

http://stackoverflow.com/comment/44329020
has text: Code? Sample? A sniff of a prototype? Anything? :)
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27961312

http://stackoverflow.com/q/27843047
upvote count: 7
tagged with: angularjs-directive
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27852203
accepted answer: http://stackoverflow.com/a/27852203
score: 7
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/44352343
type: Question
has comment: http://stackoverflow.com/comment/44090386
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: Struggling to find out the best way to watch for attribute changes, which would ideally update based on a keypress event, bound to the scope in the parent controller I would like each 'instance' of the directive to have its own 'hasFocus' property to be changed by updating the attribute value e.g. template: {{ $index+1 }} and so only 1 directive can have the value equal to 'true' at any one time. I have a custom directive .directive('menu', function() { restrict : 'E', templateUrl : 'partials/menu-left.html', replace : true, scope : { hasFocus : '@' }, link : function( $scope, element, attrs ) { attrs.$observe('hasFocus', function(value) { console.log(value); }); } }) but cant seem to extract the value from the $observe method tried using $watch but still didnt work not sure what I am doing wrong!
tagged with: angularjs
has title: Angular Custom directive change attribute value

http://stackoverflow.com/q/27912207
has comment: http://stackoverflow.com/comment/44224018
has answer: http://stackoverflow.com/a/27912593
type: Question
has title: send textbox variables via php form
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44224092
tagged with: php
has comment: http://stackoverflow.com/comment/44224019
has body: I have created a form using Ninja Forms on my WordPress website. I have one long form, which I've divided into tabs. When the user clicks the first button to continue, I want to send an email with specific fields. The issue is that my variables don't show up in my email. I'm receiving blank emails. I've tried a number of things including ajax and a separate sendme.php. Since I'm using Wordpress, I decided to use the wp_mail function. Here's my code. The variables work in my jquery alerts, but still aren't passed to my email. I included this in my header. $("#cont-btn").on('click', function (e) { e.preventDefault(); var name = $("#ninja_forms_field_30").val(); var company = $("#ninja_forms_field_76").val(); var title = $("#ninja_forms_field_75").val(); var email = $("#ninja_forms_field_33").val(); var phone = $("#ninja_forms_field_32").val(); $.ajax({ type: "POST", url: "sendme.php", data:{ name: name, company: company, title: title, email: email, phone: phone }, success: function(data){ console.log(data); } }) }); And this is the basis of my sendme.php &lt;?php $name = $_POST['name']; $email = $_POST['email']; $company = $_POST['company']; $phone = $_POST['phone']; $to = 'me@email.co'; $subject = 'Enterprise Quote (PT1)'; $message = 'Email: ' .$company ; $headers = ''; mail($to, $subject, $message) or die('Error sending Mail'); //This method sends the mail. ?&gt; A few things: I don't want to validate the form. I don't want to submit the form. I want the user to stay on page. Any help would be greatly appreciated. Thanks.
tagged with: wordpress
tagged with: forms
has comment: http://stackoverflow.com/comment/44224078

http://stackoverflow.com/comment/44360755
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27964080
type: Comment
has text: Indeed an interesting article, I'll have a look at it!

http://stackoverflow.com/comment/44148764
comment on: http://stackoverflow.com/a/27870691
type: Comment
has text: oh thanks for replying, i thought callbackfunction was a function of localforage, thanks for that now. oh i will fix the milk ling, originally it was milk = milk =+ milkRate howver i removed it for testing and dammit lol and lastly no that line is not repeated, first it checks if there is a value then it sets it to 0 if it does not exist. thanks again hopefully this will fix it.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28019467
has comment: http://stackoverflow.com/comment/44425595
has comment: http://stackoverflow.com/comment/44425572
has comment: http://stackoverflow.com/comment/44425641
has body: Think this answer seems to be similar to your question.Hope it provides some insight. Time Binding issue in Bootstrap timepicker
type: Answer
has comment: http://stackoverflow.com/comment/44425826
has comment: http://stackoverflow.com/comment/44426002
has comment: http://stackoverflow.com/comment/44425765
has comment: http://stackoverflow.com/comment/44425623
answers question: http://stackoverflow.com/q/27956284
has comment: http://stackoverflow.com/comment/44425697
score: 0
has comment: http://stackoverflow.com/comment/44425882

http://stackoverflow.com/comment/44140740
has text: works perfectly. I'm still uncertain about the differences between a promise and a ?callback?/async function?
comment on: http://stackoverflow.com/q/27868876
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44190726
comment on: http://stackoverflow.com/q/27894763
has text: this can't be done, because in order to tell if they were refreshing, going back, or going somewhere else, you would need to know the url they were attempting to go to, and this is impossible http://stackoverflow.com/questions/1686687/how-can-i-get-the-destination-url-in-javascript-onbeforeunload-event
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44087199
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27816099
has text: can you understand my question?

http://stackoverflow.com/comment/44198480
type: Comment
score: 0
type: QuestionComment
has text: [See here](http://jsfiddle.net/MiguelR/Bybd5/)
comment on: http://stackoverflow.com/q/27899025

http://stackoverflow.com/comment/44109865
type: Comment
comment on: http://stackoverflow.com/a/27852817
has text: Maybe you are sending the parameters in a wrong way. Are you sure this line `url: "/TrackNYP/TrackNYPServlet?action=GetAllMrtPop&time="+ Data + ""` is correct? How would you normally call this URL outside jQuery?
type: AnswerComment
score: 0

http://stackoverflow.com/q/27939497
tagged with: angularjs-scope
answer count: 2
downvote count: 0
favorite count: 0
has body: I am trying to move one view to another in angular .Actually I am able to show first view .And in that view there is button .On click of button I am trying to go to next page But I am getting error on button click why ? here is my plunker http://plnkr.co/edit/2cMimMX6xS0rTB7lJOQx?p=preview (function() { 'use strict'; angular .module('firstApp') .controller('firstcont', firstcont); firstcont.$inject = ['$scope',"$state"]; function firstcont($scope,$state) { $scope.clickEvent=function(){ $state.go('/second') } } })();
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27939589
score: 1
upvote count: 1
has title: how to move one view to another in angular having different route file?
type: Question
tagged with: angularjs-directive
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/44275379
has answer: http://stackoverflow.com/a/27939671
tagged with: javascript

http://stackoverflow.com/comment/44352065
score: 0
type: Comment
has text: Please, as I told you in my last comment, I found other issue and I'd like to solve it without asking a new question (as you can see I only work in this project on fridays)
type: AnswerComment
comment on: http://stackoverflow.com/a/27866712

http://stackoverflow.com/q/27922408
has comment: http://stackoverflow.com/comment/44241746
type: Question
type: AnsweredQuestion
has body: i am making an app where i need 3d joystick image so that user can swipe on it and image will bend in swipped direction. For swipe down or for swipe up events what css or animation effect i should give to make image moving downside or upside ?? I don't know the best way to do it. I am trying this code :- &lt;div style="width:220px;height:220px;background-color:black;display:table-cell; vertical-align:middle; text-align:center" id="joy_div"&gt; &lt;img id="joystick" src="joystick.png" &gt; &lt;/div&gt; &lt;script&gt; $("#joy_div").rotate({ bind: { swipeleft : function() { $("#joystick").rotate({animateTo:-50}); }, swiperight : function() { $("#joystick").rotate({animateTo:50}); }, swipeup : function(){ alert('up'); }, swipedown : function(){ alert('down'); }, swipeend : function(){ $("#joystick").rotate({animateTo:0}); } }); &lt;/script&gt; I appreciate any guidance.
has answer: http://stackoverflow.com/a/27922884
possible better answer: http://stackoverflow.com/a/27923206
has answer: http://stackoverflow.com/a/27923206
answer count: 2
has title: JQuery: How to make 3D Joystick image with bending effects?
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27922884
tagged with: css
has comment: http://stackoverflow.com/comment/44241849
score: 0

http://stackoverflow.com/a/27817104
has body: You will need to export the test function in order to use it in main.js var test = function(){ console.log("log from included file"); }; module.exports = test And in main.js add require as follows require('./include.js'); // assuming include.js is in same directory as main.js If you do require('include.js') then node will search include in global packages
has comment: http://stackoverflow.com/comment/44040402
has comment: http://stackoverflow.com/comment/44040293
type: Answer
answers question: http://stackoverflow.com/q/27817077
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/27952027
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44320298
accepted answer of: http://stackoverflow.com/q/27947225
type: Answer
has body: I think I understand what you are asking. With d3, you don't explicitly loop your data. You bind your array and it draws based on the contents of the array. In your case, you would bind your array: .selectAll('path').data(pie(jsondata.uploads)) // Selecteerd onderstaand path, gebruikt pie layout en de data And then give it a value function to return the piece you want to plot: var pie = d3.layout.pie() .padAngle(.02) // Ruimte tussen de arcs .value(function(d) { // Vormt de data om naar de layout van de pie chart return d.count_download; }); In the value function d is each item in your jsondata.uploads array. EDITS To access your value on click, it's something like: ... .enter().append('path') .attr('fill', function(d, i) { return colors(i); // Voeg de kleuren (category20c) toe bij alle data: index }) .each(function(d) { d.outerRadius = outerRadius - 20; }) .attr('d', arc) .on("click", function(d,i){ alert(d.data.count_download); }); Note, untested code.
answers question: http://stackoverflow.com/q/27947225
score: 1

http://stackoverflow.com/comment/44255886
comment on: http://stackoverflow.com/q/27928916
type: Comment
type: QuestionComment
has text: there are no such thing as private properties in JS. ok, well there is a really ugly way to enforce private properties using non-strict methods (via arguments.callee.caller), but i doubt that's what you want.
score: 0

http://stackoverflow.com/q/27805392
upvote count: 1
type: AnsweredQuestion
score: 1
has title: MongoDB map reduce find anagrams
tagged with: mapreduce
type: Question
tagged with: mongodb
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27810063
answer count: 1
favorite count: 0
has body: I have problems with mongodb. I have to write some js code to find anagrams in my collection lista. The collection structure is as follows: {_id : value, Import: anagram } The code below acrually does its work - it finds anagrams but I have to do it using map reduce manner. I have tried many times to rewrite this code as map reduce but I didn't manage. I know the concept, I tried doing it like so : db.lista.mapReduce( mapper, reducer, { out : "result" } ); but no result. How the code should be splitted? How to do that? How to save output to a database? Any help would be gratly appreciated. var input = db.lista.find().sort( { Import: 1} ); var anagrams = {}; input.forEach(function(word) { var alphabetical = word.Import.split("").sort().join(""); var oryginal = word.Import; var sorted = alphabetical; if (anagrams[sorted] != null) { anagrams[sorted].push(word); } else { anagrams[sorted] = [ word ]; } }); for (var sorted in anagrams) { var words = anagrams[sorted]; var sep = ","; var out = ""; for (var n in words) { out += sep + words[n]; sep = ""; } print(sorted + ": " + out); }
has answer: http://stackoverflow.com/a/27810063

http://stackoverflow.com/q/27851832
tagged with: javascript
linked to: http://stackoverflow.com/q/23886140
has answer: http://stackoverflow.com/a/27852057
favorite count: 0
has body: I have an ISO 8601 formatted duration, for eg: PT5M or PT120S. Is there any way I can parse these using moment.js and fetch the number of minutes specified in the duration? Thank you! PS: I looked at Parse ISO 8601 durations and Convert ISO 8601 time format into normal time duration but was keen to know if this was do-able with moment.
accepted answer: http://stackoverflow.com/a/31236819
has answer: http://stackoverflow.com/a/69941322
has title: How do I parse an ISO 8601 formatted duration using moment.js?
tagged with: momentjs
has comment: http://stackoverflow.com/comment/44107789
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31236819
score: 36
answer count: 3
linked to: http://stackoverflow.com/q/19093071
upvote count: 36
possible better answer: http://stackoverflow.com/a/27852057
downvote count: 0

http://stackoverflow.com/comment/44176290
type: AnswerComment
comment on: http://stackoverflow.com/a/27887564
has text: I got a new problem. how do I access the controller function in javascript?
type: Comment
score: 0

http://stackoverflow.com/q/27905513
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44210486
has answer: http://stackoverflow.com/a/27905688
has title: Angular JS Refresh Specific ID when button click
has body: Im new to AngularJS and im developing mobile web app. I have few id divs for different views.(thats how AngularJS works right? one HTML page) and i want to use different javascript for specific id Pages. because each ID page should retrieve json Data objects from internet and show in that specific IDs. im using Chart.js Charts to show data. Problem is for the first time javascript works and charts will be show. but not the second time. Ex: Menu Bar --> Home page ID | 2nd Page ID | 3rd Page ID When i go to another page using menu. and again click Home button Data not visible. I have simple test javascript to load. I tried putting onClick="javascript:refreshID();"to refresh it. didnt work HTML <ons-list class="menu-list"> Home Welcome to AquaLife //Chart //Chart
has comment: http://stackoverflow.com/comment/44210398
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27905590
tagged with: onsen-ui
score: 0

http://stackoverflow.com/q/27888719
type: Question
answer count: 2
tagged with: javascript
has body: I have the following response from an AJAX request (as per Chrome console): `XMLHttpRequest { statusText: "Not Found", status: 404, responseURL: "XXX", response: "{"apiVersion":"2.1","error":{"code":404,"message":…dException","internalReason":"User not found"}]}}", responseType: ""…`} How can I select both the value of statusText and the internalReason? When I try to set var msg = response.data.statusText; I get Uncaught TypeError: Cannot read property 'statusText' of undefined Edit: Here's the code in context: $.ajax({ type: "GET", url: yt_url, dataType:"json", success: function(response) { // code } error: function(response) { handleError(response); } }); function handleError(response) { var msg = response.data.statusText; $('#status').html('An error occurred:' + msg); }
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27888731
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/27888731
possible better answer: http://stackoverflow.com/a/27888935
has comment: http://stackoverflow.com/comment/44178674
has title: How to select a variable from an AJAX response
has answer: http://stackoverflow.com/a/27888935
type: AnsweredQuestion

http://stackoverflow.com/comment/104732979
has text: Huh. Either i missed it or the code did not appear in the reviewer interface when I reviewed it. I agree this is a quality answer. It would appear other reviewers overrode my initial assessment so i think you're ok. Sorry for the inspiration flag.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/59239119

http://stackoverflow.com/q/27856565
has title: Scale an image instead of wrapping text around it when the browser window is resized
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27857706
tagged with: scaling
type: Question
has answer: http://stackoverflow.com/a/27858110
possible better answer: http://stackoverflow.com/a/27857706
has comment: http://stackoverflow.com/comment/44116587
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27857629
tagged with: image
has comment: http://stackoverflow.com/comment/44117068
score: 0
answer count: 3
has body: I have an image positioned next to a div with some text by using display: inline on the div. When the browser window is resized to be more narrow, I would like the image to scale down instead of having the text wrap around it first. Currently, the text will wrap under the image when the window is resized, and only then will the image scale thanks to its max-width. The end goal is to have a horizontal logo next to a horizontal menu, and have the logo scale on window resize while the menu stays in place. Would be great if this could be done with just CSS, but I'll take Javascript if that's not possible. Some Random Text Fiddle: http://jsfiddle.net/uLc8dcsh/1/
has answer: http://stackoverflow.com/a/27857629
has comment: http://stackoverflow.com/comment/44116433
has comment: http://stackoverflow.com/comment/44117770

http://stackoverflow.com/a/27911810
upvote count: 2
has body: setInterval is not the right method, you must use setTimeout, otherwise the functions will run endless(until the browser will crash) you must increment the delay for setTimeout, otherwise you will not see an animation(all functions will be executed with a delay, but at the same time...after 1 second) don't create a new Polyline on each function call, you'll have a lot of Polylines at the end(1 for each item) . Create a single Polyline and push the locations to the path of the Polyline $scope.autoRefresh = function() { try { var route = new google.maps.Polyline({ path: [], strokeColor: '#FF0000', strokeOpacity: 2.0, strokeWeight: 3, editable: false, map:map }), index=0, marker=new google.maps.Marker({map:map,icon:icon}); if (!_.isEmpty(items)) { angular.forEach(items, function(cordinates) { setTimeout(function () { route.getPath().push(new google.maps.LatLng(cordinates.lat, cordinates.lng)); route.setMap(map); moveMarker(map, marker, cordinates.lat, cordinates.lng); markLAT = cordinates.lat; markLNG = cordinates.lng; }, 200*++index); }); } // } catch (e) { console.log(e); } }; Plunker
accepted answer of: http://stackoverflow.com/q/27905256
has comment: http://stackoverflow.com/comment/44317273
answers question: http://stackoverflow.com/q/27905256
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44318670
has comment: http://stackoverflow.com/comment/44316889

http://stackoverflow.com/a/50228121
upvote count: 7
has body: A simple solution with ES5 (overwrite existing value): function merge(current, update) { Object.keys(update).forEach(function(key) { // if update[key] exist, and it's not a string or array, // we go in one level deeper if (current.hasOwnProperty(key) &amp;&amp; typeof current[key] === 'object' &amp;&amp; !(current[key] instanceof Array)) { merge(current[key], update[key]); // if update[key] doesn't exist in current, or it's a string // or array, then assign/overwrite current[key] to update[key] } else { current[key] = update[key]; } }); return current; } var x = { a: { a: 1 } } var y = { a: { b: 1 } } console.log(merge(x, y));
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/90813858
score: 7
answers question: http://stackoverflow.com/q/27936772

http://stackoverflow.com/q/27955925
tagged with: template-engine
favorite count: 0
has body: I need symbols that considered valid object in Javascript (to replace &lt;%=, &lt;%! and %&gt;, so it won't considered an error by my IDE (WebStorm, SublimeText3, Brackets.io, Atom.io), so that the autocomplete would work correctly. note: after finding the best symbol, I will modify the template engine's parser source code. _year would be a string or number, and CC, CA, FS, FC will be an object units_json would be a key-value properties, something like: rows:{1:[cell,cell,cell],2:[cell,cell,cell]},cols:[id,name,note], more than symbols one would be ok. EDIT 1: I guess the number or string template, just need to be quoted, for example: '&lt;%= _year %&gt;' or +'&lt;%= _year %&gt;' if a number EDIT 2: the object template, could be set as {_:'%! and %'}, for example: {_:'%! cc_options %'} or another workaround would be JSON.parse('&lt;%= cc_options %&gt;') but probably slower. EDIT 3: the key-value properties, could be set as /*%! and %*/, for example: /*%! units_json %*/ thanks to damon-smith's answer EDIT 4: it's done..
type: AnsweredQuestion
score: 1
type: Question
has title: Symbols that syntatically correct in Javascript for template engine language design
has comment: http://stackoverflow.com/comment/44306718
tagged with: javascript
has comment: http://stackoverflow.com/comment/44309228
has answer: http://stackoverflow.com/a/27956011
accepted answer: http://stackoverflow.com/a/27956011
has comment: http://stackoverflow.com/comment/44306704
upvote count: 1
downvote count: 0
answer count: 1

http://stackoverflow.com/q/27864197
accepted answer: http://stackoverflow.com/a/27864941
has title: ReactJS - multiline textarea
tagged with: reactjs
answer count: 2
downvote count: 0
tagged with: javascript
has body: I'm trying to create multi-line text input field with ReactJS. I've created this component: var TextInput = React.createClass({ getInitialState: function(){ return {currentValue: this.props.children} }, handleChange: function(event){ //handler }, render: function(){ return ( &lt;textarea name="body" onChange={this.handleChange} value={this.state.currentValue}/&gt; ) } }); I'm rendering it this way: # jinja2 template React.render( &lt;TextInput&gt;{{ post.body }}&lt;/TextInput&gt;, document.getElementById('post-editing') ); The problem: If {{ post.body }} is something like #Title \n text, the textarea show it in one line. I am seeing #Title text in my textarea without line breaks. What is the right way to set &lt;textarea&gt; value with ReactJS?
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27869595
upvote count: 16
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27869595
score: 16
tagged with: jinja2
has answer: http://stackoverflow.com/a/27864941
type: Question

http://stackoverflow.com/comment/44230870
has text: Please show complete code needed to replicate your problem. We have no idea what your css looks like
type: QuestionComment
comment on: http://stackoverflow.com/q/27916113
score: 0
type: Comment

http://stackoverflow.com/q/27886204
accepted answer: http://stackoverflow.com/a/27886216
has body: I Create this code for replace something and show a button : var text = $(item).html().replace(exp, " Click "); But in page I get this and I cant show alert on any function : Click
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
has title: how I can generate Properly html tag with javaScript?
has comment: http://stackoverflow.com/comment/44174082
favorite count: 0
has answer: http://stackoverflow.com/a/27886216
has comment: http://stackoverflow.com/comment/44174149
possible better answer: http://stackoverflow.com/a/27886230
has answer: http://stackoverflow.com/a/27886230
downvote count: 1
type: AnsweredQuestion
score: -1

http://stackoverflow.com/comment/44228690
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [jQuery multiple events to trigger the same function](http://stackoverflow.com/questions/2534089/jquery-multiple-events-to-trigger-the-same-function)
comment on: http://stackoverflow.com/q/27914719

http://stackoverflow.com/q/27844884
has title: D3 events firing on a hidden svg element
score: 7
has answer: http://stackoverflow.com/a/27845266
tagged with: vaadin
has answer: http://stackoverflow.com/a/27850639
type: Question
answer count: 2
tagged with: firefox
tagged with: javascript
has body: I can't seem to find an answer for this and it took me a while to recreate it as a stand alone fiddle/pen but I finally have. I am working on Vaadin application which uses D3 to draw and manipulate svg graphics. At a point there are svg's on screen which have visibility:hidden. This works perfectly find in all browsers. These hidden element have click and mouseover events, which again work find in all browsers However in firefox version 34 the hidden element still fire their events (click and mouseover) when they are still hidden. To explain better: when a button is hidden, its mouseover event shouldn't fire, when its visible it should. That is how it works in ALL browsers except for firefox 34, 35 beta and 36 dev edition. It works fine in firefox 31. I am suspecting this is a bug in D3, but wanted a second opinion or for someone to point out my error. Its worth noting that setting display:none on the element works in firefox 34 and up, however I don't feel that the problem lies there I have created a jsbin demonstrating the code, there are two orange icons, one has visibility:hidden (you might need to disable to see it) if you mouse over the hidden element with chrome nothing happens. but with firefox 34 the events fire. Here's the jsBin Any idea's why it would fire? I am guessing either D3 issue or firefox bug, however I'd like to nail it down to either fix my code on contribute to a fix in the other areas Thanks
upvote count: 7
has comment: http://stackoverflow.com/comment/44097923
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0
tagged with: d3.js
has comment: http://stackoverflow.com/comment/44094044
possible better answer: http://stackoverflow.com/a/27845266
accepted answer: http://stackoverflow.com/a/27850639
type: AnsweredQuestion

http://stackoverflow.com/a/27937981
has comment: http://stackoverflow.com/comment/44275560
has comment: http://stackoverflow.com/comment/44272580
score: 0
has comment: http://stackoverflow.com/comment/44348334
has body: You don't need to stringify user object before you push it to array. Users array is an array of objects, not strings. Otherwise you will get a string back for user after JSON.parse(localStorage.getItem("user")) not object as expected. It should be just: user = { email : $("#email").val(), timestamp : $("#time").val(), };
has comment: http://stackoverflow.com/comment/44347025
type: Answer
answers question: http://stackoverflow.com/q/27937898

http://stackoverflow.com/comment/44099802
comment on: http://stackoverflow.com/a/27847787
type: Comment
score: 0
has text: I've decied to mark it as accepted answer before really testing in my project because it doesn't look that obvious and I didn't see it elsewhere : thank you. Just to be absolutely certain : if I put this code in a JS which is added to every page (just like those JS files which want to change title) the title should stay the same and untouchable?
type: AnswerComment

http://stackoverflow.com/comment/44180316
has text: I don't see where you are trying to hit the URL: `/foo1`. Mockjax only mocks requests that it matches to a URL (and other ajax settings).
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27884427

http://stackoverflow.com/a/27960792
accepted answer of: http://stackoverflow.com/q/27948912
answers question: http://stackoverflow.com/q/27948912
has comment: http://stackoverflow.com/comment/44422654
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/78587724
has body: Several notes: Always make sure your console is clean. If there's stuff there, it probably means you did something wrong. But not to worry, it also gives you great pointers on how to resolve it. On your pen, when you look in the console, you find out quickly that there's a problem in line 9, where you call "setIndicators". This is due to the fact, that you forgot to include the ScrollMagic debugging extension. Then there's another problem in line 27, where it states, that scene is undefined. The variable isn't set and I'm assuming is a C&amp;P error, when copying from one of the ScrollMagic examples. After resolving these two issues, we can actually see the indicators, except for the starting one, because it's green on green. Luckily we can change the color. Once these issues are resolved we are set to start working on the actual problem. Now that we see the scene indicators it should become fairly obvious what's happening. The scene's triggerHook is set to "onEnter" with globalSceneOptions and is accordingly positioned at the bottom of the viewport. The triggerElement of the scene is set to "#parallax1", which is the main section, which makes its position the top of the page. So right from the start the trigger is already past the start position of the scene. And because the duration of the scene is 2 times the window height, this situation (trigger at the bottom, start at the top) results in the scene being exactly at 50% played on load. Resolving this is as easy as changing the triggerHook for the scene in question. By setting it to "onLeave" (or 0) the scene's triggerHook moves to the top. Keep in mind that this needs to be done AFTER adding the scene to the controller, because it would be overwritten otherwise, as stated in the docs. This will leave us at this resolved version: http://codepen.io/janpaepke/pen/WbpMOO I would recommend to you having a look at the ScrollMagic scene manipulation example to get a better idea of what scene parameters will result in w…
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44132413
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27864893
type: Comment
has text: Do you have an example please? I have not heard of that method before.

http://stackoverflow.com/comment/63297377
score: 3
comment on: http://stackoverflow.com/a/37164538
type: AnswerComment
has text: Its a computed property name, the first will use the value of `key` as the property name, the later will make "key" the property name. See: http://es6-features.org/#ComputedPropertyNames
type: Comment

http://stackoverflow.com/comment/44104607
has text: look into `delegate()` http://stackoverflow.com/questions/4579117/jquery-live-vs-delegate
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27850253
score: 0

http://stackoverflow.com/comment/44204708
type: Comment
score: 1
has text: `document.childNodes` seems to be faster than `document.querySelectorAll(*);` http://jsperf.com/childnodes-vs-queryselectorall
type: AnswerComment
comment on: http://stackoverflow.com/a/27902532

http://stackoverflow.com/comment/44186927
has text: @KSFT Nodes that neighbor nodes on random path cannot share same color. But for sake of simplicity, we can say that nodes neighboring each other cannot share the same color.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27892760

http://stackoverflow.com/a/27848154
has comment: http://stackoverflow.com/comment/44100386
has comment: http://stackoverflow.com/comment/44100568
has comment: http://stackoverflow.com/comment/44100553
has comment: http://stackoverflow.com/comment/44100022
has body: if (document.getElementById(rowArray[i]).innerHTML !== "") { document.getElementById(rowArray[i]).style.display = 'table row'; } try changing the above code to (take out 'table row'): if (document.getElementById(rowArray[i]).innerHTML !== "") { document.getElementById(rowArray[i]).style.display = ''; } i dont know if this will work, but its easier to post code in code format in the answer box then make a comment for it.
has comment: http://stackoverflow.com/comment/44100705
has comment: http://stackoverflow.com/comment/44100114
has comment: http://stackoverflow.com/comment/44100411
has comment: http://stackoverflow.com/comment/44100770
score: 0
has comment: http://stackoverflow.com/comment/44100475
has comment: http://stackoverflow.com/comment/44100189
has comment: http://stackoverflow.com/comment/44100934
answers question: http://stackoverflow.com/q/27847965
type: Answer

http://stackoverflow.com/q/27945596
has title: Event handling in dynamically generated page
type: Question
has body: I have a div with class called 'taglines' which is contained in a div with class called 'container'. When 'taglines' is clicked, it navigates to another page. The problem is the events on this new page are not responding after navigation. The following is the code that I am using to navigate: $(document).ready(function(){ $('.container').on('click', '.tagLines', function(){ window.location = "manageMarks.php"; }); } The following is the code with the event that is refusing to work after navigation: $(document).ready(function(){ $('.container').on('click', '.loadSub', function(){ alert('Clicked'); }); }); However, If i use ajax to load the new view I want, the events do eventually work. The following is the ajax I code I am using: $(document).ready(function(){ $('.container').on('mouseover', '.tagLines', function(){ $.ajax({ type: 'GET', url: 'manageMarks.php', data: { videoCode: $(this).attr('data-code') }, success: function(data){ //alert(data); $('.container').html(data); } }).error(function(){ alert('An Error Has Occured'); }); }); How can I get it to work without using ajax?
tagged with: javascript
has comment: http://stackoverflow.com/comment/127646350
tagged with: jquery
score: 0
tagged with: jquery-events
has answer: http://stackoverflow.com/a/27945661
answer count: 1
tagged with: events
tagged with: ajax
has comment: http://stackoverflow.com/comment/44286464
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44286413

http://stackoverflow.com/q/27892041
has answer: http://stackoverflow.com/a/27892072
accepted answer: http://stackoverflow.com/a/27892072
type: AnsweredQuestion
has title: Unable to getElementById on one specific site
tagged with: google-chrome-devtools
score: -1
type: Question
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/5040901
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
upvote count: 0
has body: Working on creating an auto-login app, but I'm running into a problem on the following site: https://www.navient.com/loan-customers/ Site Element &lt;input type="text" id="lblUserId" value .../&gt; Console Code document.getElementById('lblUserId').value = 'testUserName'; Error Message Any ideas why this isn't working? I've tried it on several other sites and it works perfectly. Thanks ya'll!

http://stackoverflow.com/comment/44125944
comment on: http://stackoverflow.com/a/27861788
score: 0
type: Comment
type: AnswerComment
has text: Very good @avinash Raj. Indra Use above regex code as : preg_match('/\b\d+(?:\.\d+)*\b/',$sourcestring,$matches); $matches[0] is your answer.

http://stackoverflow.com/comment/44034436
type: Comment
score: 1
has text: You're wrong. If `Number = '2'` Then value of `n` will be `2`. Even when Number is string, it can be converted to Number type by `+`.
type: AnswerComment
comment on: http://stackoverflow.com/a/27813730

http://stackoverflow.com/comment/44103105
comment on: http://stackoverflow.com/q/27849446
score: 0
type: Comment
type: QuestionComment
has text: And don't be afraid to use `var picts = ["./pix/mtn01.jpg","./pix/mtn02.jpg","./pix/mtn03.jpg"]`;

http://stackoverflow.com/q/27849465
has body: I am trying to call an existent function from a remote site in a WKWebview: function addtext (text) { jQuery("#webviewtest").html(text); } With: [self.WebView evaluateJavaScript:@"addtext(\"This is a text from app\");" completionHandler:^(id Result, NSError * error) { NSLog(@"Error -&gt; %@", error); }]; But this is throwing an error: Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo=0x170c788c0 {NSLocalizedDescription=A JavaScript exception occurred} This is so simple! I am must missing something really stupid!
tagged with: ios
possible better answer: http://stackoverflow.com/a/41400730
tagged with: javascript
tagged with: wkwebview
has comment: http://stackoverflow.com/comment/44126474
tagged with: objective-c
upvote count: 17
favorite count: 0
downvote count: 0
has answer: http://stackoverflow.com/a/27852788
accepted answer: http://stackoverflow.com/a/27852788
has comment: http://stackoverflow.com/comment/44102960
has comment: http://stackoverflow.com/comment/44102893
has title: WKWebview evaluateJavascript is not working, throws an error
type: AnsweredQuestion
score: 17
has answer: http://stackoverflow.com/a/41400730
type: Question
tagged with: wkwebviewconfiguration
has comment: http://stackoverflow.com/comment/44104302
answer count: 2

http://stackoverflow.com/comment/44174900
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27885573
has text: Not really. Post your arrays up and what you're trying

http://stackoverflow.com/a/37164538
type: Answer
upvote count: 114
has comment: http://stackoverflow.com/comment/69874131
has body: Here is an immutable (does not modify the inputs) version of @Salakar's answer. Useful if you're doing functional programming type stuff. export function isObject(item) { return (item &amp;&amp; typeof item === 'object' &amp;&amp; !Array.isArray(item)); } export default function mergeDeep(target, source) { let output = Object.assign({}, target); if (isObject(target) &amp;&amp; isObject(source)) { Object.keys(source).forEach(key =&gt; { if (isObject(source[key])) { if (!(key in target)) Object.assign(output, { [key]: source[key] }); else output[key] = mergeDeep(target[key], source[key]); } else { Object.assign(output, { [key]: source[key] }); } }); } return output; }
has comment: http://stackoverflow.com/comment/67039372
has comment: http://stackoverflow.com/comment/75092333
has comment: http://stackoverflow.com/comment/63177658
answers question: http://stackoverflow.com/q/27936772
downvote count: 3
has comment: http://stackoverflow.com/comment/62140569
has comment: http://stackoverflow.com/comment/66964672
has comment: http://stackoverflow.com/comment/119980079
score: 111
has comment: http://stackoverflow.com/comment/62283674
has comment: http://stackoverflow.com/comment/68420664
has comment: http://stackoverflow.com/comment/119902403
has comment: http://stackoverflow.com/comment/63297377

http://stackoverflow.com/q/27952019
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44300442
linked to: http://stackoverflow.com/q/26766268
has answer: http://stackoverflow.com/a/27953867
type: Question
has title: chrome.runtime.onMessage.addListener not registering within created tab
has comment: http://stackoverflow.com/comment/44302425
tagged with: javascript
has comment: http://stackoverflow.com/comment/44302497
accepted answer: http://stackoverflow.com/a/27953867
score: 0
has comment: http://stackoverflow.com/comment/44300575
tagged with: google-chrome-extension
answer count: 1
has comment: http://stackoverflow.com/comment/44300221
has body: The following script is injected from my background.js when I create a new tab (new tab loads a site, ie Google.com). $(function(){ //this fires when tab is created and script injected chrome.runtime.sendMessage({title: window.document.title}, function(){}); //this fires when clicking on element in created tab document.getElementById("Username").addEventListener("click", function(){ chrome.runtime.sendMessage({someMessageFromLiveSite: 'Clicked in live site!'}); }); chrome.runtime.onMessage.addListener(function(msg, _, sendResponse) { //this never fires chrome.runtime.sendMessage({title: 'This is the created tab responding to a msg'}, function(){}); //code continues... As commented above, chrome.runtime.sendMessage seems to work fine, as does a vanilla JS event listener, but the chrome.runtime.onMessage listener does not seem to be added/is not responding from messages sent from other parts of the extension (background or other created pages).
has comment: http://stackoverflow.com/comment/44302727

http://stackoverflow.com/q/27876429
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/34400318
tagged with: fade
type: Question
has title: bxslider horizontal effect fade
answer count: 1
tagged with: javascript
has body: Help to make the slider scrolls blocks but they fade when adding options fade is only one block. enter jsfiddle.net $(document).ready(function(){ $('.slider1').bxSlider({ slideWidth: 200, minSlides: 2, maxSlides: 3, slideMargin: 10 }); });
score: 0
tagged with: slider
accepted answer: http://stackoverflow.com/a/34400318

http://stackoverflow.com/comment/44129218
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27863114
has text: You mean after redirection, the BROWSER doesn't set the cookie on the header of request?

http://stackoverflow.com/comment/44039053
type: QuestionComment
type: Comment
has text: It *is* possible that your site might load for a client, but that clients network might block a particular cdn, hence the common sense in using a local backup copy.
comment on: http://stackoverflow.com/q/27816204
score: 0

http://stackoverflow.com/a/27866058
has comment: http://stackoverflow.com/comment/44197654
type: Answer
downvote count: 0
score: 1
has body: Yes, but as the items added are dynamic you need to use a delegated event handler attached to a non-changing ancestor element: e.g. something like: $(document).on('click', '.js_level1', function(){ alert(".js_level1 clicked!"); }); It works by listening for bubbled events, then applying the jQuery selector at event time, not event-registration time. This means the elements only need to be there when you click. document is the default if you do not have a closer element you can select. Never use 'body' for delegated events as styling can stop body responding to bubbled click events. Note: Without the code running (e.g. in a JSFiddle) I can't be more specific
accepted answer of: http://stackoverflow.com/q/27865747
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27865747
has comment: http://stackoverflow.com/comment/44197318

http://stackoverflow.com/comment/44063240
type: Comment
has text: How can I tell which version of router I'm using? I tried your solution `$state.href('mystate', { arg1_name: 'arg1_val', arg2_name: 'arg2_val'})` and it didn't work for me.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27828519

http://stackoverflow.com/comment/44166395
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27882288
has text: what values are you getting in your `$routeChangeSuccess` function? Can you log some stuff out? That function also has three params `function(event, next, current)`
score: 0

http://stackoverflow.com/q/27848339
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/20943820
has answer: http://stackoverflow.com/a/27853968
type: Question
has body: I have a template and a few views that are rendered based on their route: popApp.controller('HomeCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) { $scope.showNow = true; }]); app.config(['$routeProvider', function($routeProvider) { $routeProvider .when('/signup', { controller:'HomeCtrl', templateUrl:'partials/newAccountStage.html' }) .when('/', { controller:'HomeCtrl', templateUrl:'partials/home.html' }); }]); In my template, I display some elements I'd like to display most of the time, but hide when certain routes are followed: &lt;div ng-show="showNow"&gt;&lt;/div&gt; Basically when the user is on the /signup route I'd like to hide some elements. What's the most angular way to approach this?
has comment: http://stackoverflow.com/comment/44101351
has title: Changing variables in controller on route change?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44100457
tagged with: javascript
has comment: http://stackoverflow.com/comment/44100505
tagged with: angularjs

http://stackoverflow.com/comment/44069546
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27831807
score: 0
has text: Try to see the source code if the online version changed, and forbid your web browser cache may help.

http://stackoverflow.com/comment/44268177
type: Comment
has text: This is a better answer, although I hope this question isn't actually about how to use jsfiddle...
comment on: http://stackoverflow.com/a/27935490
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44327705
has text: You are welcome! Yes, regarding the question, see this -> **http://jsfiddle.net/vsx7uxnf/4/** (if I understand correctly) just give the first column a name instead of `null`, and then target that name when you insert new rows dynamically (in the example an input box in inserted instead of the `defaultContent` button)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27965226

http://stackoverflow.com/comment/44233131
score: 0
type: AnswerComment
has text: Yes the second one should have been checking that we hadnt done a swap, you could alternately use a control variable, i just figured if youve replaced the value in the array, setting the new element to null shouldnt be a big deal
type: Comment
comment on: http://stackoverflow.com/a/27875060

http://stackoverflow.com/q/27887884
duplicate of: http://stackoverflow.com/q/5786851
possible better answer: http://stackoverflow.com/a/27887919
has comment: http://stackoverflow.com/comment/44212259
has comment: http://stackoverflow.com/comment/44176922
has comment: http://stackoverflow.com/comment/44176692
favorite count: 0
linked to: http://stackoverflow.com/q/5786851
has answer: http://stackoverflow.com/a/27887943
accepted answer: http://stackoverflow.com/a/27887943
upvote count: 5
has body: How can I make a local variable inside a function into a global in JavaScript? P.S: Just pure JavaScript, no jQuery. P.P.S.: Nothing toooo complicated, thanks. :)
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27887913
has answer: http://stackoverflow.com/a/27887919
has title: How to make a local variable into a global in JavaScript
has comment: http://stackoverflow.com/comment/44176681
has comment: http://stackoverflow.com/comment/44177860
type: Question
score: 3
tagged with: javascript
downvote count: 2
answer count: 3

http://stackoverflow.com/a/27946681
has body: li element doesn't have value attribute. However if you still want to get it use attr method: $( this ).attr( 'value' ); jsFiddle
type: Answer
has comment: http://stackoverflow.com/comment/44288417
answers question: http://stackoverflow.com/q/27946611
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/44076364
has text: Are you talking about the turquoise background? Is that your "quirky"?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27829205
type: QuestionComment

http://stackoverflow.com/a/27870586
has body: videos[number][0].src for .mp4 format and videos[number][1].src for .webm format and make sure to correct object declaration: {type:'mp4', 'src':'videos/2.mp4'} should be {type:'mp4', src:'videos/2.mp4'}
type: Answer
answers question: http://stackoverflow.com/q/27870098
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/27829149
type: Answer
answers question: http://stackoverflow.com/q/27826833
has body: I solved the problem. Actually, It was just an user-end mistake.
score: 0

http://stackoverflow.com/a/27892152
type: Answer
has body: you should change .forEach to .each and the month argument would be a div element not a string. $('[data-month]').each(function(month) { $('[data-month="' + month.getAttribute('data-month') + '"]').bind('click', function() { alert(month); }); });
answers question: http://stackoverflow.com/q/27891875
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/a/27925756
has comment: http://stackoverflow.com/comment/44251230
has comment: http://stackoverflow.com/comment/44258169
has comment: http://stackoverflow.com/comment/44262266
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27925077
has comment: http://stackoverflow.com/comment/44285446
answers question: http://stackoverflow.com/q/27925077
has comment: http://stackoverflow.com/comment/44285398
score: 1
has comment: http://stackoverflow.com/comment/44278503
has body: It seems to be a bug which can be eradicated by triggering the layout somehow. First of all, the child element of one ruled as display:table might turn into display:table-row or display:table-cell by default, even if not written via the CSS rules. Browsers always try to correct or fix things which obviously here do not work out properly. Trying to trigger layout using float or display:inline-block here looks like it fixes the misbehavior of the parent displayed as table, at least in Firefox. http://jsfiddle.net/9ucm7z9h/3/ You can find a bug report here.
has comment: http://stackoverflow.com/comment/44268051
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44228563
type: QuestionComment
has text: D3 should account for that difference. Also, if you make them even the transition still doesn't work.
score: 0
comment on: http://stackoverflow.com/q/27914624
type: Comment

http://stackoverflow.com/a/27851097
accepted answer of: http://stackoverflow.com/q/27850850
type: AcceptedAnswer
has body: Here are some extremely simple easing in and out equations written in that you might find helpful. // accelerating from zero velocity function easeIn(t) { return t*t } // decelerating to zero velocity function easeOut(t) { return t*(2-t) } so you could use them like so: function ease(easeDelta,accelerateBool){ if(accelerateBool){ // accelerating return (easeDelta * easeDelta); } else { //decelerating return ((easeDelta*(easeDelta - 2))); } }
answers question: http://stackoverflow.com/q/27850850
has comment: http://stackoverflow.com/comment/44107940
has comment: http://stackoverflow.com/comment/44108421
type: Answer
has comment: http://stackoverflow.com/comment/44106377
has comment: http://stackoverflow.com/comment/44109029
has comment: http://stackoverflow.com/comment/44107424
score: 0

http://stackoverflow.com/a/27868575
answers question: http://stackoverflow.com/q/27867889
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27867889
has comment: http://stackoverflow.com/comment/44142602
has comment: http://stackoverflow.com/comment/44142315
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44140471
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44140535
has body: It looks like you may be mixing up two directives. ng-file-select comes from danialfarid's angular-file-upload while the file directive is from cheynewallace's example you mentioned. If you are going with cheynewallace's, then you are probably missing his directive (linked above). Looking at the code, his directive only supports a single file upload and sets the file to a $scope.file variable. In his example, he uses: Upload Your controller would need to be something like this: app.controller('myController', function($scope) { $scope.upload = function() { // do something with $scope.file }; }); If you are going with danialfarid's directive, then you can remove the file attribute from your input. This would leave you with: And your controller would need to look something like this: app.controller('myController', function($scope) { $scope.onFileSelect = function($files) { // do something with $files }; }); warning I have not tested these two approaches, but I believe either will get you on the write track. Update Here's a working plunk. I just made a quick concrete example with my code above, but my first snippet was wrong about the ng-file-change. It should have been ng-file-select like you had initially. The plunk illustrates both directives. I also added the ng-multiple='true' attribute in the danialfarid example to allow multiple file selection.
has comment: http://stackoverflow.com/comment/44140710
type: Answer
has comment: http://stackoverflow.com/comment/44139809

http://stackoverflow.com/comment/44055645
type: QuestionComment
has text: Sorry. Ive edited the original post and added links to view both pages. I have tried some maths to divide the position/size etc and using percentages but didn't work for me
score: 0
comment on: http://stackoverflow.com/q/27824303
type: Comment

http://stackoverflow.com/comment/44283652
type: Comment
comment on: http://stackoverflow.com/q/27944064
score: 0
has text: Thanks Adeneo! Very elegant sidenote. Also changing the operator to && will do the job.
type: QuestionComment

http://stackoverflow.com/q/27926044
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27926358
has body: I'm following along the Discover Meteor tutorial and after commit 8-1 we add: // Check that the userId specified owns the documents ownsDocument = function(userId, doc) { return doc &amp;&amp; doc.userId === userId; } What I don't understand is that doc and userId are not strictly equal (===), so why does this work? For reference: doc: { _id: '1a2b3c4d', url: 'blahblah.com', title: 'blah blah', userId: '0w9x8y7z', author: 'testuser', submitted: '...'} doc.userId: userId: 0w9x8y7z userId: userId: 0w9x8y7z I get that doc.userId === userId, but why would doc &amp;&amp; doc.userId === userId pass?
type: Question
downvote count: 0
tagged with: javascript
has title: Shouldn't "return doc && doc.userId === userId;" return false?
accepted answer: http://stackoverflow.com/a/27926358
answer count: 3
has comment: http://stackoverflow.com/comment/44304344
has comment: http://stackoverflow.com/comment/44249257
has answer: http://stackoverflow.com/a/27926283
tagged with: meteor
favorite count: 0
possible better answer: http://stackoverflow.com/a/27926205
has answer: http://stackoverflow.com/a/27926205
upvote count: 1
has comment: http://stackoverflow.com/comment/44249390
linked to: http://stackoverflow.com/q/19839952

http://stackoverflow.com/comment/44103218
comment on: http://stackoverflow.com/q/27849446
type: Comment
type: QuestionComment
has text: Works beautifully. Why did this work instead of "left"?
score: 0

http://stackoverflow.com/q/27929535
has answer: http://stackoverflow.com/a/27929654
type: Question
has comment: http://stackoverflow.com/comment/44256719
tagged with: closures
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44256687
answer count: 2
linked to: http://stackoverflow.com/q/4472529
has body: I have an JavaScript library that implements "private fields" with closures, along the lines of: function makePublicInterface() { var private = 17; return { foo: function() { console.log(private); } }; } and I have an object returned by that function: var public = makePublicInterface(); Is there a way, given 'public', to somehow access 'private'? Chrome devtool certainly can, but I don't see a way to do it programmatically, there is nothing in either Object or Function to do that. This is purely a language question, I can add an accessor method to this particular library just fine.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27929671
has comment: http://stackoverflow.com/comment/44256239
has title: Accessing JavaScript closure from outside

http://stackoverflow.com/comment/44260028
type: Comment
comment on: http://stackoverflow.com/q/27929790
type: QuestionComment
has text: In animation tells a story, and a visitor must to see it
score: 0

cookies
tags question: http://stackoverflow.com/q/27867431
tags question: http://stackoverflow.com/q/27949301
tags question: http://stackoverflow.com/q/27858134
tags question: http://stackoverflow.com/q/27833500
tags question: http://stackoverflow.com/q/27941448
type: Tag
tags question: http://stackoverflow.com/q/27842706
tags question: http://stackoverflow.com/q/27903327
tags question: http://stackoverflow.com/q/27930990
tags question: http://stackoverflow.com/q/27943239
tags question: http://stackoverflow.com/q/27880633
tags question: http://stackoverflow.com/q/27917245
tag name: cookies
tags question: http://stackoverflow.com/q/27919493
tags question: http://stackoverflow.com/q/27867291
tags question: http://stackoverflow.com/q/27877068
tags question: http://stackoverflow.com/q/27883945
tags question: http://stackoverflow.com/q/27863114
tags question: http://stackoverflow.com/q/27883445

http://stackoverflow.com/comment/44034408
has text: what is meaning of `+` before Number?
score: 0
comment on: http://stackoverflow.com/a/27813730
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27852536
has body: I've seen tons of examples of how to override a jQuery core function such as: jQuery.fn.remove = function(){}; I am attempting to override a method in the jqWidgets framework I'm using, it is built on top of jQuery. The method I am focused on is the close method of the jqxWindow object. Object Init: $("#myWindowDiv").jqxWindow({ settingsVar }); Method Call: $("#myWindowDiv").jqxWindow('close'); Framework Init: (source code) var jqxBaseFramework = window.minQuery || window.jQuery; (function(a) { a.jqx = a.jqx || {}; ... ... ... })(jqxBaseFramework); Window Object Init: (source code) (function(a) { a.jqx.jqxWidget("jqxWindow", "", {}); a.extend(a.jqx._jqxWindow.prototype, { defineInstance: function() {}, ... ... ... close: function(){ //FUNCTION I WANT TO OVERRIDE }, ... ... ... })(jqxBaseFramework); Can somebody point me in the right direction? Can this be easily achieved?
tagged with: jquery
type: Question
accepted answer: http://stackoverflow.com/a/27852563
has title: Override Framework Method
score: 0
answer count: 1
tagged with: overriding
tagged with: javascript
tagged with: prototype
has answer: http://stackoverflow.com/a/27852563
type: AnsweredQuestion

http://stackoverflow.com/a/27825072
has comment: http://stackoverflow.com/comment/44055976
has comment: http://stackoverflow.com/comment/44056209
has comment: http://stackoverflow.com/comment/44078553
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27824768
has body: as was mentioned in the comments. You'll need to use contents to filter out the textNodes http://jsfiddle.net/evilbuck/hh1598gk/ $('.ms-list-addnew a:nth-of-type(2)').remove(); $('.ms-list-addnew').contents().filter(function() { return this.nodeType === 3; }).eq(1).remove();
score: 1
has comment: http://stackoverflow.com/comment/44057752

http://stackoverflow.com/q/27815825
has comment: http://stackoverflow.com/comment/44038294
tagged with: javascript
has answer: http://stackoverflow.com/a/27816001
has comment: http://stackoverflow.com/comment/44039047
type: Question
has comment: http://stackoverflow.com/comment/44037983
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44038049
has comment: http://stackoverflow.com/comment/44039353
tagged with: jquery
has comment: http://stackoverflow.com/comment/44038691
has comment: http://stackoverflow.com/comment/44038385
accepted answer: http://stackoverflow.com/a/27816001
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44038484
has body: I have a second thing in my page: @Html.EditorFor(m =&gt; m.Book.HasAt) Which is radio (Changed in EditorTemplates): @model bool? Yes @Html.RadioButton("", true, Model.HasValue &amp;&amp; Model.Value == true, htmlAttributes: ViewData["htmlAttributes"]) No @Html.RadioButton("", false, Model.HasValue &amp;&amp; Model.Value == false, htmlAttributes: ViewData["htmlAttributes"]) Also this is how it looks on page: Yes &lt;input id="Book_HasAt" name="Book.HasAt" type="radio" value="True" class="jq-radio"&gt; No &lt;input id="Book_HasAt" name="Book.HasAt" type="radio" value="False" class="jq-radio checked"&gt; Depending on value I need to show or hide div with some data. I have a script for it: $("#Book_HasAt").change(function () { var status = $(this); if (status.is(":checked")) { $("#SuppSelect").show(); } else { $("#SuppSelect").hide() } }); Script are working but there is a issue. My radio have a two values, Yes No (true and false). By default it is false. For some reason script are working ONLY when I change false to true. When I am reverting it back from true to false, script are not reacting at all and as a result div are not hidding anymore. Thi is unacceptable for me. How can I fix this and where the problem could be?
has comment: http://stackoverflow.com/comment/44038639
has title: The .change for radio are not working properly
possible better answer: http://stackoverflow.com/a/27816513
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27816513
tagged with: asp.net-mvc

http://stackoverflow.com/comment/44121418
comment on: http://stackoverflow.com/q/27859468
score: 0
type: Comment
has text: Your question is not clear. You mention `submit`, are you adding elements to a form? At what point in your code are you checking the length of `li` elements?
type: QuestionComment

http://stackoverflow.com/comment/44131047
score: 0
comment on: http://stackoverflow.com/a/27863378
type: Comment
has text: why do you need to store static html elements? Isn't the user's choice that you are interested in storing and retrieving?
type: AnswerComment

http://stackoverflow.com/comment/81736551
type: Comment
comment on: http://stackoverflow.com/a/32761932
score: 1
type: AnswerComment
has text: we need this answer further up, other answers are fairly outdated

http://stackoverflow.com/comment/44202426
score: 0
type: Comment
has text: I have adjusted my answer give that a go
comment on: http://stackoverflow.com/a/27900356
type: AnswerComment

http://stackoverflow.com/q/27852766
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44110058
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44109939
upvote count: 1
answer count: 1
has title: Generate (query) string from "where" object in waterline.js
has body: Using waterline.js in sails.js (0.10.5): I would like to create a 'where' string out of a where option object. For example, I have: where = { updatedAt:{"&gt;":"2015-01-08T10:00:00.000Z","&lt;=":"2015-01-08T20:00:00.000Z"} }; and I would like to have a generated string (similar to): "WHERE updatedAt &gt; '2015-01-08T10:00:00.000Z' AND updatedAt &lt;= '2015-01-08T20:00:00.000Z'" Is this possible? I have the feeling it should be...
tagged with: waterline
has answer: http://stackoverflow.com/a/27853031
tagged with: sails.js

http://stackoverflow.com/q/27880694
downvote count: 0
accepted answer: http://stackoverflow.com/a/27880750
has body: I have two &lt;a&gt; tags. One with class: table-link other: table-link danger In my backbone view's events, I want to trigger each with a callback: events: { 'click .table-link': 'edit', 'click .table-link.danger': 'del' } This works fine for table-link, however, when table-link danger is clicked, it calls both del and edit How can I make latter not trigger .table-link clicks?
type: Question
possible better answer: http://stackoverflow.com/a/27880749
has title: Backbone class selector for only 1 class
has answer: http://stackoverflow.com/a/27880749
has answer: http://stackoverflow.com/a/27880750
tagged with: javascript
upvote count: 2
answer count: 2
tagged with: jquery
favorite count: 0
tagged with: backbone.js
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/27928372
tagged with: url
linked to: http://stackoverflow.com/q/37667626
has answer: http://stackoverflow.com/a/67821910
tagged with: javascript
has answer: http://stackoverflow.com/a/63385172
has answer: http://stackoverflow.com/a/54281662
has answer: http://stackoverflow.com/a/61682747
has answer: http://stackoverflow.com/a/57245191
has answer: http://stackoverflow.com/a/66004210
has answer: http://stackoverflow.com/a/46808403
has answer: http://stackoverflow.com/a/76752656
linked to: http://stackoverflow.com/q/41246261
has answer: http://stackoverflow.com/a/49187436
has answer: http://stackoverflow.com/a/45597445
has answer: http://stackoverflow.com/a/36993568
has answer: http://stackoverflow.com/a/59983033
has answer: http://stackoverflow.com/a/75857027
has answer: http://stackoverflow.com/a/75991033
has comment: http://stackoverflow.com/comment/82238792
has answer: http://stackoverflow.com/a/53854836
has answer: http://stackoverflow.com/a/37449679
has answer: http://stackoverflow.com/a/46035346
has answer: http://stackoverflow.com/a/78120853
has comment: http://stackoverflow.com/comment/64734369
has answer: http://stackoverflow.com/a/73018427
has comment: http://stackoverflow.com/comment/44483432
has answer: http://stackoverflow.com/a/48061394
has answer: http://stackoverflow.com/a/74913753
has answer: http://stackoverflow.com/a/57066837
has answer: http://stackoverflow.com/a/39444456
has answer: http://stackoverflow.com/a/62985348
has answer: http://stackoverflow.com/a/43628877
favorite count: 0
score: 1304
has answer: http://stackoverflow.com/a/54765884
has answer: http://stackoverflow.com/a/68332244
has answer: http://stackoverflow.com/a/58049526
has answer: http://stackoverflow.com/a/77231332
has answer: http://stackoverflow.com/a/66687489
has answer: http://stackoverflow.com/a/40591955
has answer: http://stackoverflow.com/a/75701735
has answer: http://stackoverflow.com/a/46585262
has answer: http://stackoverflow.com/a/69570725
has answer: http://stackoverflow.com/a/51489736
has answer: http://stackoverflow.com/a/56946000
has answer: http://stackoverflow.com/a/36623117
has answer: http://stackoverflow.com/a/41661951
has answer: http://stackoverflow.com/a/55115779
has answer: http://stackoverflow.com/a/55095327
has answer: http://stackoverflow.com/a/64753199
has title: React-router URLs don't work when refreshing or writing manually
has answer: http://stackoverflow.com/a/39420937
has answer: http://stackoverflow.com/a/44467274
has comment: http://stackoverflow.com/comment/49425351
has answer: http://stackoverflow.com/a/43470639
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28076359
has answer: http://stackoverflow.com/a/47446965
possible better answer: http://stackoverflow.com/a/40591955
has body: I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want. For instance, I am in localhost/joblist and everything is fine because I arrived here pressing a link. But if I refresh the webpage I get: Cannot GET /joblist By default, it didn't work like this. Initially I had my URL as localhost/#/ and localhost/#/joblist and they worked perfectly fine. But I don't like this kind of URL, so trying to erase that #, I wrote: Router.run(routes, Router.HistoryLocation, function (Handler) { React.render(<Handler/>, document.body); }); This problem does not happen with localhost/, this one always returns what I want. This app is single-page, so /joblist doesn't need to ask anything to any server. My entire router. var routes = ( <DefaultRoute handler={Dashboard}/> <NotFoundRoute handler={NotFound}/> ); Router.run(routes, Router.HistoryLocation, function (Handler) { React.render(<Handler/>, document.body); });
answer count: 63
has answer: http://stackoverflow.com/a/47277140
accepted answer: http://stackoverflow.com/a/36623117
linked to: http://stackoverflow.com/q/33376414
has answer: http://stackoverflow.com/a/78019168
linked to: http://stackoverflow.com/q/45002573
has answer: http://stackoverflow.com/a/46155087
tagged with: react-router
has answer: http://stackoverflow.com/a/62943740
has answer: http://stackoverflow.com/a/60832754
has answer: http://stackoverflow.com/a/71721197
has answer: http://stackoverflow.com/a/61509269
has answer: http://stackoverflow.com/a/63316403
downvote count: 1
has answer: http://stackoverflow.com/a/51095522
has answer: http://stackoverflow.com/a/42094288
linked to: http://stackoverflow.com/q/18740419
has comment: http://stackoverflow.com/comment/89489390
type: Question
has answer: http://stackoverflow.com/a/78629388

http://stackoverflow.com/comment/44166602
comment on: http://stackoverflow.com/a/27882395
has text: Don't know hammer but if it binds event handlers to elements would be same principle as the way I used 'bind'
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44191084
has text: That worked perfectly. You get the check for both being first and for the article - exactly what I needed. Thanks
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27894952
type: AnswerComment

http://stackoverflow.com/comment/44156142
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27877295
type: Comment
has text: clicked link when page reload must keep dropdown active class, so this code isn't correct I think. :)

http://stackoverflow.com/q/27934238
accepted answer: http://stackoverflow.com/a/30960037
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/42869911
has answer: http://stackoverflow.com/a/53076960
has answer: http://stackoverflow.com/a/45810395
has body: So is this the only way to render raw html with reactjs? // http://facebook.github.io/react/docs/tutorial.html // tutorial7.js var converter = new Showdown.converter(); var Comment = React.createClass({ render: function() { var rawMarkup = converter.makeHtml(this.props.children.toString()); return ( {this.props.author} ); } }); I know there are some cool ways to markup stuff with JSX, but I am mainly interested in being able to render raw html (with all the classes, inline styles, etc..). Something complicated like this: Dropdown Action Another action Something else here Separated link I would not want to have to rewrite all of that in JSX. Maybe I am thinking about this all wrong. Please correct me.
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/77385157
has answer: http://stackoverflow.com/a/27958683
has title: How do I render raw HTML with React?
type: Question
has answer: http://stackoverflow.com/a/73006713
has comment: http://stackoverflow.com/comment/44270265
has answer: http://stackoverflow.com/a/73246387
possible better answer: http://stackoverflow.com/a/27958683
has comment: http://stackoverflow.com/comment/44280653
has answer: http://stackoverflow.com/a/73393154
has answer: http://stackoverflow.com/a/56394170
answer count: 14
has answer: http://stackoverflow.com/a/30960037
linked to: http://stackoverflow.com/q/19266197
downvote count: 1
has comment: http://stackoverflow.com/comment/81873515
linked to: http://stackoverflow.com/q/494143
has answer: http://stackoverflow.com/a/51284923
has answer: http://stackoverflow.com/a/27943531
upvote count: 294
has answer: http://stackoverflow.com/a/52960008
has comment: http://stackoverflow.com/comment/117256789
has answer: http://stackoverflow.com/a/41968716
score: 293
tagged with: reactjs

http://stackoverflow.com/q/27918071
accepted answer: http://stackoverflow.com/a/27918294
tagged with: http://stackoverflow.com/tag/html
has body: quick question and I know it might seem easy to very experienced programmers out there but I'm only learning and I'm trying to learn about best practices and how to do things most efficiently, so please bear with me! I'd really appreciate any advice. I'm working with JQueryand I'm trying to make a simple Tab functionality. The way I've done it is I've created a ul containing multiple li then depending on the li clicked I update the content in a div on the page. I've implemented this in JSFiddle so you can see my code: http://jsfiddle.net/javacadabra/oeh7Lj62/ I'm wondering If this is a good approach to making Tabs? and whether or not the way I show the one I click and hide the others is efficient, because let's say for example I had 20 tabs, would I need to have a show() for the tab clicked and hide() for the other 19? Or is there a more effective way of hiding the other tabs? Again, I know it's a simple enough question but I'm just looking for advice on how to improve. Many thanks. This is my js $(document).ready(function () { $('#mylist li').click(function (e) { var tab = $(this).html(); if (tab == "one") { $('#tab-1-list').show(); $('#tab-2-list').hide(); $('#tab-3-list').hide(); } else if (tab == "two") { $('#tab-2-list').show(); $('#tab-1-list').hide(); $('#tab-3-list').hide(); } else { $('#tab-3-list').show(); $('#tab-1-list').hide(); $('#tab-2-list').hide(); } }); }); This is my html one two three This is a bullet point for Tab 1 This is a bullet point for Tab 1 This is a bullet point for Tab 1 This is a bullet point for Tab 2 This is a bullet point for Tab 2 This is a bullet point for Tab 2 This is a bullet point for Tab 3 This is a bullet point for Tab 3 This is a bullet point for Tab 3 This is my css #tab-1-list{display:none;} #tab-2-list{display:none;} #tab-3-list{display:none;} Thank you
has title: Building Tabs with JQuery, the most efficient and effective way?
tagged with: css
has comment: http://stackoverflow.com/comment/44234653
has comment: http://stackoverflow.com/comment/44234482
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27918273
has comment: http://stackoverflow.com/comment/44234421
has answer: http://stackoverflow.com/a/27918292
type: Question
has comment: http://stackoverflow.com/comment/44234765
has comment: http://stackoverflow.com/comment/44234874
has comment: http://stackoverflow.com/comment/44234493
has answer: http://stackoverflow.com/a/27918294
tagged with: javascript
has comment: http://stackoverflow.com/comment/44234388
score: 0
has answer: http://stackoverflow.com/a/27918680
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27918680

http://stackoverflow.com/comment/44286940
score: 0
comment on: http://stackoverflow.com/a/27945565
type: AnswerComment
has text: Thanks a lot for your idear. Small Problem. If you maybe choose first CMS, and then Contao and then a Layout and after that you will switch back to "Statisch" then the Layout radio buttons will still appear. Do you have an idear?
type: Comment

http://stackoverflow.com/a/27885329
has comment: http://stackoverflow.com/comment/44194899
has comment: http://stackoverflow.com/comment/44194614
type: Answer
has comment: http://stackoverflow.com/comment/44182150
answers question: http://stackoverflow.com/q/27885313
has comment: http://stackoverflow.com/comment/44202296
has comment: http://stackoverflow.com/comment/44172243
has body: Make sure you are properly including the library: then try something like this var sigJq = $("sig"); sigJq.signature();
has comment: http://stackoverflow.com/comment/44193800
has comment: http://stackoverflow.com/comment/44194848
score: 0

http://stackoverflow.com/a/27833166
has body: You can add buttons on left or right side in navigation bar from any screen containing .Like New Button So this "New Button" will only come for "New Screen".
accepted answer of: http://stackoverflow.com/q/27832385
upvote count: 27
score: 27
answers question: http://stackoverflow.com/q/27832385
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/55933875
has comment: http://stackoverflow.com/comment/44084016
type: Answer

http://stackoverflow.com/comment/44190992
comment on: http://stackoverflow.com/a/27894880
type: AnswerComment
has text: That's because your code probably threw an error, since I'm guessing you don't have a button with the id "homepage". You're going to have to provide more information about this homepage button if you want example code that actually works.
score: 0
type: Comment

http://stackoverflow.com/comment/44061920
type: Comment
type: QuestionComment
has text: Is this what you're after http://jsfiddle.net/j08691/7nb5b48z/5/?
score: 0
comment on: http://stackoverflow.com/q/27827841

http://stackoverflow.com/comment/44271464
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27937067
has text: "special paste" (paste without formatting)

http://stackoverflow.com/q/27947252
has title: apply forEach method on array like objects in javascript
type: Question
tagged with: foreach
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/51414577
linked to: http://stackoverflow.com/q/3199588
has answer: http://stackoverflow.com/a/51414577
tagged with: nodelist
answer count: 2
has body: Here i have four input buttons and i want to add event handler for each of them.If i use for loop i have to deal with closures.Actually i am trying to understand how to manage forEach method for array like object.This is the closest solution i can manage.As we have to encounter closure related problem if we want to use array methods.I had to use object.keys to get the indexes and applied forEach on them.Though it sounds strange but i am not quite satisfied with this solution.Can it be more simpler?How can i manage forEach directly on the nodeList stored in Buttons variable function change(){ var buttons=document.getElementsByTagName('input'); var keys=Object.keys(buttons); keys.forEach(function(el,indx,arr){ if(el != 'length'){ this[el].addEventListener('click', function(e){ alert(e.target.value); }); } }, buttons); } change(); &lt;input type='button' value='button1'&gt; &lt;input type='button' value='button2'&gt; &lt;input type='button' value='button3'&gt; &lt;input type='button' value='button4'&gt;
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27947488
favorite count: 0
has comment: http://stackoverflow.com/comment/51704018
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/27947488

http://stackoverflow.com/q/27814803
has comment: http://stackoverflow.com/comment/44036586
linked to: http://stackoverflow.com/q/11922383
has comment: http://stackoverflow.com/comment/44036566
has comment: http://stackoverflow.com/comment/44036652
type: Question
has answer: http://stackoverflow.com/a/27816423
has comment: http://stackoverflow.com/comment/44037893
has comment: http://stackoverflow.com/comment/44037397
has comment: http://stackoverflow.com/comment/44036743
tagged with: javascript
has comment: http://stackoverflow.com/comment/44037230
score: 0
has comment: http://stackoverflow.com/comment/44037110
answer count: 1
has body: How can I get the second value from videoid:uoSDF234and make it countdown ? first I need "videoid":"uoSDF234" be the first countdown then next will be "videoid":"0apq3ss" and so on (if I add more data). when I click the stop button, label id="vstopresult" will show the stopped videoid and second. the countdown will looping for each videoid in videolist. var videoinfo = [{"startdatetime":"2014-12-21 00:23:14","totalsecondrun":"2019402310","videolist": [{"videoid":"uoSDF234","second":"10"},{"videoid":"0apq3ss","second":"14"}]}]; // JavaScript Document var calduration = function(){ $.each(videoinfo, function(i, obj) { $("#vstart").append(obj.startdatetime); $("#vtotoals").append(obj.totalsecondrun); $("#vid").append(videoinfo[0].videolist[0].videoid); $("#vlefts").append(videoinfo[0].videolist[0].second); var output = $("#vlefts"); var isPaused = false; var time = videoinfo[0].videolist[0].second; var t = window.setInterval(function() { if(!isPaused) { time--; output.text(time); } if (time == 0){ clearInterval(t); } }, 1000); //with jquery $("#vpause").on('click', function(e) { e.preventDefault(); isPaused = true; }); $("#vplay").on('click', function(e) { e.preventDefault(); isPaused = false; }); $("#vstop").on('click', function(e) { clearInterval(t); $("#vstopresult").append(time); }); }); }; calduration();
has comment: http://stackoverflow.com/comment/44036952
has comment: http://stackoverflow.com/comment/44036413
has title: Select value inside object
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44037662
has comment: http://stackoverflow.com/comment/44036294

http://stackoverflow.com/a/27806694
score: 0
has body: You can animate background color using Jquery UI library. Include your jquery library and the jquery ui library, and it should work. http://jqueryui.com/animate/
answers question: http://stackoverflow.com/q/27806428
type: Answer

http://stackoverflow.com/comment/44314149
comment on: http://stackoverflow.com/q/27960262
has text: what you mean adds a new obj?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/56870134
has body: There are actually two methods to check it. 1) Using ExpectedConditions var EC = protractor.ExpectedConditions; // Waits for the element with id 'abc' to not be clickable. browser.wait(EC.not(EC.elementToBeClickable($('#abc'))), 5000); If found to be clickable, it will return error. 2) Using protractor's isEnabled, isDisplayed and isPresent So as far as my understanding goes, you can create isNotClickable, which will return false only if element is present, displayed or enabled and true otherwise: function isNotClickable(element) { return element.isPresent().then((isPresent) =&gt; { if (isPresent) { return element.isDisplayed().then((isDisplayed) =&gt; { if (isDisplayed) { return !element.isEnabled(); } return true; }); } return true; }); }
answers question: http://stackoverflow.com/q/27859751
score: 0
type: Answer

http://stackoverflow.com/comment/132917502
type: AnswerComment
has text: Works like magic! Using cpanel too
type: Comment
comment on: http://stackoverflow.com/a/40591955
score: 0

http://stackoverflow.com/comment/44024592
comment on: http://stackoverflow.com/q/27805903
type: Comment
type: QuestionComment
has text: Not necessary to separate your html from the php handlers. That's a good way to keep stuff together. I would recommend `echo`ing something right before your `header()` call to see if your code is even getting down that far. Have you checked your error logs?
score: 0

http://stackoverflow.com/a/27943460
downvote count: 0
has comment: http://stackoverflow.com/comment/44282667
type: Answer
answers question: http://stackoverflow.com/q/27943293
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27943293
has comment: http://stackoverflow.com/comment/44286100
has body: All you need to do is to cast string values to numbers before you compare them: var value1 = Number($(this).find("input[name='value_1']").val()); var value2 = Number($(this).find("input[name='value_2']").val()); Remember that value of the input field is always a string and of course string "9" is greater then "15". Demo: http://jsfiddle.net/ck64v16t/
has comment: http://stackoverflow.com/comment/44285979
type: AcceptedAnswer

http://stackoverflow.com/a/27884477
type: Answer
answers question: http://stackoverflow.com/q/27884186
has body: No, it is not possible (no collision will occur). Each AJAX call response can be considered a message on the JavaScript message queue. The JavaScript runtime processes each message on the queue to completion before processing the next. In other words, it calls the callback for the event and runs the full callback function (and all the functions it calls, and so on) to completion before moving onto the next message in the queue. Therefore, no two messages (e.g., AJAX responses) will be processed in parallel. Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop Also, I've worked in JavaScript for many years and can guarantee this is how it works.
has comment: http://stackoverflow.com/comment/44188127
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27884186

http://stackoverflow.com/comment/44184186
type: QuestionComment
comment on: http://stackoverflow.com/q/27882342
score: 0
has text: This link was very helpful! I think i'll look more into using tokens than sessions. Thank you!
type: Comment

http://stackoverflow.com/comment/44205581
has text: Ihave take a look at sencha live search before, but i didn' get some enlighment, not yet. may be you can help me with your logic how to use that to create autocomplete ?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27888617
type: Comment

http://stackoverflow.com/comment/44043438
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27818260
has text: Yes, this should be an async operation
type: QuestionComment

http://stackoverflow.com/comment/44076575
score: 1
comment on: http://stackoverflow.com/q/27835996
type: Comment
type: QuestionComment
has text: `onclick="delBtn('<?php echo $id; ?>')"` ??? But describe your issue. Error in console? And why do you need to pass ID here, i still don't get it?

http://stackoverflow.com/q/27817782
type: Question
has comment: http://stackoverflow.com/comment/44041513
has answer: http://stackoverflow.com/a/27817949
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27817922
has comment: http://stackoverflow.com/comment/44041702
has answer: http://stackoverflow.com/a/27817846
downvote count: 3
has comment: http://stackoverflow.com/comment/44041649
answer count: 7
has answer: http://stackoverflow.com/a/27817828
favorite count: 0
has answer: http://stackoverflow.com/a/27817918
score: -3
has title: Select the value/text of an element with jquery
has answer: http://stackoverflow.com/a/27817899
accepted answer: http://stackoverflow.com/a/27817899
type: AnsweredQuestion
upvote count: 0
has body: I got these 3 links WTF DUDE SRSLY And I want to parse the value attribute. I'm using this script but it always return null. jQuery.noConflict(); jQuery(document).ready(function ($) { $('#ajaxed').on('click',function() { var value = $(this).val(); alert(value); }); }); Also I tried parse the text and it only works for the first one . The fiddle of that one: http://jsfiddle.net/dzasusxp/18/ What am I doing wrong? It seems kinda ok for me...
has answer: http://stackoverflow.com/a/27817851
possible better answer: http://stackoverflow.com/a/27817828

http://stackoverflow.com/comment/44285258
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27944108
has text: Indeed, looking at all the answers, I now understand I could have been more precise and provide more details, I'll try to add as much as I can in this comment, the goal is to calculate the Eorzea time in C# for a realtime clock in a WindowsForm application to do timers afterward.
score: 0

http://stackoverflow.com/comment/44189985
type: QuestionComment
has text: $("#iFrame").contents().find("#pEmployeeCB").attr('disabled', false); this code is not working , i can see my two pages in same page, but i cant do effect to a page from one page.
score: 0
comment on: http://stackoverflow.com/q/27890242
type: Comment

http://stackoverflow.com/comment/44100770
type: Comment
type: AnswerComment
has text: @JonathanBechtel understood, but what actual element in table 1 needs be filled out (have contents) in order that table 2 row shows?
comment on: http://stackoverflow.com/a/27848154
score: 0

http://stackoverflow.com/q/27908261
favorite count: 0
answer count: 2
has body: Variable a is decared in the main file. Then a.js and b.js included. JS files have following content. a.js: a+=100; b.js: a=+200; And the main file: a+=90; console.log("a = " + a); Console shows a=290. Why is a not 420 (i.e. 30+100+200+90 ) ? why doesn't a change across both a.js and b.js?
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/27908296
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44215843
has title: why is javascript variable not changed across all the external JS files
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27908297
has answer: http://stackoverflow.com/a/27908297
accepted answer: http://stackoverflow.com/a/27908296

http://stackoverflow.com/q/27872761
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27873537
linked to: http://stackoverflow.com/q/21644493
has comment: http://stackoverflow.com/comment/44148251
upvote count: 1
type: Question
tagged with: javascript
has title: How can I start a new row on some specific index in ng-repeat?
has answer: http://stackoverflow.com/a/27873044
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/27873092
score: 1
has body: what i am trying to achieve: what i want to achieve is that to add an new row of ul after every 2 elements in my ng-repeat loop for example Automobile & Motorcycle Diagnostic Tools Automobile & Motorcycle Diagnostic Tools no how can i do this in ng-repeat? is there any possiblity using ng-repeat-start/end i havent been able to try any thing in angular view as i am not able to make any logic sorry for that, but i can get this done with java script by for (index=0,i=0,j=$scope.items.length; i<j; i+=chunk,index++) { temparray [index]= $scope.items.slice(i,i+chunk); } $scope.items =temparray; or $scope.groupByTwo = function (array) { var newarray =[]; index=0; for(a=0;a<array.length;a++){ if(a==0 || a%2==0){ newarray[index]=[]; newarray[index].push(array[a]); }else{ newarray[index].push(array[a]); } if(a!=0) index++; } return newarray; } $scope.items=$scope.groupByTwo($scope.items); Question is their any angular way of doing this cleanly?
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/27886579
has comment: http://stackoverflow.com/comment/44186328
has comment: http://stackoverflow.com/comment/44174654
upvote count: 2
has body: Unfortunately, not really. The server can send data as much as it likes, but the client has to read that, and that has to be checked contantly. You could embed seperate pages that would do the checking for you, but you can't get a request to trigger the check.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27886553
has comment: http://stackoverflow.com/comment/44212815
type: Answer
accepted answer of: http://stackoverflow.com/q/27886553
has comment: http://stackoverflow.com/comment/44174237
score: 2
downvote count: 0

http://stackoverflow.com/q/27829193
tagged with: angularjs
has body: I have a small issue regarding how to multiply numbers within an object in AngularJS. What I would like to do is change the following code from multiplying two numbers inside the HTML using AngularJS into a service or factory. Here is the working HTML (input is md-text-float from Angular Material), controller and factory in AngularJS: HTML: {{macro.type}} {{ macro.amount * macro.multiplier }} {{macro.tip}} Total Calories Controller: app.controller('dataAdd', ['$scope', 'MacroCalculation', function($scope, MacroCalculation) { $scope.macros = MacroCalculation.macros(); $scope.totals = MacroCalculation.totals(); }]); Factory: app.factory('MacroCalculation', function() { var macros = [ {'type': 'Protein', 'amount': null,'multiplier': 4,'tip': 'Calories per gram of protein'}, {'type': 'Carbohydrate', 'amount': null, 'multiplier': 4, 'tip': 'Calories per gram of carbohydrate'}, {'type': 'Fat', 'amount': null, 'multiplier': 9, 'tip': 'Calories per gram of fat'} ]; var getMacros = function() { return macros; }; var totals = function() { for (var i = 0, values = 0, length = macros.length; i < length; i++) { values += macros[i].amount * macros[i].multiplier; } return values; }; var getTotals = function() { return totals; }; return { macros: getMacros, totals: getTotals } }); I get the totals fine using {{totals()}}; however, I would like to move {{macro.amount * macro.multiplier}} into a function inside a factory as well. I am not sure how to loop through macros in the factory in order to do the same calculation.
upvote count: 1
has answer: http://stackoverflow.com/a/27829492
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27829302
type: Question
answer count: 2
has title: AngularJS: Multiplying Two Numbers within an Object and then Obtaining the Total
downvote count: 0
accepted answer: http://stackoverflow.com/a/27829492
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27829302
favorite count: 0

http://stackoverflow.com/q/27834909
has answer: http://stackoverflow.com/a/27835026
score: 0
has answer: http://stackoverflow.com/a/27836460
answer count: 3
has comment: http://stackoverflow.com/comment/44078633
tagged with: angular-ui
has comment: http://stackoverflow.com/comment/44078947
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44075026
tagged with: checkbox
has comment: http://stackoverflow.com/comment/44078422
type: Question
has answer: http://stackoverflow.com/a/27837332
has comment: http://stackoverflow.com/comment/44074787
has body: I have a simple checkbox like this: &lt;input type="checkbox" name="userGroup" ng-model="selectedAll" ng-change="selectAll();"&gt;&lt;/input&gt; I'm initiating the selectedAll model to false in my controller. In my selectAll() function, I log the value of the flag. But it stays false, doesn't update when I check and uncheck the checkbox. Any reason and solution for this? Update: My controller's code: $scope.selectedAll = false; $scope.selectAll = function() { console.log($scope.selectedAll); }
tagged with: javascript
has title: Angular Js - Checkbox model not toggling on ng-change?

http://stackoverflow.com/a/54467783
has comment: http://stackoverflow.com/comment/126553724
type: Answer
score: 6
answers question: http://stackoverflow.com/q/27826381
upvote count: 6
downvote count: 0
has body: Similar to other answers, if you want to reset the form (not necessarily clear it) you can use the following: &lt;button type="reset"&gt; It's a little cleaner than embedding jQuery or javascript calls in the onclick...

http://stackoverflow.com/comment/44176390
type: Comment
has text: What is the current problem? When you try to run it, what happens?
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27887708

http://stackoverflow.com/comment/44211402
has text: No but I was asked "why not just use a regular ajax call?", I presume meaning, why use deferred objects at all.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27905903
type: AnswerComment

http://stackoverflow.com/comment/102345390
type: AnswerComment
score: 0
has text: @Tycholiz, You can always persist state in local storage. All you need to handle is the initial load when `props.location.state` is null
type: Comment
comment on: http://stackoverflow.com/a/55825754

http://stackoverflow.com/comment/44167227
has text: ... and then [`.on`](http://api.jquery.com/on/) docs
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27882702

http://stackoverflow.com/q/27870062
tagged with: mongodb
answer count: 2
has answer: http://stackoverflow.com/a/27870719
has title: How to properly structure async Node code
has comment: http://stackoverflow.com/comment/44159875
downvote count: 0
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/44167595
tagged with: asynchronous
favorite count: 0
has comment: http://stackoverflow.com/comment/44157859
has answer: http://stackoverflow.com/a/27907139
type: UnansweredQuestion
upvote count: 1
has body: I'm attempting to work through a database of "events" I have and pull photos from the Instagram API based on each event's location, radius, start time, and end time. I've set up the following code on my Node server, but it is not behaving as I would expect. The first thing I see when I run this code is sending request to Instagram for [name] with min_timestamp: [timestamp] printed for every event. I did not expect this. I would have expected to see this line logged for the first event, then updated with a new timestamp over and over until that event reaches its end time. Then event 2, iterate through timestamps, and so forth. I end up with the same block of photos repeated over and over for each event. It's as if my code is firing off one request to Instagram (with the initial timestamp) over and over and then stopping. Notes on my timestamp variable: For each event I set my minTimestamp variable to initially equal event.start from my database. This is used within the request sent to Instagram. Instagram returns up to 20 photos to me. Each photo has a created_time variable. I grab the most recent created_time variable and set my minTimestamp variable to equal it (minTimestamp = images[0].created_time;) for my next request sent to Instagram (to grab the next 20 photos). This continues until minTimestamp is no longer less than endTimestamp (event.end for that event from my db). server.js code: // modules ================================================= var express = require('express.io'); var app = express(); var port = process.env.PORT || 6060; var io = require('socket.io').listen(app.listen(port)); var request = require('request'); var Instagram = require('instagram-node-lib'); var mongoose = require('mongoose'); var async = require('async'); var bodyParser = require('body-parser'); var methodOverride = require('method-override'); var db = require('./config/db'); var Event = require('./app/models/event'); // configuration ===========================================…
tagged with: node.js
has comment: http://stackoverflow.com/comment/44166684
score: 1
has comment: http://stackoverflow.com/comment/44167447
has comment: http://stackoverflow.com/comment/44157983
type: Question

http://stackoverflow.com/comment/44050214
comment on: http://stackoverflow.com/q/27806402
type: Comment
type: QuestionComment
has text: Thanks for your comments I will try to work with this solution.
score: 0

http://stackoverflow.com/comment/44042570
type: Comment
has text: @minseong Why does `foo === undefined` not suffice? Windows,frames?
type: QuestionComment
comment on: http://stackoverflow.com/q/27818331
score: 1

http://stackoverflow.com/a/27825181
accepted answer of: http://stackoverflow.com/q/27825081
has body: You can do this by hiding and showing the other select depending on the value that is chosen (unless you want to populate the results dynamically after clicking option 3 in which case you will have to be more specific) HTML Choose One Val 1 Val 2 Val 3 Choose Two Val 1 Val 2 Val 3 CSS #select2{ display: none; } JS $("#select1").change(function(){ if($(this).val() == 3){ $("#select2").show(); }else{ $("#select2").hide(); } }); FIDDLE
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27825081
type: AcceptedAnswer

http://stackoverflow.com/comment/44278194
comment on: http://stackoverflow.com/q/27941135
score: 1
has text: no, even if you play all the videos in sequence, the user will notice that they are different videos. A tricky solution may be capturing all the frames, loading all your video into a canvas, then show all captured frames in sequence with custom controls. Why don't you do a straight server-side concatenation?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27860849
score: 0
answer count: 1
tagged with: jquery
has body: I've built out a color coded map using D3 and want to take the next step of allowing a user to look at the data by year by clicking year buttons. I've attached an onclick function to each button and this function updates my displayYear variable. I threw in a console.log to make sure this variable is being updated correctly, and it is. However, for some reason my map never updates, it remains at its initial value no matter what is clicked. My HTML and Javascript/D3 code is below: relevant HTML: 2009 2010 2011 2012 2013 2014 relevant JS: //Bind premium and map data and create one path per mapData feature var displayYear = 0; function setYear(index) { displayYear = index; console.log(displayYear); } premSvg.selectAll("path") .data(mapData.features) .enter() .append("path") .attr("d", path) .style("fill", function(d) { //Get data value var value = d.properties.premium[displayYear].value; if (value) { //If value exists… return premColor(value); } else { //If value is undefined… return "#ccc"; } }) .style("stroke","grey") .append("title") .text(function(d) { return d.properties.name + ": $" + d3.format(",")(Math.round(d.properties.premium[displayYear].value)); });
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27864677
has title: D3 data not updating through onclick function
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44179516
has text: it is possible .and i solved it .
comment on: http://stackoverflow.com/q/27888637
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44080996
has text: please register to the [`resource.error`](http://docs.casperjs.org/en/latest/events-filters.html#resource-error), [`casper.page.onResourceTimeout`](http://phantomjs.org/api/webpage/handler/on-resource-timeout.html), [`remote.message`](http://docs.casperjs.org/en/latest/events-filters.html#remote-message) and [`page.error`](http://docs.casperjs.org/en/latest/events-filters.html#page-error) events.
comment on: http://stackoverflow.com/q/27836951
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44179008
type: AnswerComment
comment on: http://stackoverflow.com/a/27888888
type: Comment
has text: @tealou I've store PluginApi inside $ so you can access it outside, it is good practice to store staff in $.pluginName. If you don't want to store it in $ then you can use window.MyPlugin instead.
score: 1

http://stackoverflow.com/q/27849142
has body: I am trying change table's color from blue to red with JavaScript. function change(idElement){ var element = document.getElementById(idElement); if(element.style.background = "#00BFFF") element.style.background = "#800000"; else{ element.style.background = "#00BFFF"; } } This is my JavaScript code. It changes color one time, but I want to change its color again its old color when it is clicked.
has answer: http://stackoverflow.com/a/27849333
answer count: 1
favorite count: 0
tagged with: colors
type: UnansweredQuestion
has title: Change Table's Color With JavaScript
tagged with: http://stackoverflow.com/tag/html
downvote count: 3
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44102307
score: -2
tagged with: javascript

http://stackoverflow.com/a/27854971
answers question: http://stackoverflow.com/q/27854494
type: Answer
accepted answer of: http://stackoverflow.com/q/27854494
score: 17
upvote count: 17
has comment: http://stackoverflow.com/comment/44120749
has body: Much behaviour around document.write was established before formal specifications so behaviour is inconsistent and somewhat arbitrary across browsers. However, behaviour is now fairly consistent but there are differences depending on when it's called. The use of document.write is largely discouraged, however it's still useful. It's ubiquitous support means it can be used as a replacement for other techniques if really old browsers need to be accommodated. While a document is loading If you use document.write while the document is loading (e.g. a script element in the document source), then there is no need to call open or close. The document is opened when navigated to and closed when the content has finished loading (i.e. when the load event occurs). So as long as all the write statements are executed before load occurs, the browser will do the rest. After window load event dispatched Once the document has finished loading (e.g. the load event has been dispatched), then a call to document.write will first call clear which will clear the entire content of the document, everything. In this case, not all browsers will automatically call close when the call to write ends. Some browsers take a guess and seem to call close at some later time (IE?), others (Firefox, Safari) will keep the document open, which might cause some unusual behaviour. Child windows If you open a child window, e.g. using window.open, then write to it from the parent, the write will occur after the page has finished loading so it will clear the document. e.g. function openWindow() { var win = window.open('http://www.google.com','','') win.document.write( ' foo Here is a div ' ) win.document.close(); } In this case you'll never see Google, the call to write clears the page the moment it loads and writes the new content. Also, browsers won't automatically call close, you can make subsequent calls to document.write and they will append to the existing markup, e.g. // Global var win; // Open new window…
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44091932
has text: Since you have incorrect output in your second case, I think the comparison function is absolute germane to the question.
comment on: http://stackoverflow.com/q/27843673
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27869216
score: 1
type: Answer
has body: Nothing is wrong with your code. You are putting a border around your table. You might want to include border style rules on your td's to achieve your desired result. #myTable { table-layout : fixed; border : 1px solid black; border-collapse : collapse; /* Add this */ } #myTable td { border : 1px solid black; }
has comment: http://stackoverflow.com/comment/44141069
accepted answer of: http://stackoverflow.com/q/27869196
upvote count: 1
answers question: http://stackoverflow.com/q/27869196
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44120040
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27858282
score: 0
has text: Sure @IdanAdar, I'm a freshmen to start overflow. I will learn.

ortc
tags question: http://stackoverflow.com/q/27932853
tag name: ortc
type: Tag

http://stackoverflow.com/comment/103797179
has text: Please note! I had some bad permissions (desperate times) inside my plugins folder so I need to use `sudo` when removing. **do not** use sudo when adding a *anything*.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/44420544
type: AnswerComment

http://stackoverflow.com/comment/44164979
has text: Certainly, use `var title = this.parentNode.querySelector('h1').innerHTML;`.
comment on: http://stackoverflow.com/a/27881594
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27911106
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27911918
has title: Trigger drag event of draggable handle
downvote count: 0
score: 1
type: Question
has body: Given this html... &lt;div class="item"&gt; &lt;span class="handle"&gt;(handle)&lt;/span&gt; &lt;span&gt; Drag using the "(handle)"&lt;/span&gt; &lt;/div&gt;&lt;br/&gt; &lt;div class="handle2"&gt;(handle2)&lt;/div&gt; ...and this jQuery... $('.item').draggable({helper:'clone', handle:'.handle'}); $('.handle2').mousedown(function(e){ $('.handle').trigger(e); }); http://jsfiddle.net/2wLsvsw5/ ...Why is it that the drag event does not fire when dragging using (handle2)? ((handle) works as expected) I can make it work when I remove the "handle" option in the draggable method... $('.item').draggable({helper:'clone'}); $('.handle2').mousedown(function(e){ $('.handle').trigger(e); }); http://jsfiddle.net/2wLsvsw5/1/ What I am trying to do is trigger the drag event of the handle.
tagged with: jquery-ui
tagged with: javascript
upvote count: 1

mongoose
tags question: http://stackoverflow.com/q/27955426
tags question: http://stackoverflow.com/q/27840172
tags question: http://stackoverflow.com/q/27812897
tags question: http://stackoverflow.com/q/27815391
tags question: http://stackoverflow.com/q/27945897
tags question: http://stackoverflow.com/q/27901443
tags question: http://stackoverflow.com/q/27932834
type: Tag
tags question: http://stackoverflow.com/q/27810409
tags question: http://stackoverflow.com/q/27904002
tags question: http://stackoverflow.com/q/27925821
tags question: http://stackoverflow.com/q/27870990
tags question: http://stackoverflow.com/q/27847720
tags question: http://stackoverflow.com/q/27887391
tags question: http://stackoverflow.com/q/27949659
tags question: http://stackoverflow.com/q/27919946
tag name: mongoose
tags question: http://stackoverflow.com/q/27836934
tags question: http://stackoverflow.com/q/27832476
tags question: http://stackoverflow.com/q/27843497
tags question: http://stackoverflow.com/q/27870062
tags question: http://stackoverflow.com/q/27878072
tags question: http://stackoverflow.com/q/27848492
tags question: http://stackoverflow.com/q/27871611
tags question: http://stackoverflow.com/q/27837150
tags question: http://stackoverflow.com/q/27851327
tags question: http://stackoverflow.com/q/27862213
tags question: http://stackoverflow.com/q/27804351
tags question: http://stackoverflow.com/q/27932640
tags question: http://stackoverflow.com/q/27961903
tags question: http://stackoverflow.com/q/27926323
tags question: http://stackoverflow.com/q/27919383
tags question: http://stackoverflow.com/q/27954399
tags question: http://stackoverflow.com/q/27960568
tags question: http://stackoverflow.com/q/27864956
tags question: http://stackoverflow.com/q/27947004

http://stackoverflow.com/comment/44113530
type: Comment
has text: @charlietfl My form has mandatory three textbox (with RequiredFieldValidator) which need to be filled up before submit so the submit button checks for the validation but the loading modal does not.
score: 0
comment on: http://stackoverflow.com/q/27853668
type: QuestionComment

http://stackoverflow.com/q/27876078
linked to: http://stackoverflow.com/q/24608740
type: Question
has body: I am working on a website where I am using a lot of SVG elements. Now lately I have seen that the elements are being rendered in Chrome Version 39.0.2171.95 m and Opera. However, that is not the case with Firefox Version 34.0.5 and Internet Explorer 11. I have checked this answer SVG not rendering properly in Firefox , According to the above answer it says that this is a bug in FF 16 however they have resolved it in the latest versions of FF even in IE11 and as far as my research goes, SVG is not an issue with IE11. Now the strange thing is that all the simple SVG files are being rendered however a complex vector file such as a vector of iPhone 5 is not rendered ONLY in IE and FF. Below is an SVG thats not working in FF or IE: &lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="210px" height="211.5px" viewBox="0 0 210 211.5" style="enable-background:new 0 0 210 211.5;" xml:space="preserve"&gt; &lt;style type="text/css"&gt; .st0{fill:#FF5200;} .st1{fill:none;stroke:#FF5200;stroke-width:7;stroke-miterlimit:10;} &lt;/style&gt; &lt;filter id="drop"&gt; &lt;feOffset result = "offOut" in = "#ff5500" dx = "0" dy = "0"/&gt; &lt;feGaussianBlur result = "blurOut" in = "offOut" stdDeviation = "4"/&gt; &lt;feBlend in = "SourceGraphic" in2 = "blurOut" mode = "normal"/&gt; &lt;/filter&gt; &lt;g id="bolt"&gt; &lt;polygon filter="url(#drop)" class="st0" points="138.1,42.5 63.9,116.3 105.2,116.3 70.2,172.3 146.3,98.5 105.1,98.5 "/&gt; Click this Fiddle So you can get a better understanding of the issue. I created the SVG in Illusrator CS6. So my question is Whats the phenomena here ? What mistake am I doing here ? Is this is a bug in IE and FF ? I am using SVG because I want to incorporate some SVG animations. Are there any good Fallbacks for this issue to be solved ? Can I get some good resources regarding this specific issue ? I apologize if this information is not sufficient, as I am a beginner in…
answer count: 1
has comment: http://stackoverflow.com/comment/44156859
tagged with: javascript
has comment: http://stackoverflow.com/comment/44154483
has comment: http://stackoverflow.com/comment/44153672
has comment: http://stackoverflow.com/comment/44156998
accepted answer: http://stackoverflow.com/a/27877696
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44164893
favorite count: 0
has comment: http://stackoverflow.com/comment/44164372
has title: SVG is not being rendered in Firefox 34.0.5 and IE 11
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
has comment: http://stackoverflow.com/comment/44165926
tagged with: css
type: AnsweredQuestion
tagged with: internet-explorer
score: 1
has answer: http://stackoverflow.com/a/27877696
downvote count: 1

http://stackoverflow.com/a/27868606
has body: The original problem has already been explained by rfornal, but I thought I should mention that this code really needs to be DRYed up so there is no so much repeated code. There are a couple ways to do it. Calculating the myVar result based on the character found: $(document).ready(function() { var myVar = 'Null'; var match = window.location.search.match(/1501a(?)/); if (match) { var chr = match[1].charAt(0); if (chr &gt;= 'a' &amp;&amp; chr &lt;= 'h') { var code = match[1].charCodeAt(0) - 'a'.charCodeAt(0) + 1; myVar = '0' + code; } else if (char === 'j') { myVar = '09'; } } $('&lt;label for="name"&gt;' + myVar + '&lt;/label&gt;').insertBefore($('#name')); }); And, here's a different way using a lookup table: $(document).ready(function() { var myVar = 'Null'; var matches = {'1501aa': '01', '1501ab': '02', '1501ac': '03', '1501ad': '04', '1501ae': '05', '1501af': '06', '1501ag': '07', '1501ah': '08', '1501aj': '09'}; var match = window.location.search.match(/1501a?/); if (match) { var result = matches[match[0]]; if (result) { myVar = result; } } $('&lt;label for="name"&gt;' + myVar + '&lt;/label&gt;').insertBefore($('#name')); }); In addition, these also: Use window.location.search Get rid of the setText() function since it isn't needed, the single line of code can just be executed directly Use a regex to find the match
score: 4
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/27867911
type: Answer

http://stackoverflow.com/comment/44295823
type: Comment
score: 0
type: AnswerComment
has text: No, the browser ought to automatically redraw the element with the newly attached class styles. Are you sure the name of the class is spelled right (and the style elements are listed correctly in the CSS)?
comment on: http://stackoverflow.com/a/27949947

http://stackoverflow.com/q/27889698
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44263019
has title: Bootstrap open link when clicked on dropdown menu button
linked to: http://stackoverflow.com/q/24247970
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27891155
has body: I used bootstrap in my main menu and since my project has a lot of pages, subpages and sub-subpages I used the bootstrap dropdownmenu to navigate through this. My client now wants to be able to go to the link associated with the dropdown-button itself too, rather than the childen. My client has text on a page called 'customer support', and text on subpages (children). Ideally I want the user to first click a dropdownmenu button (ex. "Customer service"), and a dropdownmenu opens up (which Bootstrap does), and on a second click be able to go to the link associated with that dropdownmenu button (ex. "/customer-service"). I'll share some code to make it a bit more understandable: Dropdown Action Another action Something else here Separated link Dropdown Action Another action Something else here Separated link http://jsfiddle.net/kozog9rx/2/ (be sure to read the comment in the HTML and give the "Result-view" enough space/width so the menu appears)
has comment: http://stackoverflow.com/comment/44180376
answer count: 1
downvote count: 0
tagged with: drop-down-menu
has comment: http://stackoverflow.com/comment/54864699
accepted answer: http://stackoverflow.com/a/27891155
favorite count: 0
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/44416714
score: 6
tagged with: css
upvote count: 6

http://stackoverflow.com/comment/44143359
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27863298
type: AnswerComment
has text: Nice: Many event systems allow this kind of _silent_ event.

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/27884186
type: Tag
tags question: http://stackoverflow.com/q/27945597

http://stackoverflow.com/q/27873431
tagged with: php
has answer: http://stackoverflow.com/a/27876397
tagged with: laravel
tagged with: forms
type: Question
answer count: 2
tagged with: modal-dialog
tagged with: javascript
has body: I am using Laravel 4.2 and I want to confirm the user's password before a form submit with something like a modal, without doing the actual submit. If the password matches, do the submit; if not, keep in the same page without doing a reload, it is possible? How can I do that?
has answer: http://stackoverflow.com/a/27932019
score: 0
has title: Confirm the password before a form submit in Laravel
type: UnansweredQuestion

http://stackoverflow.com/comment/44289727
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27927348
has text: ok, makes it easier in that case . The code can be made cleaner/more concise but i just modified it to meet condition (1) : http://jsfiddle.net/angrybird/u8n8t7hh/30/

http://stackoverflow.com/comment/44234344
type: Comment
score: 3
type: QuestionComment
comment on: http://stackoverflow.com/q/27918100
has text: where is your code? and post a jsfiddle

http://stackoverflow.com/comment/89962813
type: Comment
score: 0
comment on: http://stackoverflow.com/a/39792856
has text: The bottom line is: always check the actual type files you're given! Thanks!
type: AnswerComment

http://stackoverflow.com/comment/44062801
type: Comment
score: 0
has text: @KevinB, Ok, maybe you're right, but I don't like it. It looks too much like GET.
type: QuestionComment
comment on: http://stackoverflow.com/q/27828297

http://stackoverflow.com/a/27853370
upvote count: 1
answers question: http://stackoverflow.com/q/27837578
downvote count: 0
has body: I figured it out... var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShellTreeItem) .rootTreeItem .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindow); function TabLeft() { mainWindow.gBrowser.tabContainer.advanceSelectedTab(-5, true); return "True"; } TabLeft();
type: Answer
score: 1

jquery-templates
type: Tag
tag name: jquery-templates
tags question: http://stackoverflow.com/q/27897338

http://stackoverflow.com/q/27947815
has comment: http://stackoverflow.com/comment/44290572
type: Question
score: 0
has body: I am have a issue with elements overlapping. I have a navbar that is sticky so it slides down the page when scrolling. I also have a to-top button that will auto to you to the header when hit. What I am wanting to do is when my to-top button reaches inside the header when scrolling right now it hovers over the last social icon on the far right. I want it to move the social icons over to fit in the to-top button. I am using the uikit from uikit.com to build it.
answer count: 1
has answer: http://stackoverflow.com/a/27947907
tagged with: javascript
tagged with: jquery
has title: Move elements when they overlap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/44051174
score: 0
has text: I have no clue where I would look for the error
type: Comment
comment on: http://stackoverflow.com/q/27822571
type: QuestionComment

http://stackoverflow.com/comment/44281503
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27922534
has text: Use navigator as I mentioned? How would I get a custom color on the navigator series in that case?

http://stackoverflow.com/comment/44111653
type: Comment
has text: @Bharadwaj what about on pressing tab,shift,alt,function keys?We need to skip them right?I want to accept only `alphanumeric characters,backspace,delete,space and special characters`
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27853781

http://stackoverflow.com/a/27837127
score: 2
answers question: http://stackoverflow.com/q/27837100
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27837100
has body: There are two elements with same Id(shouldnt be), remove them and you should use something like e.target here is an working example.. http://jsfiddle.net/83cyuozz/1/ $(document).ready(function(){ $('.product-photo-thumb').on("click", function (e) { e.preventDefault(); alert(e.target.alt); }); });
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44315695
comment on: http://stackoverflow.com/a/27959284
type: Comment
has text: Shamim, yes, but you still dont know what type myObject is. Could you set a breakpoint at the line myObject.dialog("close"); and look inside of the myObject?
score: 0
type: AnswerComment

http://stackoverflow.com/a/27818744
type: Answer
downvote count: 1
has body: Note: As this has now been down voted, I figured I'd point out that I posted this answer before javascript was added to the question, so please treat this as a pure HTML solution and nothing more. Radio buttons are exactly how you'd do this: State 1 State 2 State 3 With this you have 3 states. In the above answer, the result is either State 1, State 2 or State 3.
upvote count: 4
score: 3
answers question: http://stackoverflow.com/q/27818559

http://stackoverflow.com/comment/44226970
has text: I figured it out. Thank you for your help.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27909850
type: Comment

http://stackoverflow.com/q/27863610
has body: I have a Bootstrap accordion table that shows a hidden table with content whenever someone clicks anywhere on the row. The hidden table is then a different color (#DDD). What I'm trying to achieve is have the actual row changing the color too when clicked and opened and changing back to white when it is closed. How would I achieve that? Here is the HTML markup I currently have: First Last Phone Bill Clinton 000-000-0000 More details about Bill Clinton here. Abraham Lincoln 111-111-1111 More details about Abraham Lincoln here. and the CSS: .hiddentablerow{ padding: 0px 0px !important; background-color: #DDD; } And of course a fiddle: http://jsfiddle.net/kxtk6w4y/
type: Question
accepted answer: http://stackoverflow.com/a/27863808
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: Bootstrap accordion toggle inside a table and changing the background color of the selected row on click
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27863808
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/27961316
upvote count: 2
answers question: http://stackoverflow.com/q/27961217
has comment: http://stackoverflow.com/comment/44453830
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27961217
has body: There is a great example HERE. SC allows you to attach handlers to many events, as is in the docs HERE (function(){ var widgetIframe = document.getElementById('sc-widget'), widget = SC.Widget(widgetIframe); widget.bind(SC.Widget.Events.READY, function() { widget.bind(SC.Widget.Events.PLAY, function() { // get information about currently playing sound widget.getCurrentSound(function(currentSound) { console.log('sound ' + currentSound.get('') + 'began to play'); }); }); // get current level of volume widget.getVolume(function(volume) { console.log('current volume value is ' + volume); }); // set new volume level widget.setVolume(50); // get the value of the current position }); }()); Audio related events: SC.Widget.Events.LOAD_PROGRESS — fired periodically while the sound is loading. SC.Widget.Events.PLAY_PROGRESS — fired periodically while the sound is playing. SC.Widget.Events.PLAY — fired when the sound begins to play. SC.Widget.Events.PAUSE — fired when the sound pauses. SC.Widget.Events.FINISH — fired when the sound finishes. SC.Widget.Events.SEEK — fired when the user seeks.

http://stackoverflow.com/comment/44159239
score: 0
type: Comment
type: QuestionComment
has text: Nope that also doesn't work. I added my gulp.js file, maybe the problem is in there?
comment on: http://stackoverflow.com/q/27877394

http://stackoverflow.com/a/27843500
has comment: http://stackoverflow.com/comment/44097970
has comment: http://stackoverflow.com/comment/44098019
type: Answer
has comment: http://stackoverflow.com/comment/44114710
answers question: http://stackoverflow.com/q/27841312
upvote count: 1
has comment: http://stackoverflow.com/comment/44118824
has body: Using socket.io you can establish a persistent connection between the client and server. With that connection you can notify the client of any of your variable's changes. A simple example could be: On the server side : var io = require('socket.io')(http); io.on('connection', function() { //When client connects for the first time, send him the value immediately socket.emit('new_value', serverVariable); }); //Everytime you change the value, send it to all the clients connected using: io.emit('new_value', serverVariable); On the client side : var socket = io(); socket.on('new_value', function(serverVariable) { //Display it the way you want! }); This example should fit your case if serverVariable is a "simple" object, i.e. an object you can directly convert to json. And also if the nodejs server is the server serving the homepage, otherwise you need to adapt the first line. See http://socket.io/docs/ for more documentation about socket.io.
has comment: http://stackoverflow.com/comment/44092612
score: 1
downvote count: 0

http://stackoverflow.com/comment/44387756
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27964659
has text: @GiuseppinaRossi: I updated the above thread with an example.

http://stackoverflow.com/q/27944108
tagged with: c#
type: AnsweredQuestion
has body: I recently found the following code online that gives FFXIV's in-game time (Eorzea time): var E_TIME = 20.5714285714; var global = { utcTime: null, eorzeaTime: null }; window.setInterval(updateClock, Math.floor(1000 * 60 / E_TIME)); function updateClock() { global.utcTime = new Date().getTime(); var eo_timestamp = Math.floor(global.utcTime * E_TIME); global.eorzeaTime = new Date(); global.eorzeaTime.setTime(eo_timestamp); showTime(); } function showTime() { var d = new Date(); d.setTime(global.eorzeaTime); var eTime = document.getElementById('e-time'); var hours = d.getUTCHours(); var ampm = hours &gt; 11 ? "PM" : "AM"; if(hours &gt; 12) hours -= 12; hours = padLeft(hours); var minutes = d.getUTCMinutes(); minutes = padLeft(minutes); eTime.innerHTML = hours + ":" + minutes + " " + ampm; } function padLeft(val){ var str = "" + val; var pad = "00"; return pad.substring(0, pad.length - str.length) + str; } updateClock(); NOTE: I take no credit in that code, I am not the original coder and it was found here: http://jsfiddle.net/jryansc/6r85j/ What I would like to do is get something that does the same result in C# (time wise), unfortunately I am new to programming and I know only some C# at the moment. This is why I am asking for help, I tried to manipulate DateTime and TimeSpan in C# but it does not seem as easy as it is in JavaScript (according to the code above). Can someone help me out to convert the code please? All the help is greatly appreciated.
score: 1
has comment: http://stackoverflow.com/comment/44284137
tagged with: date
has comment: http://stackoverflow.com/comment/44285258
type: Question
downvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/44287885
tagged with: javascript
has comment: http://stackoverflow.com/comment/44285640
has comment: http://stackoverflow.com/comment/44283963
favorite count: 0
upvote count: 3
accepted answer: http://stackoverflow.com/a/27946403
has title: Convert DateTime value to Final Fantasy XIV Eorzea Game Time
has comment: http://stackoverflow.com/comment/44288089
has comment: http://stackoverflow.com/comment/44284339
has comment: http://stackoverflow.com/comment/44283642
has answer: http://stackoverflow.com/a/27946403
tagged with: time
has comment: http://stackoverflow.com/comment/44287356
has comment: http://stackoverflow.com/comment/44283626

http://stackoverflow.com/comment/44100210
type: AnswerComment
has text: Okay so I decided I am not happy with my workaround I rephrased the question and you can see my current workaround.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27841766

http://stackoverflow.com/comment/44293495
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27949205
has text: Agreeing with @War10ck. If the conditions of the to be removed event aren't exactly the same removing the event will fail.
score: 0

http://stackoverflow.com/comment/52368372
comment on: http://stackoverflow.com/a/27868061
type: Comment
score: 2
has text: `nooitaf:semantic-ui` is deprecated. Use https://atmospherejs.com/semantic/ui instead.
type: AnswerComment

http://stackoverflow.com/comment/44084377
type: AnswerComment
has text: I was half asleep when I wrote the answer apologies for the code errors, Fixed now
comment on: http://stackoverflow.com/a/27832608
type: Comment
score: 0

http://stackoverflow.com/comment/44028354
comment on: http://stackoverflow.com/q/27809661
score: 0
has text: @Derek 朕會功夫 and i fixed the link
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44153498
has text: Great, thanks for deleting my (correct) Answer with it :-/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27875957
score: 0

http://stackoverflow.com/a/27833126
has comment: http://stackoverflow.com/comment/44073633
has comment: http://stackoverflow.com/comment/44072748
type: Answer
has comment: http://stackoverflow.com/comment/44074031
score: 0
accepted answer of: http://stackoverflow.com/q/27833057
answers question: http://stackoverflow.com/q/27833057
has comment: http://stackoverflow.com/comment/44072053
has body: Try this.. Single Attached Young family Going to retire
has comment: http://stackoverflow.com/comment/44072179
has comment: http://stackoverflow.com/comment/44072104
type: AcceptedAnswer

http://stackoverflow.com/comment/44112027
type: Comment
comment on: http://stackoverflow.com/a/27851240
score: 0
has text: Yeah that seems a reasonable workaround, at least the info is there. Cheers! (PS. Note that I accidentally provided markup for a property and edited to show markup for a method, which was what I was after, but your solution still applies)
type: AnswerComment

http://stackoverflow.com/comment/44090899
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27843575
has text: not working for me. you mean String.prototype.concat ?

http://stackoverflow.com/a/27868752
has comment: http://stackoverflow.com/comment/44140326
has comment: http://stackoverflow.com/comment/44140175
has comment: http://stackoverflow.com/comment/44139976
answers question: http://stackoverflow.com/q/27868600
upvote count: 2
has body: You can do it setting custom options for toLocaleString, see MDN documentation for toLocaleString To solve your question: var tomorrow = new Date(Date.now() + 1000 * 3600 * 24); var result = tomorrow.toLocaleString('en-US', { weekday: 'long', month: 'long', year: 'numeric', day: 'numeric' }); document.write('&lt;p&gt;&lt;span id="date-time"&gt;', result, '&lt;\/span&gt;.&lt;\/p&gt;'); See this fiddle.
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44140136
downvote count: 0
has comment: http://stackoverflow.com/comment/44140199
has comment: http://stackoverflow.com/comment/44140241

http://stackoverflow.com/q/27872136
has answer: http://stackoverflow.com/a/27872191
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/54894534
has title: Bootstrap classes do not work in ReactJS component
accepted answer: http://stackoverflow.com/a/27872191
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/54894534
has body: I just started learning to use ReactJS to render views, but I found the bootstrap CSS classes don't work as expected if I insert the attributes directly into the ReactJS components. For example, in the below code, I wish to generate a panel with the classes: panel-default and panel-heading; however, the generated view doesn't carry the bootstrap style. I was wondering why and how to fix, if possible. Please note that I've compiled my ReactJS code and included the compiled JS in the HTML code (see at the bottom). var taxonGroups = { identifier: 'ABC-x981', sources: [ {segmentName: 'segment1', length: 1090}, {segmentName: 'segment2', length: 98}, {segmentName: 'segment3', length: 2091}, {segmentName: 'segment4', length: 1076}, ], fields: ['Taxon Name', 'Taxon ID', 'Taxon source'], collectionDate: '2001-09-10' }; var Taxon = React.createClass({ render: function() { return ( {this.props.data.identifier} { this.props.data.sources.map(function(source) { return <Segment name={source.segmentName} length={source.length}/> }) } ); } }); var Segment = React.createClass({ render: function() { return {this.props.name} {this.props.length} } }); React.render(<Taxon data={taxonGroups} />, document.getElementById('container')); The HTML code: reactJS 3 - Rendering data with bootstrap styles Is there anything? This is Panel Heading! This is panel body
type: Question
tagged with: reactjs
tagged with: javascript
answer count: 2
score: 25
downvote count: 0
favorite count: 0
upvote count: 25

http://stackoverflow.com/q/27850815
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27851286
tagged with: fine-uploader
has title: Changing to in fineuploader
has body: I am using http://fineuploader.com/ and Twitter bootstrap The html code for the uploading files looks like this Cancel Retry Delete Pause Continue View I want to change the tags to because I want the result to appear in a bootstrap grid. When I change the code can't I get any upload result for my uploaded files. Looks like new li-tags generates by fineuploader javascript. How do I use div instead and so that I can display the result in a bootstrap grid? Tested this Rest of the code ....
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27851286
score: 0

http://stackoverflow.com/comment/44061197
comment on: http://stackoverflow.com/a/27827162
score: 0
type: AnswerComment
type: Comment
has text: Just now I am using this line of code `<?php echo date('j F, Y', strtotime('+2 days')); ?>` and nothing appears. This is a basic Wordpress installation with no errors whatsoever.

http://stackoverflow.com/q/27940966
answer count: 1
has comment: http://stackoverflow.com/comment/44278444
type: UnansweredQuestion
has body: I was having some problem when trying to zoom to certain point on esri base map with an OneMap map overlayer. Here is the function where I get the coordinates x and y by passing in postal code: function zoomPostal(postalCode) { $.getJSON("http://www.onemap.sg/API/services.svc/basicSearch?token=qo/s2TnSUmfLz+32CvLC4RMVkzEFYjxqyti1KhByvEacEdMWBpCuSSQ+IFRT84QjGPBCuz/cBom8PfSm3GjEsGc8PkdEEOEr" + "&amp;searchVal=" + postalCode + "&amp;otptFlds=SEARCHVAL,CATEGORY" + "&amp;returnGeom=0&amp;rset=1", function (data) { var x = data.SearchResults[1].X; console.log(x); var y = data.SearchResults[1].Y; console.log(y); var loc = new esri.geometry.Point({ "x": x, "y": y, "spatialReference":'PROJCS["SVY21",GEOGCS["SVY21[WGS84]",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",28001.642],PARAMETER["False_Northing",38744.572],PARAMETER["Central_Meridian",103.8333333333333],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",1.366666666666667],UNIT["Meter",1.0]]' }); map.centerAndZoom(loc, 5); }); } When I print out the x and y, I am getting 23948.7465 and 47505.7986 so which means it is not NaN or null. However, with these code, I am getting error message as such: Error: Invalid value for &lt;image&gt; attribute x="NaN" Error: Invalid value for &lt;image&gt; attribute y="NaN" The strange thing is if I hardcoded the coordinate x and y to 'x" and "y" in the loc variable, it did zoomed and worked perfectly. I not sure why is it behaved in this way. Any ideas? Thanks in advance. EDIT This is the part where the error message was show: function zoomPostal(postalCode) { $.getJSON("http://www.onemap.sg/API/services.svc/basicSearch?token=qo/s2TnSUmfLz+32CvLC4RMVkzEFYjxqyti1KhByvEacEdMWBpCuSSQ+IFRT84QjGPBCuz/cBom8PfSm3GjEsGc8PkdEEOEr" + "&amp;searchVal=" + postalCode + "&amp;otptFlds=SEARCHVAL,CATEGORY" + "&amp;returnGeom=0&amp;rset=1", function (data)…
tagged with: maps
has answer: http://stackoverflow.com/a/27942392
has comment: http://stackoverflow.com/comment/44279358
has comment: http://stackoverflow.com/comment/44278011
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44278952
type: Question
has comment: http://stackoverflow.com/comment/44278846
has comment: http://stackoverflow.com/comment/44279910
tagged with: javascript
score: 0
has title: Error: Invalid value for <image> attribute when passing in variable

http://stackoverflow.com/q/27857605
has answer: http://stackoverflow.com/a/27881286
has answer: http://stackoverflow.com/a/64572321
answer count: 2
downvote count: 0
has body: I am currently creating a chrome app just for fun and learning, and then I encountered a problem. From the main window, I created a window that will display your conversation with the name you clicked, but I dont know how to pass data to that new window. Is it possible? if then, how? Here is the code i have. chrome.app.window.create('views/templates/chatWindow.html', { 'bounds': { 'width': window.screen.availWidth, 'height': window.screen.availWidth }, state: 'maximized', resizable: false }); Please note that I am using AngularJS and I'm working on a windows machine. Also, i have another question. That new window has its own controller, then, how do I get that passed data?
possible better answer: http://stackoverflow.com/a/64572321
favorite count: 0
tagged with: google-chrome-app
tagged with: angularjs
tagged with: windows
accepted answer: http://stackoverflow.com/a/27881286
type: AnsweredQuestion
score: 2
upvote count: 2
tagged with: google-chrome
type: Question
has title: How to pass data from main window to newly created window in chrome app with angularJS?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44135644

http://stackoverflow.com/comment/44115419
type: QuestionComment
has text: So in order to debug this, the JavaScript needs to be analyzed. Based on your observations, it just may work out to be a iOS/Android web view issue. However the problem almost certainly does not lie in the Java code you have posted.
comment on: http://stackoverflow.com/q/27854377
score: 1
type: Comment

http://stackoverflow.com/comment/44297632
comment on: http://stackoverflow.com/q/27951157
type: QuestionComment
type: Comment
has text: Please define "it doesn't work".
score: 0

http://stackoverflow.com/q/27926323
has answer: http://stackoverflow.com/a/27931147
score: 0
has body: thanks in advance for your time and answers: I've been trying to do something that "should" be easy but it's being me crazy. the objective is to asign the result of a function to a variable that i can use later on a POST to send information to my MongoDB. I've a model with a document as: { "__v" : 0, "_id" : ObjectId("54ad1aa637ce5c566c13d18f"), "num" : 9 } What i want is to capture this number "num" : 9 to a variable. I created a function that query the mongodb through the model. function getNum(){ var Num = require('./models/num.js'); var callback = function(){ return function(err, data) { if(err) { console.log("error found: " + err); } console.log("the number is: " + data.num); } }; return Num.findOne({}, callback()); }; then just to test i assign that function to a variable and try to console.log it just to test if the result is fine. // ===================================== // TESTING ============================== // ===================================== app.get('/testing',function(req, res, next){ var a = getNum(); console.log(a); }); My output is: { _mongooseOptions: {}, mongooseCollection: { collection: { db: [Object], collectionName: 'num', internalHint: null, opts: {}, slaveOk: false, serializeFunctions: false, raw: false, pkFactory: [Object], serverCapabilities: undefined }, opts: { bufferCommands: true, capped: false }, name: 'num', conn: { base: [Object], collections: [Object], models: [Object], config: [Object], replica: false, hosts: null, host: 'localhost', port: 27017, user: undefined, pass: undefined, name: 'project', options: [Object], otherDbs: [], _readyState: 1, _closeCalled: false, _hasOpened: true, _listening: true, _events: {}, db: [Object] }, queue: [], buffer: false }, model: { [Function: model] base: { connections: [Object], plugins: [], models: [Object], modelSchemas: [Object], options: [Object] }, modelName: 'Num', model: [Function: model], db: { base: [Object], collections: [Object], models: [Object], config: [Object], replica: false,…
answer count: 1
linked to: http://stackoverflow.com/q/14220321
type: UnansweredQuestion
tagged with: node.js
type: Question
tagged with: mongodb
has title: NodeJS, Mongoose, return variable
tagged with: mongoose
tagged with: javascript

http://stackoverflow.com/comment/44226001
comment on: http://stackoverflow.com/q/27910121
score: 0
type: QuestionComment
has text: Can you explain "executing framework method instead of returning something" by posting code snippet?
type: Comment

http://stackoverflow.com/comment/44271298
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27936832
has text: @trying_hal9000 To achieve what you are trying to do, you need to make appropriate changes in the JS.

http://stackoverflow.com/q/27835448
has answer: http://stackoverflow.com/a/47057186
downvote count: 0
tagged with: keyboard
tagged with: click
favorite count: 0
upvote count: 9
has comment: http://stackoverflow.com/comment/80887771
linked to: http://stackoverflow.com/q/22895140
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/80894559
tagged with: android
linked to: http://stackoverflow.com/q/9703271
has answer: http://stackoverflow.com/a/47061407
has body: Is it possible to open keyboard on Android without click or touch event? For example just after appending textarea to some element? element.focus() works for me on iOS but not on Android.
answer count: 4
has comment: http://stackoverflow.com/comment/80903453
type: Question
has answer: http://stackoverflow.com/a/47029643
tagged with: javascript
has title: How to open keyboard on Android by javascript without click or touch event?
has comment: http://stackoverflow.com/comment/80963225
has answer: http://stackoverflow.com/a/27836245
linked to: http://stackoverflow.com/q/6837543
score: 9
tagged with: touch

http://stackoverflow.com/q/27955059
has comment: http://stackoverflow.com/comment/44306222
has body: I tried to have a setTimeout function on multiple li items which have ul and li again. The slide animation works fine, but I want to have a delay before closing slideUp again. But it doesn´t work. The slide goes down but not up again. I think it is because I have to have a indexed setTimeout function for every li ul (indexed). But I have no idea how to get it work. Can anyone point me in the right direction please? Thanks! var menu = $('#menu').find('li').has('ul'); var timer; menu.on('mouseenter', function(){ clearTimeout(timer); $(this).find('&gt;ul').stop().slideDown(); }); menu.on('mouseleave', function(){ clearTimeout(timer); timer = setTimeout(function() { $(this).find('&gt;ul').stop().slideUp(); },1000); });
score: 0
has title: setTimeout with multiple items
answer count: 1
has answer: http://stackoverflow.com/a/27955345
tagged with: timer
has comment: http://stackoverflow.com/comment/44305611
accepted answer: http://stackoverflow.com/a/27955345
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44111033
comment on: http://stackoverflow.com/a/27853455
has text: Someone? That was me, but I deleted my comment and made it an answer. Note that you don't need `.setAttribute()` to set the `src`, you can just say `.src = "something";`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27835002
has comment: http://stackoverflow.com/comment/44075205
score: 6
answers question: http://stackoverflow.com/q/27834961
has comment: http://stackoverflow.com/comment/44075111
has comment: http://stackoverflow.com/comment/44074940
has comment: http://stackoverflow.com/comment/44075179
has comment: http://stackoverflow.com/comment/95374209
upvote count: 7
has comment: http://stackoverflow.com/comment/44075563
downvote count: 1
has comment: http://stackoverflow.com/comment/44075064
type: Answer
has body: You can use the "toFixed" function to do that, e.g.: var num = 1.2345; var n = num.toFixed(1); You can combine this with a check to see if the number is an integer: function numToString(num) { if (num % 1 === 0) return num.toFixed(1); else return num.toString(); }
has comment: http://stackoverflow.com/comment/44075185
has comment: http://stackoverflow.com/comment/44075216

http://stackoverflow.com/comment/44024213
type: QuestionComment
comment on: http://stackoverflow.com/q/27805903
score: 0
has text: The push.php is the same file above. It serves both to show the push button and to handle the click. Should I seperate the php and html to 2 different files?
type: Comment

http://stackoverflow.com/a/27838754
type: Answer
answers question: http://stackoverflow.com/q/27838464
score: 0
has body: try this Choose Tracker Select Tracker

http://stackoverflow.com/comment/44208719
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27879241
has text: normal = border: 1px dotted #ccc,,, hover = border:1px dotted #aaa,,, onclick = border:1px solid #aaa,,,, onmouseleave = back to normal class.
score: 0

http://stackoverflow.com/comment/44074225
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27833702
has text: now It is working, thanks, But my need is that when I click any list it get unique Id and using that Id I have to fetch the data and put that information into separate page Which has like name of Hotel ,price , image of rooms, and all other information, That page design will be same for every hotel and It will have id for every element like for price, image of room so I have to just assign new fetch value..
type: AnswerComment

http://stackoverflow.com/comment/44317052
type: Comment
has text: Now in response I get html page code with empty body part. How can I fix it? Will your answer fix it?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27961315

http://stackoverflow.com/q/27961958
has answer: http://stackoverflow.com/a/28009188
downvote count: 0
tagged with: javascript
tagged with: angular-ui-bootstrap
has title: Angular write into nested scope properties
tagged with: angularjs
answer count: 3
has body: I have multiple "input field and a button" couples in my app. The button opens up a dialog to write something into the text field. [ input ] [ button ] ---&gt; [ dialog ( ok ) ( cancel ) ] I've used Bootstrap.UI.Modal ( https://angular-ui.github.io/bootstrap/#/modal ) so I have a promise to deal with it: //html &lt;input ng-model="foo"/&gt; &lt;button ng-click="dialog('foo')"&gt; Open &lt;/button&gt; //controller modalInstance.result.then( function ( selectedItem ) { $scope[ arg ] = selectedItem; }, ... ); Everything works okay. ( Demo ) The problem comes when I have to access nested properties of my scope objects: ... &lt;input ng-model="foo"/&gt; &lt;button ng-click="dialog('foo')"&gt; Open &lt;/button&gt; ... &lt;li ng-repeat="thing in model.nested.properties.of.unknown.level"&gt; ... &lt;input ng-model="thing.foo"/&gt; &lt;button ng-click="dialog( '???' )"&gt; Open &lt;/button&gt; ... What I want to know is: what is the best approach to achieve that? Until now I tried: passing the scope variable into the returning callback, but it got only the value, not the reference; so the field would not be updated. resolve: { field: function() { return $scope[ field ]; } } passing an array of strings to recreate the scope hierarchy dialog( ["a","b","c"] ) --&gt; $scope[ "a" ][ "b" ][ "c" ] = output.value; preparing an object of callbacks like object = { "one": function(){ $scope.a.b.c = ... }, "two": function(){ $scope.d.e.f = ... }, ... // but this requires that I know in advance // how many level I will nest into the $scope } using the id of the input field, so you can write directly into the DOM (but as far as I know this is not a good approach in angularjs) $("#input-abc...").val( ... ) using eval (uungh...) I think that the first solution would be the best one, but how can I pass the reference of the nested scope element to my promise callback? There are some best practices to achieve this? Any suggestion?
favorite count: 0
has answer: http://stackoverflow.com/a/28025465
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/28023579
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/28025465
tagged with: angularjs-scope
possible better answer: http://stackoverflow.com/a/28009188

http://stackoverflow.com/q/27810112
type: UnansweredQuestion
tagged with: transparency
has answer: http://stackoverflow.com/a/27833322
has title: Transparent material with ThreeJS
type: Question
tagged with: three.js
has body: I have a mesh lambert material in threejs defined like this: new three.MeshLambertMaterial({ transparent: true, emissive: 0xffffff, map: texture, alphaTest: 0.1 }); We decided to turn alphaTest to 0.1 since that seemed to be the only way to actually make the material transparent. Otherwise the background color behind the material ends up being the clear color. The problem with the above technique is that we get an ugly grey line around the non-transparent portions. This texture represents text, which is even worse. Is there a better approach to make a transparent material that will just show the object behind it?
tagged with: textures
answer count: 1
score: 0
has comment: http://stackoverflow.com/comment/44160032
has comment: http://stackoverflow.com/comment/44059703
has comment: http://stackoverflow.com/comment/44050887
tagged with: javascript

http://stackoverflow.com/a/27934109
accepted answer of: http://stackoverflow.com/q/27905135
type: Answer
has comment: http://stackoverflow.com/comment/44517607
has body: I don't believe it can, no. That's the point of the plugins. Why don't you use the plugin?
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27905135

http://stackoverflow.com/q/27843253
type: AnsweredQuestion
has body: I am trying to do excluded UK postcode validator it works fine in Regex101. But fails in browser all results are false with both versions. var testArray = ["AB01 1AA", "DD02 2RE", "DG02 2RE", "EH02 2RE", "FK02 2RE", "G02 2RE", "HS02 2RE", "IV02 2RE", "KA02 2RE", "KW02 2RE", "KY02 2RE", "ML02 2RE", "PA02 2RE", "PH02 2RE", "TD02 2RE", "ZE02 2RE", "BT02 2RE", "GY02 2RE", "JE02 2RE", "IM02 2RE", "im11 2RE", "im21 2ee", "ZE022RE", "BT022RE", "GY022RE", "je022re"]; var x = /(AB|DD|DG|EH|FK|G|HS|IV|KA|KW|KY|ML|PA|PH|TD|ZE|BT|GY|JE|IM)[0-9]{2}[ ]?[0-9]([a-zA-Z]{2})/; var reg = RegExp('(AB|DD|DG|EH|FK|G|HS|IV|KA|KW|KY|ML|PA|PH|TD|ZE|BT|GY|JE|IM)[0-9]{2}[ ]?[0-9]([a-zA-Z]{2})','i'); for(var xx in testArray){ console.log(xx+' '+ reg.test(xx)+' '+x.test(xx));} Also jsfiddle. I must be missing something obvious here.
possible better answer: http://stackoverflow.com/a/27843412
accepted answer: http://stackoverflow.com/a/27843325
downvote count: 3
has answer: http://stackoverflow.com/a/27843412
type: Question
has comment: http://stackoverflow.com/comment/44090433
score: -2
tagged with: javascript
answer count: 3
tagged with: regex
has answer: http://stackoverflow.com/a/27843325
has comment: http://stackoverflow.com/comment/44090339
favorite count: 0
upvote count: 1
has title: UK excluded Postcode regex failing
has answer: http://stackoverflow.com/a/27843440

http://stackoverflow.com/comment/44106830
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27851371
has text: i've removed some of them now
score: 0

http://stackoverflow.com/comment/44261198
type: Comment
comment on: http://stackoverflow.com/q/27931610
score: 0
type: QuestionComment
has text: I'm starting to think Internet Explorer is the cause because none of these suggestions still work. Is there a way to do it other then event.KeyCode?

http://stackoverflow.com/a/27956710
score: 0
answers question: http://stackoverflow.com/q/27956592
type: Answer
has body: Change your ajax like this $.ajax({ type: "POST", async: "false", url: "chatResponse.php", data: datavar, success:function(){ update()} });

http://stackoverflow.com/comment/44046532
score: 0
type: Comment
has text: Yes, of course it does after you have called the _serializeArray_ and try to do it for value. But if your values are initially of type boolean or number, typeof will return "boolean" or "number".
type: AnswerComment
comment on: http://stackoverflow.com/a/27820245

http://stackoverflow.com/comment/44300537
type: AnswerComment
comment on: http://stackoverflow.com/a/27925949
type: Comment
has text: Sorry i haven't forgotten about this. I just haven't had time to look at it and code up a solution.
score: 0

http://stackoverflow.com/comment/44018633
type: QuestionComment
has text: yea i know that..so can you atleast tell me how to get example.co.in or example.com.ca from the above urls
comment on: http://stackoverflow.com/q/27804445
score: 0
type: Comment

http://stackoverflow.com/comment/44143022
type: Comment
type: QuestionComment
has text: The answer in the link you provided would not have helped me. However, should you feel I am wrong, then you are more than welcome to delete this post.
comment on: http://stackoverflow.com/q/27870131
score: 0

http://stackoverflow.com/a/38520400
downvote count: 1
type: Answer
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/27946652
has body: Learn More!

http://stackoverflow.com/q/27846960
has comment: http://stackoverflow.com/comment/44101673
type: Question
tagged with: testing
tagged with: chai
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
tagged with: request
has answer: http://stackoverflow.com/a/30976416
linked to: http://stackoverflow.com/q/11235815
score: 2
has body: The callback for request does not seem to get called and the test passes as a result. I presume this may have to do with it being an async call, but I am not sure how to resolve the issue. var expect = require('chai').expect var request = require('request'); describe('Test http', function(){ it('get', function(){ request('http://www.google.com', function (error, response, body) { throw new Error("test get") }) }) })
upvote count: 2
has title: Callback not called by request in chai tests
type: UnansweredQuestion

http://stackoverflow.com/q/27929769
has comment: http://stackoverflow.com/comment/45132609
type: Question
possible better answer: http://stackoverflow.com/a/28814689
answer count: 2
has comment: http://stackoverflow.com/comment/44534959
has answer: http://stackoverflow.com/a/28814689
has comment: http://stackoverflow.com/comment/44257384
has title: How to debug/analyze extremely long GC pauses in Node.js/V8
tagged with: javascript
has comment: http://stackoverflow.com/comment/44257594
accepted answer: http://stackoverflow.com/a/31078683
has comment: http://stackoverflow.com/comment/44338103
downvote count: 0
score: 23
favorite count: 0
has body: I am trying to analyze a memory/GC problem in a relatively complex Node.js server app. Even under very moderate load, it is becoming unresponsive for noticeable periods, and these pauses grow longer over time. Running with the --trace-gc parameter shows that extremely long garbage collection times are the likely cause: [4805] 537 ms: Mark-sweep 17.6 (46.4) -&gt; 10.3 (47.4) MB, 20 ms [allocation failure] [GC in old space requested]. [4805] 1338 ms: Mark-sweep 31.3 (58.4) -&gt; 19.2 (57.2) MB, 40 ms [allocation failure] [promotion limit reached]. [4805] 2662 ms: Mark-sweep 58.0 (79.2) -&gt; 43.9 (85.2) MB, 109 ms [Runtime::PerformGC] [promotion limit reached]. [4805] 4014 ms: Mark-sweep 90.1 (111.5) -&gt; 70.6 (113.9) MB, 114 ms [allocation failure] [promotion limit reached]. [4805] 7283 ms: Mark-sweep 129.7 (153.9) -&gt; 112.0 (158.9) MB, 511 ms [allocation failure] [promotion limit reached]. [4805] 10979 ms: Mark-sweep 184.6 (210.9) -&gt; 160.3 (212.9) MB, 422 ms [Runtime::PerformGC] [promotion limit reached]. [4805] 1146869 ms: Mark-sweep 243.8 (271.4) -&gt; 191.6 (267.9) MB, 1856 ms [allocation failure] [promotion limit reached]. [4805] 1731440 ms: Mark-sweep 282.1 (307.4) -&gt; 197.5 (298.9) MB, 1 / 11230 ms [allocation failure] [promotion limit reached]. [4805] 2024385 ms: Mark-sweep 291.0 (320.8) -&gt; 197.3 (306.9) MB, 9076 ms [Runtime::PerformGC] [promotion limit reached]. [4805] 2623396 ms: Mark-sweep 290.9 (317.1) -&gt; 196.9 (311.9) MB, 1 / 15401 ms [allocation failure] [promotion limit reached]. [4805] 3223769 ms: Mark-sweep 291.4 (323.6) -&gt; 187.8 (318.9) MB, 1 / 13385 ms [allocation failure] [promotion limit reached]. [4805] 4225777 ms: Mark-sweep 280.1 (324.2) -&gt; 190.6 (315.9) MB, 1 / 13266 ms [allocation failure] [promotion limit reached]. [4805] 4705442 ms: Mark-sweep 286.2 (321.4) -&gt; 195.2 (314.9) MB, 1 / 17256 ms [Runtime::PerformGC] [promotion limit reached]. [4805] 5225595 ms: Mark-sweep 288.3 (324.0) -&gt; 201.7 (316.9) MB, 1 / 22266 ms…
has comment: http://stackoverflow.com/comment/44412995
has comment: http://stackoverflow.com/comment/44293586
tagged with: memory-leaks
tagged with: garbage-collection
upvote count: 23
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31078683
tagged with: v8

http://stackoverflow.com/q/27939192
favorite count: 0
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44274769
has comment: http://stackoverflow.com/comment/44274803
accepted answer: http://stackoverflow.com/a/27939225
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44274901
score: 1
has comment: http://stackoverflow.com/comment/44276744
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44275069
has title: JQuery code working properly in jsfiddle but not in browser even with $(window).load(function())
tagged with: javascript
tagged with: jquery
has body: So I'm trying to make a search using a dropdown list, which will show/hide some checkboxes depending on the chosen answer. The problem is that it works perfectly on jsfiddle.net but refuses to load properly on my local machine. I saw a similar post and said something about adding $(window).load(function()) before the rest of the script, but even then it refused to work. I might be doing something wrong so any help is appreciated. The link for jsfiddle is this: http://jsfiddle.net/CDyZf/66/ &lt;html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(window).load(function()); $('.drop-down-show-hide').hide(); $('#dropDown').change(function () { $(this).find("option").each(function () { $('#' + this.value).hide(); }); $('#' + this.value).show(); }); &lt;/script&gt;
has answer: http://stackoverflow.com/a/27939225
answer count: 1

http://stackoverflow.com/q/27809577
has title: How to remove an item from an object
has comment: http://stackoverflow.com/comment/44028186
type: Question
has body: I have: var map = {}; map["S"] = "s"; map["C"] = "c"; map["D"] = "d"; How can I fully remove item map["S"]? I don't want to end up with a null object so using delete map["S"] wouldn't work.
answer count: 1
has answer: http://stackoverflow.com/a/27809732
downvote count: 0
tagged with: javascript
score: 25
favorite count: 0
upvote count: 25
accepted answer: http://stackoverflow.com/a/27809732
has comment: http://stackoverflow.com/comment/44028287
type: AnsweredQuestion

http://stackoverflow.com/comment/44048212
comment on: http://stackoverflow.com/a/27820946
type: Comment
type: AnswerComment
has text: Thanks. Problem solved. Just what I need. Thank you mate. Quick question, can you do the same as the Lucas sequence?
score: 0

http://stackoverflow.com/comment/44216453
comment on: http://stackoverflow.com/a/27877013
type: Comment
score: 0
has text: Thank you so much for this! I guess what I did wrong was == "1").
type: AnswerComment

http://stackoverflow.com/comment/44118789
type: Comment
type: QuestionComment
has text: @nnnnnn - It's the unadulterated version, obviously !
score: 2
comment on: http://stackoverflow.com/q/27857999

http://stackoverflow.com/q/27896936
answer count: 3
linked to: http://stackoverflow.com/q/3966936
has title: Adding Methods to array prototype so i can apply it to array object.But it is giving an error TypeError: Array.method is not a function
tagged with: javascript
has answer: http://stackoverflow.com/a/43729683
possible better answer: http://stackoverflow.com/a/38540815
tagged with: prototype
has answer: http://stackoverflow.com/a/38540815
has answer: http://stackoverflow.com/a/27897432
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I am trying add a method to Array prototype.But it is giving me an error TypeError: Array.method is not a function I am trying this example from JavaScript: The Good Parts. Here is a piece of my code. Array.method('reduce',function(f,value){ var i; for(i=0; i &lt; this.length; i+1){ value = f(this[i],value); } return value; }); var data = [1,3,2,4,5,6,7,8,9]; var add = function(value1, value2){ return value1 + value2; } var result = data.reduce(add, 0); console.log(result); I want to apply the reduce method to data array. So i can do addition ,multiplication on array and return the result.
favorite count: 0
accepted answer: http://stackoverflow.com/a/27897432
type: Question
upvote count: 1

http://stackoverflow.com/q/27824200
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44055939
has title: Unable to use jQuery UI on my Rails project
has body: Currently I'm using Rails 4 with gem 'jquery-ui-rails', everything seems to be working properly , I have included all necessary depedencies in my application.js //= require jquery //= require jquery_ujs //= require jquery-ui and also in application.css *= require jquery-ui There is no error message, but I'm unable to use any jQuery UI components even running a simple jQuery command which alert(jQuery.ui) got evaluated to 'undefined'. The weird part is that I can see every jQuery UI javascript files in the header of the rendered HTML page but it seems that I can't use any of them. However I created a new clean Rails project and did the same as above but everything works fine. What should I do with this ?
score: 0
answer count: 0
type: UnansweredQuestion
tagged with: ruby-on-rails
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/44071333

http://stackoverflow.com/comment/44131107
score: 0
type: Comment
type: QuestionComment
has text: Ok guys @HiroakiMachida @benjaminjosephw . First thank you for take your time for help me ;) I try to answer all: 1. Where can I check properly these header of request? 2. The subdomains (without, neither www) and protocols (unsafe) are the same all time. 3. I'm printing `document.cookie`, is this enough? Hope it helps!
comment on: http://stackoverflow.com/q/27863114

http://stackoverflow.com/a/27932028
type: Answer
score: 1
answers question: http://stackoverflow.com/q/27931965
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27931965
type: AcceptedAnswer
downvote count: 0
has body: For that, you would need to implement some javascript. I suggest something like Masonry.js

http://stackoverflow.com/comment/44274952
has text: Is the comma in the price a thousands separator or a decimal point?
comment on: http://stackoverflow.com/q/27939142
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27804627
score: 0
accepted answer: http://stackoverflow.com/a/27855630
answer count: 1
tagged with: javascript
tagged with: deployd
type: AnsweredQuestion
tagged with: nobackend
has answer: http://stackoverflow.com/a/27855630
type: Question
has body: I've installed latest version of Deployd on Windows 7 64 Bit. Everything works fine except, I cannot query a single object. ie, if i use the following code, var query ={"name":"Jack","empid":"10"}; dpd.employees.first(query, function (result) { console.log(result); }); I'm getting TypeError: undefined is not a function at the console (Google Chrome) pointing to the function 'first()'. All other functions generated at the API tab of Dashboard are working fine without any issues. I've tried reinstalling Deployd to another directory &amp; the issue is still there. Haven't tried on a different machine yet. What might be the cause? Any help is appreciated.
tagged with: node.js
has title: Deployd App, dpd.collection.first() not working

http://stackoverflow.com/comment/44304195
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27954553
has text: Yeah, that's my solution now. By I want to customize the shape and location of the sensor.
score: 0

http://stackoverflow.com/comment/44219188
type: Comment
type: QuestionComment
has text: Thanks I used callbacks and its working, thanks.
comment on: http://stackoverflow.com/q/27909246
score: 0

http://stackoverflow.com/comment/49182597
type: AnswerComment
comment on: http://stackoverflow.com/a/27932569
type: Comment
has text: Ok. I have visited your jsfiddle page and I found out the addtoolbar method. I think it will work. Although I could not run that jsfiddle page. Don't know how to run it.
score: 0

http://stackoverflow.com/q/27867867
has comment: http://stackoverflow.com/comment/44138245
has title: Can't use jquery after loading it dynamically
type: Question
has comment: http://stackoverflow.com/comment/44138235
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44138217
has comment: http://stackoverflow.com/comment/44138213
has answer: http://stackoverflow.com/a/27868018
has comment: http://stackoverflow.com/comment/44138231
has body: I'm loading data.js into my a.html page. In my data.js, i am checking if a.html has jquery and loading it if not. Right after loading jquery i am making an ajax call but i am getting $ is not defined exception. Here is my data.js if(typeof jQuery=='undefined') { var headTag = document.getElementsByTagName("head")[0]; var jqTag = document.createElement('script'); jqTag.type = 'text/javascript'; jqTag.src = 'http://localhost:8001/jquery-min.js'; headTag.appendChild(jqTag); } var url = 'http://127.0.0.1:5000'; $.ajax({ url: url, success: function(data) { $("#" + containerId).html(data); }, error: function(e) { console.log(e.message); } }); From developer console, i can see jquery is loaded. I can see it in both Resources and head tag.
tagged with: jquery
has answer: http://stackoverflow.com/a/27867946
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44138393
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44269684
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27936229
has text: how about [`one`](http://api.jquery.com/one/) method in jquery??

http://stackoverflow.com/a/27889148
downvote count: 0
answers question: http://stackoverflow.com/q/27888471
has comment: http://stackoverflow.com/comment/44179279
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44181587
has body: Just a timing test as @Bergi suggested: function initCache(url) { var xhr = new XMLHttpRequest(); xhr.open("get", url); xhr.send(); console.log("Initialized cache"); } function reuseXhr(url, numLoops) { var xhr = new XMLHttpRequest(); for (var i=0; i&lt;numLoops; i++) { xhr.open("get", url); xhr.send(); } xhr.abort(); } function newXhr(url, numLoops) { var xhr; for (var i=0; i&lt;numLoops; i++) { xhr = new XMLHttpRequest(); xhr.open("get", url); xhr.send(); xhr.abort(); } } function testIt() { var url = "http://urlwithcors.com/"; // Pseudo-URL with CORS enabled var numLoops = 1000; initCache(url); setTimeout(function(){ console.time("reuse"); reuseXhr(url, numLoops); console.timeEnd("reuse"); console.time("new"); newXhr(url, numLoops); console.timeEnd("new"); }, 5000); } testIt(); The result here, in Chrome, is: test-xhr-reuse.js:6 XHR finished loading: GET ... reuse: 510.000ms new: 386.000ms So... 0.1 ms per call on a slow pc, it is not worth the trouble... Now wait - it is even slower to reuse xhr... Not worth it. ;-) A bit more testing tells there is no difference at all. It is just a matter of chance.

http://stackoverflow.com/comment/44173419
has text: The way regex works is that it tries to match something, then when the g flag is set, it starts behind the first match. In your case it starts again behind `YYY_1_YYY` and obviously there is no match there. May I ask what the underlying problem is you are trying to solve?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27886099

http://stackoverflow.com/a/27948579
type: Answer
has body: If the loading graphic is global, then you can solve this using an httpInterceptor. This is a naive implementation of an interceptor that toggles $rootScope.loading: angular.module('myModule').factory('LoadingInterceptor', function ($rootScope) { $rootScope.loading = false; return { request: function (config) { $rootScope.loading = true; return config; }, response: function (response) { $rootScope.loading = false; return response; } }; }) .config(function ($httpProvider) { $httpProvider.interceptors.push('LoadingInterceptor'); }); Note: You may encounter issues with this naive implementation. For example you may have parallel XHR calls (and this implementation will cause the loader to flash). This is because when the first call response occurs $rootScope.loading is set back to false (even when the second call is still in progress).
accepted answer of: http://stackoverflow.com/q/27947844
score: 1
answers question: http://stackoverflow.com/q/27947844
upvote count: 1
type: AcceptedAnswer
downvote count: 0

date
tags question: http://stackoverflow.com/q/27935267
tags question: http://stackoverflow.com/q/27846865
tags question: http://stackoverflow.com/q/27869606
tag name: date
tags question: http://stackoverflow.com/q/27963268
tags question: http://stackoverflow.com/q/27900943
tags question: http://stackoverflow.com/q/27809224
tags question: http://stackoverflow.com/q/27931432
tags question: http://stackoverflow.com/q/27944108
tags question: http://stackoverflow.com/q/27894734
tags question: http://stackoverflow.com/q/27954374
tags question: http://stackoverflow.com/q/27935096
tags question: http://stackoverflow.com/q/27876220
tags question: http://stackoverflow.com/q/27854620
tags question: http://stackoverflow.com/q/27834606
type: Tag
tags question: http://stackoverflow.com/q/27921459
tags question: http://stackoverflow.com/q/27810136
tags question: http://stackoverflow.com/q/27951204
tags question: http://stackoverflow.com/q/27847752
tags question: http://stackoverflow.com/q/27883478
tags question: http://stackoverflow.com/q/27857058
tags question: http://stackoverflow.com/q/27951910
tags question: http://stackoverflow.com/q/27868600
tags question: http://stackoverflow.com/q/27953474
tags question: http://stackoverflow.com/q/27927668
tags question: http://stackoverflow.com/q/27957376
tags question: http://stackoverflow.com/q/27895490
tags question: http://stackoverflow.com/q/27929490
tags question: http://stackoverflow.com/q/27844502

http://stackoverflow.com/comment/44255915
has text: Yes and in your dragging: `d.x0 += d3.event.dy; d.y0 += d3.event.dx; node.attr("transform", "translate(" + d.y0 + "," + d.x0 + ")");`, ys being added to xs, translations are backwards. Now, suddenly your paths don't map correctly, don't you think this is the root cause? What are you really trying to accomplish?
comment on: http://stackoverflow.com/q/27920920
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27942375
accepted answer of: http://stackoverflow.com/q/27942264
has comment: http://stackoverflow.com/comment/44282534
answers question: http://stackoverflow.com/q/27942264
type: AcceptedAnswer
has body: Using the complete function of jQuery events should do the trick: $('#content_1').hide(10, function() { $('#content_2').css({'visibility': 'hidden'}).show(10, function() { window.scrollTo(0,100); $('#content_2').css({'visibility': 'visible'}); }); });
score: 0
has comment: http://stackoverflow.com/comment/44281760
type: Answer
has comment: http://stackoverflow.com/comment/44283248
has comment: http://stackoverflow.com/comment/44283877

http://stackoverflow.com/q/27880276
tagged with: mongodb
answer count: 2
has answer: http://stackoverflow.com/a/27880353
accepted answer: http://stackoverflow.com/a/27880353
tagged with: javascript
tagged with: express
possible better answer: http://stackoverflow.com/a/27880360
score: 0
has title: How to have a unique url for every user
upvote count: 1
downvote count: 1
has body: New code for routes.js and login.ejs: `module.exports = function(app, passport) { // ===================================== // HOME PAGE (with login links) ======== // ===================================== app.get('/', function(req, res) { res.render('./pages/index.ejs'); // load the index.ejs file }); // ===================================== // LOGIN =============================== // ===================================== app.get('/login', function(req, res) { // render the page and pass in any flash data if it exists res.render('./pages/login.ejs', { message: req.flash('error') }); }); // process the login form app.post('/login', passport.authenticate('local-login', { successRedirect : '/profile', // redirect to the secure profile section failureRedirect : '/login', // redirect back to the signup page if there is an error failureFlash : true })); // ===================================== // SIGNUP ============================== // ===================================== app.get('/signup', function(req, res) { // render the page and pass in any flash data if it exists res.render('./pages/signup.ejs', { message: req.flash('signupMessage') }); }); // process the signup form app.post('/signup', passport.authenticate('local-signup', { successRedirect : '/profile', // redirect to the secure profile section failureRedirect : '/signup', // redirect back to the signup page if there is an error failureFlash : true // allow flash messages })); // ===================================== // 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/:id', isLoggedIn, function (req, res) { var id = req.params.id; res.send('./pages/profile.ejs' + req.params.id); }); // ===================================== // LOGOUT ============================== // ===================================== app.get('/logout', …
favorite count: 0
has answer: http://stackoverflow.com/a/27880360
tagged with: node.js
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/27934994
favorite count: 0
tagged with: universal-analytics
downvote count: 0
type: UnansweredQuestion
score: 1
tagged with: google-analytics-api
tagged with: google-analytics
has title: How can I get GA utm parameters in a secondary page in user's session
has answer: http://stackoverflow.com/a/27954262
type: Question
has body: I am using GA universal analytics. I want to get the utm_content parameter of the user, that had come to my page with some. But I want it to get it in any page user visit in that session. I just thought about reading cookie, but the data is hashed and I understood that Google did not want that way. Some analysis on cookie can I do it by any API method in Analytics.js or with any other solution?
upvote count: 1
has comment: http://stackoverflow.com/comment/44274199
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44342643
type: AnswerComment
has text: i do not know i try to add a sniplet if i can figuer it out again
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27971839

http://stackoverflow.com/a/27931493
score: 8
downvote count: 0
answers question: http://stackoverflow.com/q/27930780
has body: You could load the URL in a hidden iframe. Then use iframe.contentWindow.document.getElementById($id) as outlined here: How to pick element inside iframe using document.getElementById Something along the lines of: &lt;iframe src="urlWithinYourDomain.html" style="display:none"&gt;&lt;/iframe&gt; Followed by a function something like: var divElement = document.getElementById('iframeId').contentWindow.document.getElementById('elementIdOnSourcePage'); document.getElementById('targetParentId').appendChild(divElement); I'm afraid I can't test this at the moment, so there may be syntax errors, but I think it conveys the idea. It's a bit of a dirty approach, but given your constraints it's the best way I can see to do what you're asking.
upvote count: 8
type: Answer

http://stackoverflow.com/comment/44192309
has text: I see. I have updated the jsfiddle, http://jsfiddle.net/2dot1geo/1/, but still it doesn't update the date without refreshing browser.
comment on: http://stackoverflow.com/q/27895490
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44148868
type: QuestionComment
has text: I'm confused you went from changing values to changing colors to make things faster?
comment on: http://stackoverflow.com/q/27872656
score: 1
type: Comment

http://stackoverflow.com/comment/44034741
score: 0
type: AnswerComment
has text: there was a jquery file i comment it..then it worked!!!
type: Comment
comment on: http://stackoverflow.com/a/27812827

http://stackoverflow.com/comment/44052209
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27822822
type: AnswerComment
has text: It will, and you don't. Why would your users want to let you hijack their browser?

http://stackoverflow.com/q/27888647
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27888697
type: Question
has comment: http://stackoverflow.com/comment/44178234
answer count: 1
tagged with: javascript
has body: Heya stackoverflowers, I've got a simple newbie question.. I'm working right now for a project, for a school where children can learn mathematics(tables).. My problem is: When the input field is not filled in and the user is filling anything in in the table for the questions, a prompt box appears with: Vul je naam goed in!(Which means fill your name correctly!) So When they fill it in, in the prompt, I can store the value of it, but I can't maintain it to appear it in the text box.. Here's my code: The HTML5: Wat is je naam? The Javascript I am using for onchange and other functions: function naamCheck(){ if(naam == null || naam == "" || naam == " "){ naam = prompt("Vul je naam hier goed in!"); } } and the naam variable is a global variable which I stored like this: // GLOBALE VARIABELEN var naam = document.getElementById('naams').value; I'd like to get some help with this newbie question:-) Thanks in advance!
score: 0
accepted answer: http://stackoverflow.com/a/27888697
has title: Prompt value in the input text field
has comment: http://stackoverflow.com/comment/44178265

http://stackoverflow.com/comment/44113000
comment on: http://stackoverflow.com/a/27844921
has text: No @Gareth,when i click on column it becomes editable and onblur it should validate
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27978225
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27961768
has body: The default behaviour of Firefox browser is to remember the form's input value. I think in your case, you may use some JavaScript which reset the form automatically, which makes lost the state that the browser remembered.

http://stackoverflow.com/q/27857297
has comment: http://stackoverflow.com/comment/44117964
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27858283
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27858313
tagged with: highcharts
tagged with: javascript
upvote count: 1
has title: Highcharts custom xAxis label
has comment: http://stackoverflow.com/comment/44118031
has comment: http://stackoverflow.com/comment/44118043
has comment: http://stackoverflow.com/comment/44117810
favorite count: 0
has body: what I need is grouped xAxis label. I created a fiddle: http://jsfiddle.net/9nhk544b In that fiddle, I use category like: foo1, foo2, foo3, bar1, bar2... so on. What I need is 2 line xAxis label like: y| | | |___________________________________________ 1 2 3 1 2 3 1 2 3 foo bar baz I've googled for days and still get nothing, is that even possible ? is there any trick to get it done ? Thanks.
has comment: http://stackoverflow.com/comment/44117708
downvote count: 0
has answer: http://stackoverflow.com/a/27858313
accepted answer: http://stackoverflow.com/a/27858283

http://stackoverflow.com/a/27853455
has comment: http://stackoverflow.com/comment/44111033
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27853242
has body: Someone tipped me off to querySelector. My code now does what it needs to do. My final code: &lt;div&gt; &lt;h1 onclick="(function() { if(this.nextElementSibling.style.display !== 'none'){ this.nextElementSibling.style.display = 'none'; this.querySelector('img').setAttribute('src','r_arrow.png'); console.log(this.nextElementSibling.nodeName); console.log(this.firstChild.nodeName); }else{ this.nextElementSibling.style.display = 'block'; this.querySelector('img').setAttribute('src','d_arrow.png'); } }).call(this);"&gt;&amp;nbsp;&lt;img src="r_arrow.png" /&gt;Click&lt;/h1&gt; &lt;div style="display:none; border:solid 1px red;"&gt; Some hidden content &lt;/div&gt; &lt;/div&gt;

http://stackoverflow.com/q/27828688
has answer: http://stackoverflow.com/a/27828731
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44064210
has comment: http://stackoverflow.com/comment/44063722
has answer: http://stackoverflow.com/a/27828852
has title: Why does this function take up a lot of memory overtime
has comment: http://stackoverflow.com/comment/44064314
accepted answer: http://stackoverflow.com/a/27828852
type: Question
has comment: http://stackoverflow.com/comment/44063338
has comment: http://stackoverflow.com/comment/44063930
tagged with: javascript
has comment: http://stackoverflow.com/comment/44063442
has comment: http://stackoverflow.com/comment/44063410
has comment: http://stackoverflow.com/comment/44063344
has comment: http://stackoverflow.com/comment/44063756
score: 0
answer count: 2
has body: I'm trying to understand why does this small function after a reaches around almost 200,000 under about:memory tab it says that the devtools's total memory is: 1079408k? can someone explain why? var a = 0; (function loop(){ a++; console.count(); call = setTimeout(loop); })()
has comment: http://stackoverflow.com/comment/44063704
has comment: http://stackoverflow.com/comment/44063335
has comment: http://stackoverflow.com/comment/44063358
has comment: http://stackoverflow.com/comment/44063478
has comment: http://stackoverflow.com/comment/44064042
has comment: http://stackoverflow.com/comment/44063398
has comment: http://stackoverflow.com/comment/44063671
has comment: http://stackoverflow.com/comment/44063624
possible better answer: http://stackoverflow.com/a/27828731

http://stackoverflow.com/comment/44196432
type: Comment
type: QuestionComment
has text: Would it be okay if I were to reprogram some portions of your code? In it's current state, it would be messy to change too much.
comment on: http://stackoverflow.com/q/27898038
score: 0

http://stackoverflow.com/comment/44210925
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27905806
has text: Yes it is different this is just an example
score: 0

http://stackoverflow.com/q/27928063
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44253216
has comment: http://stackoverflow.com/comment/44253214
has comment: http://stackoverflow.com/comment/44254996
has answer: http://stackoverflow.com/a/27928534
has answer: http://stackoverflow.com/a/27928132
has body: Recently, I saw an if/else block like this in Javascript - although the same question could apply to any imperative language if (cond) { .... } else if (!cond) { .... } Question: what is the purpose of if (!cond) after else? If there is no other possibility, why shouldn't I just use else by itself? My opinion is that the if (!cond) is redundant and should be eliminated, and I'm looking for pointers to documentation to substantiate that.
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44253269
has answer: http://stackoverflow.com/a/27928627
tagged with: javascript
has title: Using "else if" instead of "else" when there is no other possibility
answer count: 6
has answer: http://stackoverflow.com/a/27928095
score: 0
has answer: http://stackoverflow.com/a/27928114
has answer: http://stackoverflow.com/a/27928133
has comment: http://stackoverflow.com/comment/44253266
favorite count: 0

http://stackoverflow.com/q/27822673
has comment: http://stackoverflow.com/comment/44051364
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44051391
has title: Getting selected value for radio button
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/27822900
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has body: Red color Click the "Try it" button to display the value of the value attribute of the radio button. Try it Basic example of getting value from radio button from w3schools. In the above example I need to get the display value. for eg., I need Red color not the value red. Example here
has comment: http://stackoverflow.com/comment/44051717
has comment: http://stackoverflow.com/comment/44051152
has comment: http://stackoverflow.com/comment/44051260
has answer: http://stackoverflow.com/a/27822870
has answer: http://stackoverflow.com/a/27823004
has comment: http://stackoverflow.com/comment/44051117
score: 1
has comment: http://stackoverflow.com/comment/44051446
has comment: http://stackoverflow.com/comment/44051339

file
type: Tag
tags question: http://stackoverflow.com/q/27902675
tag name: file
tags question: http://stackoverflow.com/q/27831639
tags question: http://stackoverflow.com/q/27869356
tags question: http://stackoverflow.com/q/27911678

http://stackoverflow.com/a/27843227
accepted answer of: http://stackoverflow.com/q/27842010
downvote count: 0
answers question: http://stackoverflow.com/q/27842010
score: 1
upvote count: 1
type: AcceptedAnswer
has body: omg, I found the error, and I cant find an explanation on this, hopefully somebody at Microsoft can tell me. this line: var termStore = termStores.getByName("Taxonomy_kl5tZjInn7STsFTzIE7n3Q=="); We noticed the name is now different, it has a different guid, but we as customers cant change that name, so the only reason is Microsoft changed it for us because it was working on monday. Update: I changed that line with: termStore = session.getDefaultSiteCollectionTermStore(); to avoid that it happens in the future.
type: Answer

http://stackoverflow.com/comment/44163716
score: 2
has text: May be a duplicate of a previous question, see my answer here : http://stackoverflow.com/questions/25940806/meteor-synchronizing-multiple-async-queries-before-returning/25941287#25941287
type: Comment
comment on: http://stackoverflow.com/q/27879745
type: QuestionComment

http://stackoverflow.com/comment/44321714
type: Comment
type: QuestionComment
has text: @iH8 I want to keep the Leaflet map & the overlay separate as much as possible - in case I might wish to change the map library or reuse the overlay for other purposes.
comment on: http://stackoverflow.com/q/27962996
score: 0

http://stackoverflow.com/q/27859671
has answer: http://stackoverflow.com/a/27859971
accepted answer: http://stackoverflow.com/a/27859971
has body: My script: <?php //header("refresh: 7;"); include 'theme.php'; ceklogin(); css(); echo ' '; exec('/www/openvpn_wget_status.sh'); echo ' '; echo file_get_contents( "/www/openvpn_status.txt" ); echo ' '; //include 'wget.log'; //echo " "; //$datalines = file ("wget.log"); //foreach ($datalines as $zz) { //echo $zz; } echo ' '; //echo " "; echo ' '; foot(); echo ' '; ?> it works perfectly but what if I want the variable from a log file in my webserver, let's say the name of the log file is wget.log and I want to refresh it every 3 seconds since wget.log keeps changing as I run wget to download files?
has comment: http://stackoverflow.com/comment/44121844
has title: Javascript - How to load variable from a file and refresh it every 3 seconds?
tagged with: php
has comment: http://stackoverflow.com/comment/44123097
linked to: http://stackoverflow.com/q/1102229
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/44122210
type: Question
downvote count: 2
has comment: http://stackoverflow.com/comment/44121919
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44122295
has comment: http://stackoverflow.com/comment/44121812
favorite count: 0
has comment: http://stackoverflow.com/comment/44121964
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44121884

http://stackoverflow.com/a/27947871
upvote count: 1
has body: This is a pretty simple task. You want to match either admin or user, then a number. For that, you can do: /(user|admin)-(\d+)/ Then using backreferences you can replace the matched string with a link. Something like this: str = str.replace(/(user|admin)-(\d+)/g, '&lt;a href="$1/$2"&gt;$&amp;&lt;/a&gt;');
answers question: http://stackoverflow.com/q/27947663
has comment: http://stackoverflow.com/comment/44302212
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44301957
has comment: http://stackoverflow.com/comment/44302016
type: Answer

http://stackoverflow.com/comment/44129245
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27861755
has text: I have keyboard layout as an option, allowing users to override whatever "best guess" I make. I don't care so much about that issue so long as the app does the correct thing once the right keyboard layout is specified. As for capturing the charCode in the keyPress event, I'll save that as a last resort. I do have such a surrogate textarea already, to make the soft-keyboard on mobile pop up. But my thoughts are that full, proper support will create a more robust app. It would be the same essential framework necessary for a robust keyboard shortcut system ala Emacs or Vi.

http://stackoverflow.com/comment/44249652
type: Comment
type: QuestionComment
has text: I do know all the fields, but I wanted to do it in one loop instead of using two for performance reasons.
score: 0
comment on: http://stackoverflow.com/q/27926171

http://stackoverflow.com/comment/44066994
has text: In my example, index.js could be the test rig, built with browserify. From there you can access all of the exports of each module.
type: AnswerComment
comment on: http://stackoverflow.com/a/27829101
score: 0
type: Comment

http://stackoverflow.com/a/27915048
has body: According to your sceenshots the page is delivered with the Content-type: text/plain header. This leads chrome to display it in a pre tag as it assumes you want to view the HTML as text. Your webserver needs to write a proper Content-type header. An example of how to write headers using the arduino ethernet shield can be found here. Contrary to the code linked above, you should determine the content-type dynamically, using something like the file extension. So that images are transferred with the correct content-type(for example image/jpg) aswell.
type: Answer
accepted answer of: http://stackoverflow.com/q/27914693
upvote count: 9
answers question: http://stackoverflow.com/q/27914693
score: 9
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44097679
type: Comment
score: 0
type: AnswerComment
has text: ADd some css to it, e.g. min-width:100px or sth
comment on: http://stackoverflow.com/a/27837012

http://stackoverflow.com/a/27894771
score: 0
type: Answer
has body: host your whole folder of code on server.Currently what happening is.you are running the .html file directly from folder without hosting.thats why when you tried to access the js file from html,the protocol is showing as file:// instead of htttp:// you can run the same page on Internet Explorer, this will get run properly. Chrome has some security policies. That is the reason why it is not running on it.
has comment: http://stackoverflow.com/comment/52070313
answers question: http://stackoverflow.com/q/27894353

http://stackoverflow.com/a/27885573
has comment: http://stackoverflow.com/comment/44175100
answers question: http://stackoverflow.com/q/27885542
type: Answer
has comment: http://stackoverflow.com/comment/44172374
accepted answer of: http://stackoverflow.com/q/27885542
has comment: http://stackoverflow.com/comment/44175473
has comment: http://stackoverflow.com/comment/44174993
has comment: http://stackoverflow.com/comment/44174900
score: 0
has comment: http://stackoverflow.com/comment/44174962
type: AcceptedAnswer
has body: so what you're trying to do is call a function inside an ng-repeat to modify the data of one element. I have a demo that shows, in principle, what you're trying to do. I hope this helps you solve your problem. Check out this plunkr: http://plnkr.co/edit/cfNGnx5eNXTuirCduWaG?p=preview Template: Hello {{name}}! {{elem.id}} {{elem.count}} increment {{elem.id}} Here's the controller var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { $scope.data = [ {id: 'a', count: 0}, {id: 'b', count: 0}, {id: 'c', count: 0} ] $scope.increment = function(at) { $scope.data[at].count += 1; } });
has comment: http://stackoverflow.com/comment/44174888

http://stackoverflow.com/comment/44218184
has text: Glad I could help, I've updated the answer to show the solution, cheers!
type: AnswerComment
comment on: http://stackoverflow.com/a/27852845
score: 0
type: Comment

http://stackoverflow.com/comment/44108557
type: QuestionComment
has text: Stop changing posted code so much: SO should not be used as a "live debugger" and there are better ways to analyze a problem.
comment on: http://stackoverflow.com/q/27852016
score: 0
type: Comment

http://stackoverflow.com/a/27886939
accepted answer of: http://stackoverflow.com/q/27886912
has body: Try to use setAttribute tbl.setAttribute('class', 'table') Or you can use .classList const app = document.getElementById('app'); document.getElementById('button').addEventListener('click', () => { const tbl = document.createElement('table'); tbl.classList.add('class') app.appendChild(tbl) }) .class { border: 1px solid red; height: 100px; width: 100px; } Add
downvote count: 0
type: AcceptedAnswer
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27886912
score: 1

http://stackoverflow.com/comment/44089184
has text: My console issue is persistent across tabs/new windows. It's actually very obnoxious. Also, I'm not sure if this necessarily is the correct answer, but I'll mark it for now since you did produce a way of logging that string to the console. Anyone know how I can reset my console though? Still getting "Console was cleared" and nothing being cleared!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27830948

http://stackoverflow.com/q/27852429
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27852487
downvote count: 0
type: Question
score: 5
tagged with: javascript
answer count: 3
has title: Regex - Extract digits from a url
favorite count: 0
has answer: http://stackoverflow.com/a/27852446
possible better answer: http://stackoverflow.com/a/27852491
accepted answer: http://stackoverflow.com/a/27852487
upvote count: 5
has answer: http://stackoverflow.com/a/27852491
has body: I have this url: http://example.com/things/stuff/532453?morethings&amp;stuff=things&amp;ver=1 I need just that number in the middle there. Closest I got was (\d*)?\? but this includes the question mark. Basiclly all numbers that come before the ? all the way to the slash so the ouput is 532453.

http://stackoverflow.com/comment/44123993
has text: yup exactly....and it should also help me set the datepicker only for future days and current day of that given date range
comment on: http://stackoverflow.com/q/27860155
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44097721
comment on: http://stackoverflow.com/q/27846962
has text: Yes, so ideally in my SetTimeout I will call loop() function recursively.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27834721
type: Question
accepted answer: http://stackoverflow.com/a/27835442
has body: I've got a full screen cover image on a web page and when user scrolls down from the cover to the content, a floating menu will fade in. I got this part covered with the code: $(window).scroll(function(){ if ($(this).scrollTop() &gt; $('#scroll-down').offset().top) { $('.menu').animate({opacity: 1}, 1000); } }); What I can't get working, is to fade the menu out at same point if user scrolls back to the cover on the top. If I add 'else' condition animating opacity back to 0, the menu won't show up at all.
score: 0
tagged with: scroll
has comment: http://stackoverflow.com/comment/44075127
answer count: 1
has comment: http://stackoverflow.com/comment/44075048
tagged with: javascript
has answer: http://stackoverflow.com/a/27835442
has comment: http://stackoverflow.com/comment/44074521
has title: Jquery show/hide menu based on scroll
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44074977
tagged with: jquery

http://stackoverflow.com/a/27927086
downvote count: 0
has body: You can use just el.value var output = document.getElementById('output'); function GetSelectedItem(el) { output.innerHTML = el.value; if (el.value == "Input") { alert(el.value); } else if(el.value == "Output") { alert(el.value); } } Example
type: Answer
answers question: http://stackoverflow.com/q/27927004
score: 1
upvote count: 1

http://stackoverflow.com/comment/44151343
comment on: http://stackoverflow.com/q/27874828
type: Comment
type: QuestionComment
score: 3
has text: ids create implicit globals unfortunately.

http://stackoverflow.com/a/27963436
has body: You can use tickPositioner and return ticks in the particular places. tickPositioner: function () { var positions = [], tick = Date.UTC(2011, 2, 1, 5, 0), increment = 3 * 3600 * 1000; for (tick; tick - increment &lt;= this.dataMax; tick += increment) { positions.push(tick); } return positions; }, Example: http://jsfiddle.net/2jLtzy6r/1/
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27957552
answers question: http://stackoverflow.com/q/27957552
type: Answer
upvote count: 1

http://stackoverflow.com/q/27828373
has comment: http://stackoverflow.com/comment/44063199
answer count: 0
has comment: http://stackoverflow.com/comment/44069625
tagged with: browser-history
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44063359
score: 0
type: UnansweredQuestion
has title: Prevent jQuery .load() if hash is visited
has body: I am loading pages within a content div with .load() function and using window.onhashchange event to detect if the user is navigated. window.onhashchange = function() { hash(window.location.hash.replace('#', '')) } and function hash(s) { $('.panel-body').fadeOut(100).load(s+'.php').fadeIn(100) } Some of the pages takes long to load everytime. I don't want them to be reloaded (bypass .load() function) if the state is already cached. Any workaround?

http://stackoverflow.com/q/27832266
type: Question
downvote count: 0
tagged with: javascript
has body: I am trying to find an element on a website using Selenium. The page I am looking at is: http://www.usaswimming.org/DesktopDefault.aspx?TabId=1470&amp;Alias=Rainbow&amp;Lang=en-US Specifically I am trying to find the element for the "Last Name" input box and send keys in Java. the html looks like this for the text box: &lt;div class="field"&gt; &lt;input id="ctl62_txtSearchLastName" type="text" maxlength="36" name="ctl00$ctl62$txtSearchLastName"&gt; &lt;/div&gt; Therefore, I initially attempted to get the element through the id which is unique: WebDriver driver = new InternetExplorerDriver(); driver.get(timeSearchSite); ... driver.findElement(By.id("ctl62_txtSearchLastName")).sendKeys(lastName); However this generated the following error: Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with id == ctl62_txtSearchLastName (WARNING: The server did not provide any stacktrace information) I also tried to use the name which failed similarly. Since this is a javascipt page I thought that I might need to wait before trying to access the element. I tried an explicit and an implicit wait and both resulted in timeouts. My next thought was that I was in the wrong frame but I cannot seem to find another frame. I tried indexing since I don't have names but I couldn't locate any other frames. There is this at the top of the page which might be messing selenium up: &lt;noscript&gt;&lt;iframe src="//www.googletagmanager.com/ns.html?id=GTM-WMWM93" height="0" width="0" style="display: none; visibility: hidden"&gt;&lt;/iframe&gt;&lt;/noscript&gt; What could be causing this error? How can I locate the element? Any help would be greatly appreciated/
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27832303
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44070982
has title: Selenium Unable to Find Element
tagged with: selenium-webdriver
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: java
tagged with: selenium
has answer: http://stackoverflow.com/a/27832303

http://stackoverflow.com/q/27962177
accepted answer: http://stackoverflow.com/a/28089481
upvote count: 1
type: AnsweredQuestion
score: 1
has body: I'm having a problem using the search component. What I want to do is being able to access the selected element data but it looks there are some timing issues and/or I'm doing things in the wrong way. This is my code: $('.ui.search.popup-project-changeCustomer').search( { type : 'standard', source : $scope.customers, searchFields : [ 'title', 'description' ], onSelect : function(event) { $scope.project.customer = event.target.value; $scope.changeCustomer(token); return 'default'; } }); The problem resides in the onSelect event and basically I can access the target.value but what I get is what the user typed in and not what the search component puts into the input. What's the best practice to actually get the data (like title, description etc..) of the user selected element? I guess I'm doing something wrong here.
has answer: http://stackoverflow.com/a/28089481
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has title: Semantic UI: Access search component selected item
favorite count: 0
tagged with: semantic-ui

http://stackoverflow.com/comment/44165192
has text: You also need to use `onclick="return processInfo()"` so that the return value of the function will be used.
comment on: http://stackoverflow.com/q/27881773
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27853702
tagged with: openfire
tagged with: javascript
has body: I am trying to develop a chat application based on XMPP using Strophe.js. Important Points:- 1) Server- Openfire 3.9.3 2) client- Strophe.js Messaging is working fine but I want to implement the seen by and message carbon feature just like Whatsapp and Facebook messenger. and I know it can be done with the help of XEP-0333 and XEP-0280 protocol I just want to know that is there any plugin available for Strophe.js to handle the XEP-0333 and XEP-0280 packages just to save time ?
downvote count: 4
tagged with: xmpp
has title: How implement seen by and message carbon feature in XMPP ( Openfire server) using Strophe.js?
answer count: 1
has comment: http://stackoverflow.com/comment/72115562
tagged with: strophe
favorite count: 0
accepted answer: http://stackoverflow.com/a/27858326
score: -3
tagged with: instant-messaging
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27858326
upvote count: 1
type: Question

http://stackoverflow.com/a/27849333
score: 2
has comment: http://stackoverflow.com/comment/44102780
downvote count: 0
answers question: http://stackoverflow.com/q/27849142
has comment: http://stackoverflow.com/comment/44124924
has body: First Problem - Assignment vs Equality Your first problem is that you are using an equals sign which is always assigning a value, rather than checking the value as a condition: if(element.style.background = "#00BFFF") should be if(element.style.background === "#00BFFF") Second Problem - Normalized Color Formats The second problem is that in some browsers, you can set the background color of an element, but then when you query it, you will see it in a normalized format. For instance, in Chrome, if you open up the dev tools and run the following command document.body.style.backgroundColor = "#FF0000", you will see the background turn red as you expect. However, if you immediately type document.body.style.backgroundColor, it will report the color in rgb format as rgb(255, 0, 0).
upvote count: 2
type: Answer

http://stackoverflow.com/a/27883216
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: thank you everybody i found the solution : $(document).ready(function(){ $('#toggle_message').click(function(){ var value= $('#toggle_message').attr('value'); $('#iframe').toggle('fast'); location.href="#iframe"; if(value=='Vise Reserver Bord Her') { $('#toggle_message').attr('value','Skjule Reservation'); }else if(value=='Skjule Reservation'){ $('#toggle_message').attr('value','Vise Reserver Bord Her'); location.href="#timing"; } }) });
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27882654
accepted answer of: http://stackoverflow.com/q/27882654

http://stackoverflow.com/q/27864729
has answer: http://stackoverflow.com/a/27864895
answer count: 3
score: -2
has comment: http://stackoverflow.com/comment/44132920
favorite count: 0
has answer: http://stackoverflow.com/a/27866594
type: UnansweredQuestion
has title: How can I limit input to two words max and on-the-fly?
downvote count: 2
tagged with: php
has answer: http://stackoverflow.com/a/27865194
type: Question
has body: I have an input field for tags. We want to limit tags to at most two words. How can I limit this? I'm thinking the following, but not sure if there is an easier solution... Count spaces. If the user types and then hits a space, assume everything to the left is a word. When the user types again and hits space a second time, assume we have hit two words. The user can no longer type forward, but can backspace to clear out the second word (or the entire input). ajax call to a PHP script utilizing str_word_count(). I suppose I can make a call every time the user keydowns, but wouldn't this be overkill? Maybe hit this after every space? Any other ideas?
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44132219
tagged with: jquery

http://stackoverflow.com/comment/44248513
type: QuestionComment
has text: @SebastianBochan ok thank you I will try that, I figured it was probably a lack of space near the top of the graph.
comment on: http://stackoverflow.com/q/27912738
score: 0
type: Comment

http://stackoverflow.com/q/27892673
tagged with: javascript
has title: How to remove class using ng-class ng-click?
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/27892742
tagged with: angularjs-ng-click
upvote count: 1
tagged with: ng-class
answer count: 1
has body: http://plnkr.co/edit/6AEvKuyXai9LbcNjfluN?p=preview I have 3 links, the first 1 has the .active class. When you click on 2 and 3, number 1 should lose the .active class. Right now if you click 2 or 3, they will update correctly, but 1 still has the active class on it :( a click 1 a click 2 a click 3
has answer: http://stackoverflow.com/a/27892742

http://stackoverflow.com/comment/44202763
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27901031
has text: Is this correct way to do this? $('.tab_focus').html()||$('.tab_focus').val()
type: AnswerComment

http://stackoverflow.com/comment/44046025
score: 0
type: Comment
has text: i have not suggested you iframes.
type: AnswerComment
comment on: http://stackoverflow.com/a/27820157

http://stackoverflow.com/comment/44315174
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27960808
has text: `^((.*\n){4}.*|.{375})$`

http://stackoverflow.com/comment/44136795
type: AnswerComment
has text: great tip in general but unfortunately still doesn't work after changed to integer
comment on: http://stackoverflow.com/a/27866973
type: Comment
score: 0

http://stackoverflow.com/q/27865932
has comment: http://stackoverflow.com/comment/44156513
type: UnansweredQuestion
tagged with: utc
has title: Convert utc date time to local date time using JavaScript or jQuery
has comment: http://stackoverflow.com/comment/44156532
linked to: http://stackoverflow.com/q/6525538
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44135278
has answer: http://stackoverflow.com/a/27866003
has answer: http://stackoverflow.com/a/27886867
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44156547
score: 0
has body: I am storing a UTC date time in a SharePoint list and fetching it's value in c#, converting into milliseconds from 1 Jan 1970 and passing those milliseconds to JavaScript to get date object. But when I create a date object, its value remains same as UTC date, I want that value to be in users local time zone and reflecting their daylight saving status.
tagged with: datetime
has comment: http://stackoverflow.com/comment/44134379

http://stackoverflow.com/comment/44188631
comment on: http://stackoverflow.com/a/27891769
type: Comment
score: 0
has text: As you said I get this error: `Uncaught TypeError: Cannot read property 'length' of undefined`
type: AnswerComment

http://stackoverflow.com/a/27858349
has body: I dont see ajax anywhere in your code and I'm not sure what do you want to achieve. If you are using a "button" input type, I assume you want to use jQuery to interact with the server side because with "button" you cannot submit a form. I just see some jQuery and php. Php runs on server, can't handle real time action without $.ajax(). When you select the date, you must get it's value via javascript. Then you send the value to the server via jQuery.ajax(). Something like this: //in the action you select the date: $("button").click(function(){ $.ajax({ type: "POST", url: "convert.php", data: {date: theDateIPicked}, }).done(function(data){ //do our stuff we want after we got back the value from the php }); }); I hope it helps you.
accepted answer of: http://stackoverflow.com/q/27857800
answers question: http://stackoverflow.com/q/27857800
has comment: http://stackoverflow.com/comment/44119828
score: 0
has comment: http://stackoverflow.com/comment/44119913
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44119640
has comment: http://stackoverflow.com/comment/44120634
type: Answer
has comment: http://stackoverflow.com/comment/44198368
has comment: http://stackoverflow.com/comment/44119983
has comment: http://stackoverflow.com/comment/44120288

http://stackoverflow.com/a/27860385
type: Answer
answers question: http://stackoverflow.com/q/27858453
score: 0
has body: Ok, I thought you could use angular-ui and the modal from bootstrap there. This example is the one from http://angular-ui.github.io/bootstrap/ modificated for your needs. Open me! Large modal Small modal Variable input from a modal: {{ variable }} and your javascript: angular.module('ui.bootstrap.demo', ['ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function($scope, $modal, $log) { $scope.variable = "initial value"; $scope.open = function(size) { var modalInstance = $modal.open({ templateUrl: 'myModalContent.html', controller: 'ModalInstanceCtrl', size: size, resolve: { variable: function() { return $scope.variable; } } }); modalInstance.result.then(function(variable) { //your special processing here $scope.variable = variable.toUpperCase(); }, function() { $log.info('Modal dismissed at: ' + new Date()); }); }; }); // Please note that $modalInstance represents a modal window (instance) dependency. // It is not the same as the $modal service used above. angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl', function($scope, $modalInstance, variable) { $scope.variable = variable; $scope.ok = function() { $modalInstance.close($scope.variable); }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; }); I'm doing the same here and everything is working fine. working demo: http://plnkr.co/edit/yXEGPXejWdlLrniDGQs5?p=preview

http://stackoverflow.com/comment/44284652
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27935552
has text: the input for username had a typo, that was the problem, check the snippet now, I just tested it and it works fine for the username and password..

http://stackoverflow.com/comment/44295539
type: AnswerComment
has text: I was about to mark this wrong, then I realized that the last API reference allows you to set a boolean instead of an options object.
type: Comment
score: 2
comment on: http://stackoverflow.com/a/27950206

http://stackoverflow.com/comment/44276407
comment on: http://stackoverflow.com/a/27933776
has text: Thanx you for your answer. I am not reloading the whole page, but use the innerHTML function for reloading the results of an AJAX call in a div. The problem is that every time i go back with the history button from a product page to a category page in the browser, the script looks whether there is a hash in the URL. This way every time i go back with the history button in the browser the data will be reloaded with an AJAX call. I wonder if there is a better way so the filters, and products, pagination etc. will be saved and don't reload every time when using the history button.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27853013
accepted answer of: http://stackoverflow.com/q/27851794
has body: You could make your own custom filter. Here is an example of a simple implementation of this integrated with the example you provided Filter app.filter('contains', ['$filter', function(filter) { return function (collection, query) { var arr = query ? query.toLowerCase().split(/\s+/) : []; for (var i = 0; i &lt; arr.length; i += 1) { collection = filter('filter')(collection, arr[i]); } return collection; } }]); Working Fiddle
answers question: http://stackoverflow.com/q/27851794
downvote count: 0
upvote count: 2
type: Answer
score: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/44213858
has text: can you post some code so we can help you? Thanks!
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27907295

http://stackoverflow.com/q/27849151
linked to: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/44104165
tagged with: ajax
type: UnansweredQuestion
tagged with: asynchronous
has body: There are about a million posts on SO about async callbacks, but I cannot figure out how to get mine to work I have an AJAX request: function checkName(); var ajax = new XMLHttpRequest(); ajax.open("POST", "index.php", true); // true = async ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.onreadystatechange = function(){ if(ajax.readyState == 4 &amp;&amp; ajax.status == 200){ var pass = ajax.responseText + 0; } } ajax.send("emailcheck="+email); return pass; } The only possible outcomes for pass are 1 or 0. I've tried moving the return immediately after the assignment of pass, but still nothing. That's when I started looking around on here and found callbacks, but I'm having trouble figuring out how to do it. What I would like to do is have something like: if(checkName()){ // Do stuff }else{} I don't want to do a synchronous ajax request (i.e. false for third param), because that stops an animation I have and also prevents the user from performing other tasks on the site for the short time the call takes place. I know this is very similar to other posts about the topic, I just can't quite figure it out. Thank you in advance.
has comment: http://stackoverflow.com/comment/44104937
type: Question
has comment: http://stackoverflow.com/comment/44102515
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44104983
has answer: http://stackoverflow.com/a/27850195
has title: Having trouble with ASYNC AJAX CALLBACK
has comment: http://stackoverflow.com/comment/44102225
answer count: 1
tagged with: callback

http://stackoverflow.com/a/27894171
downvote count: 1
has comment: http://stackoverflow.com/comment/44189916
score: -1
has comment: http://stackoverflow.com/comment/44190074
upvote count: 0
has body: I'm not sure if this is exactly your issue, but you aren't specifying the numeMeci parameter in the last four columns. For example: onclick="getCota('.$row['id_meci'].',2)" &gt; // no second parameter With it missing, your getCota(id,numeMeci,index) is receiving the index values in numeMeci instead of the index parameter. Effectively that function would be attempting something like: $(2).text() jQuery probably doesn't like that.
type: Answer
has comment: http://stackoverflow.com/comment/44189962
answers question: http://stackoverflow.com/q/27894128

http://stackoverflow.com/q/27883115
answer count: 2
possible better answer: http://stackoverflow.com/a/27883197
has answer: http://stackoverflow.com/a/27883197
tagged with: javascript
tagged with: jquery
has body: OK, so I am sorry if this question is repeated BUT I really could not figure answer. O have menu with classes, and I want that when I click on some menu items .menuitem &gt; a that link have more paddingBottom. So I managed to use .click function and animate function but that add padding to entire class ( all menu items ). What I need is adding padding only to THAT CLICKED menu. Code that make padding to all menu items ( entire class ) $(".menuitem" ).click(function() { $('.mainNav &gt; ul &gt; li &gt; a').animate({paddingBottom:"+=17px"}); });
has answer: http://stackoverflow.com/a/27883150
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27883150
has title: Change padding using jquery to class but only to clicked item
type: AnsweredQuestion
type: Question
score: 0

http://stackoverflow.com/q/27835598
has comment: http://stackoverflow.com/comment/44075964
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/27835831
has title: 'this' concept in the object in javascript
favorite count: 0
has body: I am sorry for that the simple question first. But I just want to know what happen in the code below. var indexobj = { test : 1, testFunction : function() { document.getElementById('AA').innerHTML = indexobj.test++; //this is i wanted document.getElementById('BB').innerHTML = this.test++; //NaN setTimeout(indexobj.testFunction,1000); }, } setTimeout(indexobj.testFunction,1); Here is the sample link below http://jsfiddle.net/apss/JR5Xk/28/ Why in this example the ‘this’ inside the ‘testFunction’ function doesn’t mean ‘indexobj’ this object? Thanks for your help.
upvote count: 4
has comment: http://stackoverflow.com/comment/44075894
linked to: http://stackoverflow.com/q/2236747
has answer: http://stackoverflow.com/a/27835831
has answer: http://stackoverflow.com/a/27835658
accepted answer: http://stackoverflow.com/a/27835658
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/7890685
type: Question
answer count: 2

http://stackoverflow.com/comment/44259487
comment on: http://stackoverflow.com/q/27924095
score: 0
has text: If I must, I will - it's going to be bloody long if I describe the entirety. It seemed much easier for all of us if I just linked the website in question?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27961537
favorite count: 0
has comment: http://stackoverflow.com/comment/44320013
tagged with: colors
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44317342
answer count: 1
has answer: http://stackoverflow.com/a/27963503
has comment: http://stackoverflow.com/comment/44316868
has comment: http://stackoverflow.com/comment/44317439
tagged with: javascript
has body: My canvas color is 50 255 50 155. When I do a code: function getClickedAreaColor(x, y) { var data = ctx.getImageData(x, y, 1, 1).data, color = []; for (var i = 0; i &lt; data.length; i++) { color.push(data[i]); } return color; } It returns 49 255 49 155 Why is that?
has comment: http://stackoverflow.com/comment/44323831
has title: Why function returns wrong color in canvas?
accepted answer: http://stackoverflow.com/a/27963503
tagged with: canvas
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44317088

http://stackoverflow.com/a/27943156
type: Answer
has comment: http://stackoverflow.com/comment/44288073
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44321702
has body: I think the problem comes with transform, because transform only "simulates" bigger elements, but doesn't change any width values or sth. like that which means your browser still tries to layout with your raw values. You could achieve such an effect by just changing the font-size, which changes width, height and position all by itself. For example: http://jsfiddle.net/mtphLyem/7/ function zoom(zoomFactor) { $('.container &gt; .step').css('font-size', zoomFactor + 'px'); } Update From comment below: 'Then you might also change margins since changing size would again trigger the scaling. This one looks quite experimenting and I'm sure there's a more efficient way to do that but still it seems to work: jsfiddle.net/mtphLyem/10'
has comment: http://stackoverflow.com/comment/44283651
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27937312
accepted answer of: http://stackoverflow.com/q/27937312

http://stackoverflow.com/comment/44276464
type: AnswerComment
type: Comment
has text: How is that different from my answer?
comment on: http://stackoverflow.com/a/27940135
score: 0

http://stackoverflow.com/q/27952362
answer count: 2
tagged with: javascript
has body: I'm having trouble finding a chart type similar to the one I diagrammed above. It resembles a chromosome, spectrum, or barcode. It has a column (light-blue) which represents the range of values in a dataset in relation to a threshold. I want a user to be able to indicate a time range and see which values (dark-blue) were observed within that time range. Eventually I want to show multiple datasets like this next to each other, where they share a normalized threshold. This way I can quickly see all my datasets in relation to their individual thresholds for the same time range. A stacked bar chart appears closest visually, but it's not meant for timeseries data, and its also not meant for binary groups (within range, not in range). I need to create this for the web. I'm using amcharts for other charts in the project so I'd like to use that if possible but I'm open to any other libraries. Suggestions of similar chart types, charting libraries, or amcharts workarounds would be most appreciated.
score: 0
type: UnansweredQuestion
tagged with: data-visualization
has title: Spectrum Timeseries Chart
tagged with: amcharts
has answer: http://stackoverflow.com/a/27972820
has answer: http://stackoverflow.com/a/27958295
type: Question

http://stackoverflow.com/a/27864910
answers question: http://stackoverflow.com/q/27864387
score: 0
has body: Try var filtered = function(data, id) { return data.filter(function(items, i) { return items.id === id }) }; console.log(filtered("1"));
type: Answer

http://stackoverflow.com/q/27864533
favorite count: 0
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/27864777
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44131749
has comment: http://stackoverflow.com/comment/44131505
possible better answer: http://stackoverflow.com/a/27865091
has comment: http://stackoverflow.com/comment/44131837
has answer: http://stackoverflow.com/a/27865091
linked to: http://stackoverflow.com/q/27640896
upvote count: 2
downvote count: 2
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27864777
has answer: http://stackoverflow.com/a/27865207
type: Question
has title: Getting width of HTML document to resize with the browser window
has body: I am new to web development and currently building a site for a friend that is being modeled after this one: http://fulton-demo.squarespace.com/ While I have most of the elements into code and styled, I cannot figure out how to get the images and content to fill 100% of the width AND resize when the browser window is resized. Like, take the first image on the link I provided for example...I would like it to look like this, meaning to not have any margins on either side and fill the browser window....and I can get it to do that, but it never shows 100% of the image and when I resize the window, nothing moves. Does that make sense? I know this is probably a very elementary question, but I would love some insight on this. I can post any and all code if necessary. Thanks in advance guys! EDIT: Here is my code: HTML: <img src="img/SJ_WHT.png" height="170px" width="220x" align=center a better way to book creative spaces unique spaces that inspire Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod temor incididunt ut labore et dolore magna aliqua hassle free booking Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod temor incididunt ut labore et dolore magna aliqua share your creative space Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod temor incididunt ut labore et dolore magna aliqua unleash your creativity We focus on your artistic expression at Studio Junkey. We believe that your creative process is limited when the necessary resources are not available to execute your vision. </nr> We want to ensure that you find the studio space that has the tools you need to express yourself and your vision Want to list a studio space? We are looking for more studios. Send us your information so we can connect. CSS: @font-face { font-family: "Brandon Grotesque"; src: url("fonts/Brandon_Grotesque/Brandon_reg.otf") format("opentype"); } html, body { height: 100%; width: 100%;; padding:0; margin: 0; } body { font-fam…
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44154155
type: Comment
has text: @TrisztánThar, You're welcome. Nice to help you to solve the problem.
type: AnswerComment
comment on: http://stackoverflow.com/a/27876249
score: 0

http://stackoverflow.com/comment/68726037
type: AnswerComment
comment on: http://stackoverflow.com/a/27958705
score: 0
type: Comment
has text: @CreativeCoder have you found a solution? I also want to pass a function as argument to a custom dialog component. Would be interesting to know how did you solve your case. Thanks in advance

http://stackoverflow.com/a/27830875
has comment: http://stackoverflow.com/comment/44071112
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44068504
has comment: http://stackoverflow.com/comment/44071541
has comment: http://stackoverflow.com/comment/44069905
answers question: http://stackoverflow.com/q/27827675
has comment: http://stackoverflow.com/comment/44069000
type: Answer
has comment: http://stackoverflow.com/comment/44069365
has body: You can do this with a fragment shader: &lt;script id="fs" type="x-shader/x-fragment"&gt; uniform float iGlobalTime; uniform sampler2D iChannel0; varying vec2 vUv; void main() { vec2 uv = vUv; uv.y = uv.y + iGlobalTime; if (uv.y &gt; 1.) uv.y = uv.y - 1.; gl_FragColor = texture2D( iChannel0, vec2(uv.x, uv.y)); } &lt;/script&gt; Define your shader material: _uniforms = { iGlobalTime: { type: 'f', value: 0.1 }, iChannel0: { type: 't', value: THREE.ImageUtils.loadTexture( 'textures/cat.png') }, }; newMaterial = new THREE.ShaderMaterial( { uniforms: _uniforms, vertexShader: document.getElementById( 'vs' ).textContent, fragmentShader: document.getElementById( 'fs' ).textContent, } ); Then set iGlobalTime in your render loop: _uniforms.iGlobalTime.value += clock.getDelta(); while (_uniforms.iGlobalTime.value &gt; 1.) _uniforms.iGlobalTime.value -= 1.; Complete working example here: http://rwoodley.org/MyContent/SO/01/
accepted answer of: http://stackoverflow.com/q/27827675
has comment: http://stackoverflow.com/comment/44069009

http://stackoverflow.com/q/27919258
tagged with: javascript
has comment: http://stackoverflow.com/comment/44236420
has answer: http://stackoverflow.com/a/27919481
accepted answer: http://stackoverflow.com/a/27919481
has answer: http://stackoverflow.com/a/27919631
linked to: http://stackoverflow.com/q/23738729
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44236396
tagged with: css
type: AnsweredQuestion
has title: Why does my javascript-code to hide/show div-boxes not work?
has answer: http://stackoverflow.com/a/27919474
type: Question
has comment: http://stackoverflow.com/comment/44236259
possible better answer: http://stackoverflow.com/a/27919631
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44236189
has body: I'm trying to hide/show the main-contentholders on my website based on what menu-option the reader clicks on. This seems like a simple thing to me, I've done it multiple times before but now it just won't work. My code looks like this: Mercedes F1 Förarbiografi Mercedes F1 Statistik Förare Mercedes F1 genom åren Statistik

http://stackoverflow.com/q/27865116
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27865166
score: 1
possible better answer: http://stackoverflow.com/a/27865204
has body: I have 2 modal popups in this code. How can i use the close button on the second popped modal to close the first and the second modal. Open First Modal First Modal Open Second Close Second Modal Close all
answer count: 2
tagged with: modal-dialog
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How can I close multiple bootstrap modals with the close button on the last popped modal
has answer: http://stackoverflow.com/a/27865166
type: AnsweredQuestion
upvote count: 2
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27865204
has comment: http://stackoverflow.com/comment/44147029

http://stackoverflow.com/q/27884955
type: Question
has body: I have the following string which contains escaped HEX values and ASCII characters "\01B\2E\00 k\00" A backslash means that the next two characters are HEX values, everything else in the string is ASCII The goal is to convert the entire string into all HEX values end result: "\01\42\2E\00\20\20\20\6B\00" ::edit:: I had tried the following: s = "\01B\2E\00 k\00" r = [ ] for x in s: r.append(x.encode("hex")) print r the problem was the values (ex: \1E ) were being interpreted as \x01 and E Then i ran into the following question online came to post an update, and realized my question was already answered. Thanks
tagged with: javascript
has comment: http://stackoverflow.com/comment/44171335
has answer: http://stackoverflow.com/a/27885148
score: -1
answer count: 2
tagged with: string
possible better answer: http://stackoverflow.com/a/27885351
favorite count: 0
has answer: http://stackoverflow.com/a/27885351
accepted answer: http://stackoverflow.com/a/27885148
tagged with: python
has title: Convert string with escaped characters and ASCII values into HEX
type: AnsweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/44181619
upvote count: 1

django-views
tags question: http://stackoverflow.com/q/27896780
tag name: django-views
type: Tag

http://stackoverflow.com/comment/44245453
comment on: http://stackoverflow.com/q/27924152
type: Comment
type: QuestionComment
score: 0
has text: With JS you can could read the filedata but there's no way to *save* it on the server without some functions server-side.

http://stackoverflow.com/a/27829523
score: 0
has comment: http://stackoverflow.com/comment/44090011
type: Answer
has comment: http://stackoverflow.com/comment/44065470
has body: Try: $("body").on("change", "#Puppies", function() { var selected = $(this).find(":selected").val(); });
has comment: http://stackoverflow.com/comment/44089205
answers question: http://stackoverflow.com/q/27829027

http://stackoverflow.com/a/27835716
has comment: http://stackoverflow.com/comment/44077037
has comment: http://stackoverflow.com/comment/44077963
has comment: http://stackoverflow.com/comment/44077008
has comment: http://stackoverflow.com/comment/44077845
answers question: http://stackoverflow.com/q/27835600
downvote count: 0
has comment: http://stackoverflow.com/comment/44078244
has comment: http://stackoverflow.com/comment/44077650
type: Answer
upvote count: 1
has body: Here is someone with almost exactly the same issue as you have: Create multiple Upload File dynamically Try doing the same. I haven't programmed PHP for quite some time, but I guess you should replace data[files] to just data[], so it creates a new array item for each field. Now you are giving each field the same name. Then you can loop over them in your controller by using: foreach($_FILES['data'] as $file){ //do stuff with $file } EDIT 2: As you are saying, you want to upload the files (not to a db). So I guess this should work: public function uploadFile() { $filename = ''; if ($this-&gt;request-&gt;is('post')) { // checks for the post values $uploadData = $this-&gt;data; foreach($uploadData as $file){ if ( $file['size'] == 0 || $file['error'] !== 0) { // checks for the errors and size of the uploaded file echo "Failide maht kokku ei tohi olla üle 5MB"; return false; } $filename = basename($file['name']); // gets the base name of the uploaded file $uploadFolder = WWW_ROOT. 'files'; // path where the uploaded file has to be saved $filename = $filename; // adding time stamp for the uploaded image for uniqueness $uploadPath = $uploadFolder . DS . $filename; if( !file_exists($uploadFolder) ){ mkdir($uploadFolder); // creates folder if not found } if (!move_uploaded_file($file['tmp_name'], $file)) { return false; } echo "Sa sisestasid faili(d): $filename"; } } }
has comment: http://stackoverflow.com/comment/44077096
has comment: http://stackoverflow.com/comment/44077794
has comment: http://stackoverflow.com/comment/44077157
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27835600

http://stackoverflow.com/comment/44187237
has text: The usual recommendation is to put the change handler in a named function, and then just call it directly after assigning to `.value`.
score: 1
comment on: http://stackoverflow.com/q/27892884
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27916298
has comment: http://stackoverflow.com/comment/44235772
downvote count: 1
score: 3
has body: You can do it with simple html and css also /* Clean up the lists styles */ ul.accordion { list-style: none; margin: 0; padding: 0; } /* Hide the radio buttons */ /* These are what allow us to toggle content panes */ ul.accordion label + input[type='radio'] { display: none; } /* Give each content pane some styles */ ul.accordion li { background-color: #CCCCCC; border-bottom: 1px solid #DDDDDD; } /* Make the main tab look more clickable */ ul.accordion label { background-color: #666666; color: #FFFFFF; display: block; padding: 10px; } ul.accordion label:hover { cursor: pointer; } /* Set up the div that will show and hide */ ul.accordion div.content { overflow: hidden; padding: 0 10px; display: none; } /* Show the content boxes when the radio buttons are checked */ ul.accordion label + input[type='radio']:checked + div.content { display: block; } Content pane 1 content to be displayed Content pane 2 content to be displayed Content pane 3 content to be displayed Content pane 4 content to be displayed Content pane 5 content to be displayed
upvote count: 4
type: Answer
has comment: http://stackoverflow.com/comment/44231276
answers question: http://stackoverflow.com/q/27916216
has comment: http://stackoverflow.com/comment/44235797
has comment: http://stackoverflow.com/comment/44231327

http://stackoverflow.com/q/27953860
has comment: http://stackoverflow.com/comment/44302872
type: Question
has comment: http://stackoverflow.com/comment/44304193
answer count: 2
accepted answer: http://stackoverflow.com/a/27960044
possible better answer: http://stackoverflow.com/a/27954646
has answer: http://stackoverflow.com/a/27954646
tagged with: javascript
has comment: http://stackoverflow.com/comment/44303086
has comment: http://stackoverflow.com/comment/44304270
score: 0
has answer: http://stackoverflow.com/a/27960044
has comment: http://stackoverflow.com/comment/44302851
has body: This is kind of nice, but it's a little confusing because I have to open up the promise and return the item. Promise.map(assets, function(asset){ asset.download_path = path.join(downloadDir, asset.name) return existsAsync(asset.download_path).then(function(exists){ asset.exists = exists return asset; }) }).map(function(asset){ if(asset.exists) return asset return downloadStream(asset.browser_download_url, asset.download_path).then(function(download){ return asset }) })
tagged with: promise
has title: Is there another way to add a prop and return object within .map()
type: AnsweredQuestion
tagged with: bluebird

http://stackoverflow.com/a/27806709
has body: If you include jQuery, this will do what you originally requested: $(function(){ $('td').each(function(idx){ $(this).data().originaltext = $(this).text(); $(this).html(fill_with_blocks($(this).data().originaltext)); }) $('td').hover(function(){ $(this).html($(this).data().originaltext); }, function(){ $(this).html(fill_with_blocks($(this).data().originaltext)); }); }); function fill_with_blocks(str) { var blocks = ''; for(var i = 0;i&lt;str.length;i++){ blocks += '&amp;#9608;'; } return blocks; }
type: Answer
answers question: http://stackoverflow.com/q/27806192
score: 0

http://stackoverflow.com/comment/44214253
comment on: http://stackoverflow.com/q/27907024
type: QuestionComment
type: Comment
has text: I updated your question. Next time, please edit your question. This amount of XML in a comment makes no sense.
score: 0

http://stackoverflow.com/comment/44104840
has text: Hello @Travis, can I use div id, like: `$("DIV-ID-HERE").append...` ?
score: 0
comment on: http://stackoverflow.com/a/27850150
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44209008
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27904502
has text: @charlietfl How to structure the arrays in javascript while still using PHP. Then, how do i can actually iterate thru the array in order to populate the multiple select box.
score: 0

http://stackoverflow.com/q/27820980
upvote count: 1
has body: I work on a test case with javascript and protractor.On site is an analysis tool in use, which integrates a pixel to the page and tracks the user behaviour. I try all requests of a web page to intercept and read out the url. I tried to use a proxy to log alle request, but this did not work. does anybody know how to get the outgoing http get-requests?
has comment: http://stackoverflow.com/comment/69994053
tagged with: testing
tagged with: protractor
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44047917
downvote count: 0
linked to: http://stackoverflow.com/q/6509628
score: 1
has comment: http://stackoverflow.com/comment/44049338
favorite count: 0
tagged with: interceptor
type: Question
has title: Protractor: how to analyze all incoming and outgoing HTTP traffic

http://stackoverflow.com/comment/44279362
has text: You should add your question to the content, not just to the headline
comment on: http://stackoverflow.com/q/27941457
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27881216
tagged with: css
score: 0
type: UnansweredQuestion
has title: Refreshing jQm header after dynamically adding a button
type: Question
has body: I'm trying to dynamically add a button to a jQueryMobile header (this will be a login/logout). The issue I'm having is - the button is not getting the jQm styling. I tried using .trigger("pagecreate") and other options but nothing worked. How should I refresh/reset/rebuild the header for the jQm style to take effect? Here's a fiddle: http://jsfiddle.net/mroh1w9v
answer count: 1
tagged with: jquery-mobile
has answer: http://stackoverflow.com/a/27881515
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27875999
has answer: http://stackoverflow.com/a/27876261
has answer: http://stackoverflow.com/a/27876096
answer count: 3
has title: Comments in angularjs expression
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/27876096
tagged with: angularjs
score: 6
has comment: http://stackoverflow.com/comment/58345428
has answer: http://stackoverflow.com/a/27876151
upvote count: 6
accepted answer: http://stackoverflow.com/a/27876261
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44155138
type: Question
has body: I have some HTML tags which have ng-clicks and ng-ifs. Inside the respective expressions, I make function calls and pass in parameters, some of which are literals (mostly just true or false). So I would like to add a comment as to what a literal means, but angular doesn't seem to be able to parse this correctly. (I realize passing literals is not the brightest idea but I would nevertheless like to know the answer) &lt;button class='someclass' ng-click='somefunction(val1, val2, true /* explanation for literal */)' &gt; &lt;/button&gt; How do I add comments in angular expressions?
tagged with: javascript
tagged with: comments
has comment: http://stackoverflow.com/comment/44153756

http://stackoverflow.com/comment/44056341
type: QuestionComment
comment on: http://stackoverflow.com/q/27825155
has text: Either submit the form via ajax and add that value on, or add a hidden input with that value to your form.
score: 0
type: Comment

http://stackoverflow.com/comment/44285603
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27945077
has text: You can change the text using the properties i.e. data-toggle="popover" title="Popover title" data-content="This should be styled"

http://stackoverflow.com/q/27960365
has answer: http://stackoverflow.com/a/30721596
has title: Error: [ng:areq] Argument 'simpleController' is not a function, got undefined
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/27960558
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/62249540
possible better answer: http://stackoverflow.com/a/27960914
has answer: http://stackoverflow.com/a/27960558
answer count: 3
favorite count: 0
linked to: http://stackoverflow.com/q/24894870
tagged with: angularjs
has body: What am i doing wrong here, I am new to angular, its showing the error above, here is my code Name: {{coders.name}}-{{coders.city}}
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/27960914

http://stackoverflow.com/comment/95375024
type: Comment
score: 0
type: AnswerComment
has text: This will pop the messge on ANY button click!
comment on: http://stackoverflow.com/a/27894824

http://stackoverflow.com/a/27851531
has comment: http://stackoverflow.com/comment/44107328
score: 1
has comment: http://stackoverflow.com/comment/44107169
has comment: http://stackoverflow.com/comment/44107952
has comment: http://stackoverflow.com/comment/44107450
has comment: http://stackoverflow.com/comment/44107537
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44107225
has comment: http://stackoverflow.com/comment/44107375
has comment: http://stackoverflow.com/comment/44107272
has body: You'd have to pass afunc to bfunc: // main.js var cFunc = function() {console.log(aFunc() + bFunc(afunc)); } // bfunc.js var bFunc = function(f) {return f() + f()}; JavaScript has lexical scope.
type: Answer
accepted answer of: http://stackoverflow.com/q/27851497
has comment: http://stackoverflow.com/comment/44107227
answers question: http://stackoverflow.com/q/27851497
upvote count: 1

http://stackoverflow.com/q/27912336
has body: Hi I am new to ajax and I am attempting to pass a Json to a Database, but I am not that far yet. Currently I am attempting to be verified that the data I am passing is being done successfully. However, I always drop into the ajax error method. I will upload my code and the way the data looks and then the error. Thank you for your help! &lt;script&gt; function updateTable() { alert("Do i try to update table?"); document.getElementById("testLand").innerHTML = "Post Json"; //echo new table values for ID = x } function popupClick (){ var popupObj = {}; popupObj["Verified_By"] = $('#popupVBy').val(); popupObj["Date_Verified"] = $('#popupDV').val(); popupObj["Comments"] = $('#popupC').val(); popupObj["Notes"] = $('#popupN').val(); var popupString = JSON.stringify(popupObj); alert(popupString); $.ajax({ type: "POST", dataType: "json", url: "popupAjax.php", data: popupObj, cache: false, success: function(data) { alert("Success"); updateTable(); }, error: function(data) { alert("there was an error in the ajax"); alert(JSON.stringify(data)); } }); } &lt;/script&gt; JSON Being Passed shown in var popupString: Error: popupAjax.php file (warning it's testy) &lt;?php echo "Testing tests are testy"; ?&gt;
type: Question
answer count: 1
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/44224197
has comment: http://stackoverflow.com/comment/44224221
has answer: http://stackoverflow.com/a/27912439
has title: Ajax Error Potentially Due to Incorrect Data Object Being Passed
score: 0
tagged with: php
has comment: http://stackoverflow.com/comment/44224338
accepted answer: http://stackoverflow.com/a/27912439
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/27942746
accepted answer: http://stackoverflow.com/a/27943211
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Binding a List to a Viewmodel using knockout
tagged with: knockout.js
type: Question
tagged with: c#
tagged with: asp.net-mvc
tagged with: javascript
has body: I am new to MVC and knockout and JS for that matter. I am trying to display a list of Providers using Knockout. I have the following code to get the list of Providers public ActionResult Index() { Provider providerList = new Provider(); IList&lt;Provider&gt; providers = DAL.GetListofProviders.ToList(); return View(providers); } I have the following View @model List&lt;DEMO_JAN14.Models.Provider&gt; @{ Layout = "~/Views/Shared/_Layout.cshtml"; } &lt;head&gt; &lt;title&gt;LIST OF PROVIDERS&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;table class="table table-striped table-bordered table-hover"&gt; &lt;tr&gt; &lt;th&gt;Provider Type&lt;/th&gt; &lt;th&gt;First Name&lt;/th&gt; &lt;th&gt;Last Name&lt;/th&gt; &lt;th&gt;Certification&lt;/th&gt; &lt;th&gt;Specialization&lt;/th&gt; &lt;th&gt;SSN&lt;/th&gt; &lt;th&gt;Facility Name&lt;/th&gt; &lt;th&gt;Contact No&lt;/th&gt; &lt;th&gt;Contact Email&lt;/th&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tbody data-bind="foreach:viewmodel"&gt; &lt;tr&gt; &lt;td class="col-lg-2" data-bind="text: ProviderType"&gt;&lt;/td&gt; &lt;td class="col-lg-1" data-bind="text: FirstName"&gt;&lt;/td&gt; &lt;td class="col-lg-1" data-bind="text: LastName"&gt;&lt;/td&gt; &lt;td class="col-lg-1" data-bind="text: Certification"&gt;&lt;/&gt; &lt;td class="col-lg-1" data-bind="text: Specialization"&gt;&lt;/td&gt; &lt;td class="col-lg-1" data-bind="text: SSN"&gt;&lt;/td&gt; &lt;td class="col-lg-4" data-bind="text: FacilityName"&gt;&lt;/td&gt; &lt;td class="col-lg-4" data-bind="text: ContactNumber"&gt;&lt;/td&gt; &lt;td class="col-lg-1" data-bind="text: ContactEmail"&gt;&lt;/td&gt; &lt;td&gt;&lt;a class="btn btn-danger" id="del" onclick = "return confirm('Are you sure, you want to delete');" data-bind="attr: { href: '/Provider/Delete/' + ProviderID }"&gt; Delete &lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/body&gt; I have written a script to get convert the Model data into Json data. &lt;script type="text/javascript"&gt; $.ajax({ url: …
answer count: 2
has answer: http://stackoverflow.com/a/27942976
upvote count: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/27942976
has answer: http://stackoverflow.com/a/27943211

http://stackoverflow.com/comment/87721604
has text: I was having a similar problem with React updating the `input` after I set its value through code. This answer worked for me https://stackoverflow.com/a/48890844/740639
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27859827

http://stackoverflow.com/q/27836615
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
has title: Adding dynamic rows
tagged with: pug
downvote count: 1
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/44077844
has answer: http://stackoverflow.com/a/27862748
accepted answer: http://stackoverflow.com/a/27862748
has body: when I click a button a row will be added dynamically.I added multiple records and saved it will stroed in db after that I add one more row it get previously inserted rows values. eg: firstly, I submitted 3 rows then I added one more row It will take 4 rows values and stored to db. how can I take after submitted records Here is my code I included the table and then script I used. .table-responsive table#itemTable.table.table-striped.table-bordered thead tr th Item | th Description | th Quantity | th Price | th Tax Rate | th Subtotal | th Tax | th Total | th tbody#addRow.tbody tr.addrow td input.invoiceId(type='hidden', name='invoiceId', value='#{data.invoice_id}') input(type='hidden', name='item_id', value='4') input.itemName.input-small(type='text', name='itemName[]', value='',disabled) input.input-small(type='hidden', value='#{data.item}',disabled) td textarea.itemDescription.input-medium(name='itemDescription[]', rows='1', cols='3' disabled) td input.itemQuantity.input-mini(type='text', name='itemQuantity[]' value='', disabled) input.input-mini(type='hidden', value='#{data.quantity}', disabled) td input.itemPrice.input-small(type='text', name='itemPrice[]',value='', disabled) input.input-small(type='hidden',value='#{data.price}', disabled) td select.itemtaxRate.input-small(name='itemtaxRate[]',disabled) option(value='0') None option(value='5.00') 5.00% select.itemtaxRate.input-small(name='itemtaxRate[]', style='display:none' disabled) td span.subTotal(name='subtotal[]', disabled) i.fa.fa-inr &amp;nbsp #{data.sub_total} td span.taxRate(name='item_tax_total[]',disabled) i.fa.fa-inr &amp;nbsp #{data.tax_amount} td span.netTotal(name='subtotal[]',disabled) i.fa.fa-inr &amp;nbsp #{data.net_total} td span(name='remove',disabled) a(href='#', title='Delete') i.icon-remove $('#btn_save_invoice').click(function(){ var data={}; data.invoiceId= $('.invoiceId').val(); data.itemName=$('.itemName').map( function(){return $(this).val(); }).get(); data.itemDescription=$('.itemDes…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44077671
type: Question

http://stackoverflow.com/a/42736147
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27825220
has body: PM2 should automatically restart apps, but there are a few alternative ways to ensure PM2 will do this (including the --watch command you've already linked to). The route I've taken is: $ pm2 startup systemd PM2 will then output instructions to execute the following command (note, I'd recommend copy/pasting the output from the above startup command rather than using my example below): $ sudo su -c "env PATH=$PATH:/usr/bin pm2 startup systemd -u USERNAME --hp /home/USERNAME" This will create the environment variables to restart your processes if the app crashes or the server reboots.
has comment: http://stackoverflow.com/comment/99086287

http://stackoverflow.com/q/27808138
has answer: http://stackoverflow.com/a/27808390
score: 0
has comment: http://stackoverflow.com/comment/44025743
answer count: 1
tagged with: load
has body: I am currently making a simple game (My first) with HTML and Javascript. This is the code for saving: function save() { var save = { ducks: ducks, ponds: ponds, pondCost: pondCost, ponds: ponds, vacuums: vacuums, vacuumCost: vacuumCost, vacuum: vacuum, llama: llama, llamaCost: llamaCost, llamas: llamas } localStorage.setItem("save",JSON.stringify(save)); }; And this is the code for loading: function load() { var savegame = JSON.parse(localStorage.getItem("save")); if (typeof savegame.ducks !== "undefined") ducks = savegame.ducks; if (typeof savegame.ponds !== "undefined") ponds = savegame.ponds; if (typeof savegame.pond !== "undefined") pond = savegame.pond; if (typeof savegame.pondCost !== "undefined") pondCost = savegame.pondCost; if (typeof savegame.vacuums !== "undefined") vacuums = savegame.vacuums; if (typeof savegame.vacuum !== "undefined") vacuum = savegame.vacuum; if (typeof savegame.vacuumCost !== "undefined") vacuumCost = savegame.vacuumcost; if (typeof savegame.llama !== "undefined") llama = savegame.llama; if (typeof savegame.llamas !== "undefined") llamas = savegame.llamas; if (typeof savegame.llamaCost !== "undefined") llamaCost = savegame.llamaCost; document.getElementById('ponds').innerHTML = ponds; document.getElementById('vacuums').innerHTML = vacuums; document.getElementById('vacuumCost').innerHTML = nextCost; document.getElementById('pondCost').innerHTML = nextCost; }; I also added a reset feature but as soon as I added this in and pressed the reset button, saving isn't working! (or loading) function reset() { localStorage.removeItem("save") } All of these buttons are attached to a button in my HTML. Play the game in your browser: https://dl.dropboxusercontent.com/u/104187515/TIGWNN/index.html
accepted answer: http://stackoverflow.com/a/27808390
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44028753
tagged with: save
type: Question
tagged with: function
has title: Saving and loading in Javascript not working
tagged with: javascript

http://stackoverflow.com/comment/44219585
score: 0
type: Comment
type: QuestionComment
has text: Don't check window width, use instead `window.matchMedia` and any polyfill to support older browsers if needed https://developer.mozilla.org/en-US/docs/Web/API/Window.matchMedia
comment on: http://stackoverflow.com/q/27910024

http://stackoverflow.com/comment/44028606
type: AnswerComment
has text: @Derek朕會功夫 How might I go about doing this?
type: Comment
comment on: http://stackoverflow.com/a/27809748
score: 0

http://stackoverflow.com/comment/44198580
comment on: http://stackoverflow.com/q/27899035
has text: @DeepakKumarPadhy Can you show us the code you are using to show the modal popup and tell us what plugin you are using? Getting that to work correctly is the problem to solve. How to get form values to show up in `innerHTML` is probably not a problem that needs to be solved.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44207509
score: 1
has text: https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.setTimeout
comment on: http://stackoverflow.com/q/27904206
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44274730
type: Comment
type: QuestionComment
has text: Could you create a live example? jsFiddle or similar.
comment on: http://stackoverflow.com/q/27938525
score: 0

http://stackoverflow.com/q/27951899
has answer: http://stackoverflow.com/a/27952286
tagged with: angularjs
type: AnsweredQuestion
has title: AngularJS: Changing object does not update field but changing string directly does
has body: I feel like this is something trivial, but I've been stuck for awhile. I have an object user, set in the directive UserSettings. The directive's element contains a button with html {{user.name}} to open a model for user settings. When the page loads user.name is set. The user settings form in the modal is contained by a controller called UserSettingsForm. I've been trying to debug the controller and I'm confused by the behavior I'm seeing. console.log @$scope.user # debug to show user object is there @$scope.test = angular.copy(@$scope.user) # set test equal to a copy of user @$scope.test.name = 'wowee' # change test object's 'name' property @$scope.user = angular.copy(@$scope.test) # set user back to test console.log @$scope.test # test is changed console.log @$scope.user # user is equivalent to test The above debugging works as expected, but the unexpected part (for me, at least) is the fact that {{user.name}} in the nav bar is not being updated. But when I do @$scope.user.name = @$scope.test.name the {{user.name}} field in the HTML is updated. I am admittedly an angular noob (even though this is probably a JavaScript concept), but the logic I'm having trouble with doesn't make sense to me and I would be very appreciative if someone could clear it up for me, and maybe even give me a push in the right direction as far as properly updating the user object to equal the test object. test will eventually be an instance of the user settings form and only when the data is saved successfully will that instance be saved as user.
accepted answer: http://stackoverflow.com/a/27952286
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/44122784
score: 0
type: Comment
type: QuestionComment
has text: @undone You're right I don't! Thanks alot :)
comment on: http://stackoverflow.com/q/27860121

http://stackoverflow.com/q/27870828
has comment: http://stackoverflow.com/comment/44144334
tagged with: php
has comment: http://stackoverflow.com/comment/44144258
has answer: http://stackoverflow.com/a/27887564
upvote count: 0
tagged with: codeigniter
has answer: http://stackoverflow.com/a/27871371
type: Question
score: -2
linked to: http://stackoverflow.com/q/8567114
has body: This is my code (im using codeigniter as my framework and this is the view). This code should write the div named contain's content to the file called newfile.php after the submit button is clicked. But I need to click the button 2 times before it writes the data into the newfile.php. Help please. I don't know what's wrong with my code. Online Lodging Locator Online Lodging Locator COL 1 - ROW 1222 COLSPAN 3 COL 2 - ROW 1 COL 3 - ROW 1 COL 2 - ROW 2 - COLSPAN 2 COL 3 - ROW 2 COL 3 - ROW 3 WRITE
tagged with: javascript
downvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/44144206
favorite count: 0
has comment: http://stackoverflow.com/comment/44144324
has title: Why do I need to press the submit button 2 times before the javascript function work?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27871331
has comment: http://stackoverflow.com/comment/44144628
has comment: http://stackoverflow.com/comment/44144108

http://stackoverflow.com/comment/44148547
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27873103
type: Comment
has text: @nnnnnn THANK YOU! I just switched it and it worked! could you explain what the difference between these two are? and yes, I thought about using .split() because I assumed # would be kept, but I was mistaken.

http://stackoverflow.com/comment/44093671
comment on: http://stackoverflow.com/a/27839574
has text: Got it. Any idea on how to right a fallback statement?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44193972
has text: Have you defined jQuery in your HTML ?
comment on: http://stackoverflow.com/q/27896769
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27944600
has comment: http://stackoverflow.com/comment/44284527
tagged with: javascript
has body: So I'm afraid to say I'm a newbie in need of help. I am in charge of a school website and it has a prebuilt block which can be used to display certain content depending on the device. However, it cannot tell the difference between android tablets and phones and as such always shows the mobile version. Is there a way I could set this up manually to identify the user device? Many thanks in advance! Rob
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/6666907
tagged with: mobile
has answer: http://stackoverflow.com/a/27944655
has comment: http://stackoverflow.com/comment/44284483
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44284613
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/53112310
type: Question
has title: Using CSS or JS to identify device type
has answer: http://stackoverflow.com/a/27944899

http://stackoverflow.com/q/27808398
favorite count: 0
has comment: http://stackoverflow.com/comment/44026190
type: UnansweredQuestion
has body: I have a folder which has bunch of files. I use below code to upload multiple files: &lt;form method="post" enctype="multipart/form-data"&gt; &lt;input type="file" name="files[]" id="files" multiple="" directory="" webkitdirectory="" mozdirectory=""&gt; &lt;input class="button" type="submit" value="Upload" /&gt; &lt;/form&gt; It works fine but it does not upload parent folder why? I also want to upload the folder which files belong.
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/20429960
has answer: http://stackoverflow.com/a/27808596
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44025924
tagged with: javascript
upvote count: 1
answer count: 1
downvote count: 0
has title: How to upload files with their folder?

http://stackoverflow.com/q/27953074
favorite count: 0
type: UnansweredQuestion
has body: I have seen online javascript obfuscation tools. Would it be feasible or considered reasonable to have such a process run as a part of the build procedure for a web application, or how is obfuscation generally achieved? Is it more of a manual process of creating a backup of the javascript to store with the project, and then running the contents through an obfuscator before doing a build? It seems like it would be cool to have an ant task that you could include as part of the build to handle that for you
tagged with: build
score: 3
upvote count: 3
type: Question
has title: javascript obfuscation as part of build process
tagged with: ant
downvote count: 0
tagged with: javascript
tagged with: deobfuscation
has answer: http://stackoverflow.com/a/27962395
answer count: 1
tagged with: obfuscation

http://stackoverflow.com/q/27886618
tagged with: internet-explorer
has body: reCAPTCHA works perfectly well in Chrome. However, (only when reCAPTCHA iframe is inside a dialog box or a modal) in IE the placeholder won't go away. Whatever the user writes is considered part of the placeholder (I think) and the "verify" button won't be enabled to be clicked. The picture explains this: The same code works perfectly well in all browsers when I take the recaptcha div outside the modal Launch modal
tagged with: javascript
answer count: 3
tagged with: modal-dialog
downvote count: 0
tagged with: recaptcha
favorite count: 0
tagged with: twitter-bootstrap
has title: Problems with new Google reCAPTCHA in IE when inside modal or dialog
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/40762596
score: 11
upvote count: 11
has answer: http://stackoverflow.com/a/28673158
type: Question
has answer: http://stackoverflow.com/a/28965638

http://stackoverflow.com/q/27895182
tagged with: javascript
favorite count: 0
has body: When I call d3.start() on a d3.js force directed I generate a graph with nodes and edges in particular locations. However, when I call start again with the same data, the positioning of the nodes is different than previously. Is there a way to make it so that nodes are positioned in the same positions each time? Do I absolutely set the first nodes position, and then somehow position relatively to that first nodes position each time?Thanks. My code for building the d3-force graph is boilerplate. And following my collection of data from my internal json and creating the node and link objects I call setTimeout(function(){ var n = node.size(); node.forEach(function(d, i) { d.x = d.y = width / n * i; }); console.log(node); setTimeout(function(){ force.start(); for (var i = 0; i &lt; n; ++i) force.tick(); force.stop(); },300); },100); where node is the array of circle objects I use for nodes...Also it does not seem like the nodes are initializing along the diagonal for when I first call start. Any thoughts? Thanks!
possible better answer: http://stackoverflow.com/a/53609415
tagged with: d3.js
upvote count: 1
has answer: http://stackoverflow.com/a/27895256
accepted answer: http://stackoverflow.com/a/27895256
type: Question
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/53609415
tagged with: coordinates
tagged with: graph
has title: How to make it so D3 Force Directed Graph generates nodes in same position each time
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/44271055
comment on: http://stackoverflow.com/a/27936566
has text: do I really need these transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd ??
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44129949
has text: There are some typos in my question, that's why "=" is used where ":" should be. Thanks for pointing that out.The same goes for "dataType", I'll fix that. localReader did the trick. Thank you very much!!
comment on: http://stackoverflow.com/a/27863166
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44179638
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27888269
has text: Just out of curiosity how would this be written in plain JavaScript?

http://stackoverflow.com/q/27913627
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/27913762
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44226483
has comment: http://stackoverflow.com/comment/44226760
type: Question
has title: Reload jQuery content
has body: I am using the jQuery slider library pixedelic camera. I chose this library, because it is free and very easy to use. Basically all you need to put in your code is: + some include scripts I want to let user to add image dynamically, without page refresh. Thanks to simplicity of input source I thought, that it will be very easy -> just append new div to slideshow. $('#some_button').click(function(){ $('#camera_wrap_1').append(' '); }) But the problem is that this slideshow is generated "onload" of the page, and is rewriting this simple input in to more complex structure. That means, that this simple append will not work, because is added on the run. Is there any chance, how to use jQuery, Ajax or anything to refresh div #tendiv to force jquery to generate new content?
has comment: http://stackoverflow.com/comment/44227387

http://stackoverflow.com/a/72637405
upvote count: 1
has body: // comments out the text until the end of the line /* comments out everything, irrespective of line endings, until it encounters */ Since the */ is at the end of the line in your example, there is effectively no difference. However, there is a reason why you sometimes see /* */ comments instead of // comments for a CDATA section. Specifically, if the HTTP response body was being assembled programmatically, and you didn't have control over it, and the process removed line break characters it deemed unnecessary (in order to minimize the size of the output), and your script immediately followed the CDATA comment (because the process overzealously removed a line break it shouldn't have), it might look like this: //&lt;![CDATA[var MyVariable = 'This statement does something.'; In this case, MyVariable would not be declared or assigned because the statement is really just part of the comment. But if /* */ were used, as in this example: /*&lt;![CDATA[*/var MyVariable = 'This statement does something.'; ...the comment ends before the code begins and the code would be executed as intended. It's a fine point, but that's the reason you see it done.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27961119

http://stackoverflow.com/a/27837521
has body: you can put class like .listClass in every item of list and add javascript function like $(".listClass").click(function(){ called on each item click }) and its working fine here link
answers question: http://stackoverflow.com/q/27837442
has comment: http://stackoverflow.com/comment/44079821
has comment: http://stackoverflow.com/comment/44079677
score: 0
type: Answer

http://stackoverflow.com/comment/44082805
has text: What is the regular expression you already have? If you have none try http://regex101.com .
comment on: http://stackoverflow.com/q/27839516
type: Comment
type: QuestionComment
score: 1

syntactic-sugar
tags question: http://stackoverflow.com/q/27912830
type: Tag
tag name: syntactic-sugar

http://stackoverflow.com/a/27849993
downvote count: 0
score: 7
has body: If you use a you can use the valueAsNumber property const elNum = document.querySelector("#num"); console.log(elNum.valueAsNumber, typeof elNum.valueAsNumber); // 11.22 // number Otherwise, since HTMLInputElement.prototype.value (for elements) returns always a string, convert your numeric string to number using one of these: parseInt(value, 10); // Parsing string as integer (whole number) from left to right. parseFloat(value); // Parsing string as floating point number (decimal) from left to right. Number(value); // Converting entire string to number. JSBin demo. Alternatively, add a unary + before the value: +value; // Equivalent to `Number(value)`. To be totally sure your value is a number, you can also do: if(!isNaN(parseFloat(el.value)) && isFinite(el.value)){ // true if element’s value is a number (or a number in string) } For example: var uw = document.getElementById("wakken"); var ui = document.getElementById("ijsberen"); var up = document.getElementById("penguins"); // Log strings console.log(uw.value); // "5" console.log(ui.value); // "5" console.log(up.value); // "0" // Log numbers console.log(Number(uw.value)); // 5 console.log(+uw.value); // 5 console.log(parseInt(ui.value, 10)); // 5 console.log(parseFloat(up.value)); // 0 Don’t forget to read the documentation: parseInt parseFloat Number Unary +
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/44115530
answers question: http://stackoverflow.com/q/27849944

http://stackoverflow.com/a/27808079
score: 2
has body: absolute minimum RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php the technical term is Front Controller :http://en.wikipedia.org/wiki/Front_Controller_pattern
accepted answer of: http://stackoverflow.com/q/27807939
downvote count: 0
upvote count: 2
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27807939

http://stackoverflow.com/a/27942423
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44281511
accepted answer of: http://stackoverflow.com/q/27942159
type: Answer
answers question: http://stackoverflow.com/q/27942159
has comment: http://stackoverflow.com/comment/44281661
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44281864
has body: Assuming what your Javascript look like, you are using jQuery, here's a sample code based on of your actual javascript code $(document).ready(function(){ activeItem = $("#DOTD li:first"); $(activeItem).addClass('active'); $("#DOTD li").click(function(){ $(activeItem).animate({width: "28px"}, {duration:300, queue:false}); $(this).animate({width: "741px"}, {duration:300, queue:false}); activeItem = this; }); var d = new Date(); var n = d.getDay(); $("li").eq(n-1).trigger("click"); }); Solution and more informations found here for getting the day of week, and here to trigger the click function

http://stackoverflow.com/comment/44060100
type: QuestionComment
type: Comment
has text: Because there is no element with id `textbox`?
score: 0
comment on: http://stackoverflow.com/q/27827135

http://stackoverflow.com/comment/44079092
has text: @Peter I agree, but u mentioned example was not supporting to redirect based on user. Please help
type: Comment
comment on: http://stackoverflow.com/a/27835449
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44307524
type: Comment
has text: JQuery .scroll() might help
comment on: http://stackoverflow.com/a/27956388
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44236914
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27919583
has text: It's 4.1.3 I believe.

http://stackoverflow.com/comment/127438277
score: 0
type: Comment
type: AnswerComment
has text: This is an interesting solution but don't you find it a bit nasty. I'm trying to justify myself using it :)
comment on: http://stackoverflow.com/a/34186494

http://stackoverflow.com/comment/82300202
type: AnswerComment
has text: If you place a div below it, that div will be pushed down. Would be nice if it overlapped, like a select box dropdown does.
type: Comment
comment on: http://stackoverflow.com/a/27945491
score: 0

http://stackoverflow.com/q/27830547
has answer: http://stackoverflow.com/a/27830648
favorite count: 0
type: Question
has title: Is the space position important in these spans?
has comment: http://stackoverflow.com/comment/44067079
tagged with: whitespace
accepted answer: http://stackoverflow.com/a/27830618
has comment: http://stackoverflow.com/comment/44067073
upvote count: 3
has answer: http://stackoverflow.com/a/27830596
tagged with: dom
has body: Starting from this DOM: LoremIpsum For accessibility reasons, we had to add a space so that the two words are not adjacent (read as "Lorem Ipsum" and not "LoremIpsum"). Regular display is identical because of the CSS (display:block). So we have: Lorem Ipsum However, due to some JavaScript, it would be more convenient to have this: Lorem Ipsum Is this totally equivalent? Could the space be mangled this way?
answer count: 4
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27830618
tagged with: accessibility
has answer: http://stackoverflow.com/a/27831052
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44067150
score: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27830648

http://stackoverflow.com/a/69941322
upvote count: 0
has body: If moment.js is too heavy for your use-case: I've wrapped up a small package to facilitate this: import { parse, serialize } from 'tinyduration'; // Basic parsing const durationObj = parse('P1Y2M3DT4H5M6S'); assert(durationObj, { years: 1, months: 2, days: 3, hours: 4, minutes: 5, seconds: 6 }); // Serialization assert(serialize(durationObj), 'P1Y2M3DT4H5M6S'); Install using npm install --save tinyduration or yarn add tinyduration See: https://www.npmjs.com/package/tinyduration
answers question: http://stackoverflow.com/q/27851832
downvote count: 2
type: Answer
score: -2

http://stackoverflow.com/comment/44184386
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27879254
type: AnswerComment
has text: @jmore009 Figured out a way to do this :) http://stackoverflow.com/a/27891665/2680216

http://stackoverflow.com/comment/44150540
type: AnswerComment
score: 0
has text: setValue(0:00) will cause the error. I think javascript don't understand 0:00 (it's not a string nor a number)
type: Comment
comment on: http://stackoverflow.com/a/27873773

http://stackoverflow.com/comment/44207488
type: Comment
type: QuestionComment
has text: Try with ng-if and setting mode.state to true after the first batch of markers has been loaded, ng-show messes with ui-gmap in my application and positions it wrong
comment on: http://stackoverflow.com/q/27879605
score: 0

http://stackoverflow.com/q/27859601
tagged with: phantomjs
has title: Headless JavaScript Testing HTML5 audio/ video
tagged with: headless
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/44180535
has comment: http://stackoverflow.com/comment/44122830
tagged with: javascript
has comment: http://stackoverflow.com/comment/46931473
has answer: http://stackoverflow.com/a/43338325
downvote count: 0
answer count: 1
has body: I know that there is a lot of other similar questions, however the answers don't provide a way round this problem. I have a JavaScript file used on my website that uses the HTML 5 Web Audio and want to unit test it. I have looked at using QUnit with PhantomJS and before you say anything I know that Phantom doesn't support it (http://phantomjs.org/supported-web-standards.html) however I want to know if there is a way around this? Testing it using QUnit in the browser works as you would expect but I don't want to have to test it using the browser every time, I want it to be automated on the server. An example of one of the tests that fails: QUnit.test("isPlaying", function(assert){ // true case My.Sound.play("background"); assert.ok(My.Sound.isPlaying("background"), "The background audio is playing"); // false case My.Sound.pause("background"); assert.ok(!My.Sound.isPlaying("background"), "The background audio is not playing"); });
tagged with: qunit
score: 8
favorite count: 0
upvote count: 8
type: UnansweredQuestion

http://stackoverflow.com/comment/124234830
type: Comment
comment on: http://stackoverflow.com/a/29738691
score: 0
type: AnswerComment
has text: This is for jupyter. You can still use RAW rather than markdown, Looks Jupyter no longer uses JQuery. Include script-JQuery from your favorite CDN. Change "$('div.input')" to "$('div.jp-Cell-inputArea')" and it works as originally designed.

http://stackoverflow.com/comment/44038104
has text: @BrentWhite That's not the purpose of TAGs
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27815833

http://stackoverflow.com/comment/44241868
type: Comment
comment on: http://stackoverflow.com/a/27921561
has text: If you change the default to -1 it will put them all as -1. What I am saying is that rsUserAnswers("Score1") has a value of -1. but (rsUserAnswers("Score1") is a column by itself in sql now if you have 8 of them numbered respectively you have 8 columns of information that either hold -1 or null. that goes into one td
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44300519
score: 1
comment on: http://stackoverflow.com/q/27944570
type: Comment
type: QuestionComment
has text: The 500 error isn't coming from SQL, or you'd see it when there were no results as well. I'm assuming, then, that the error is in how you handle the results when you get them. I'd revisit the contents of your loop on sqlsrv_fetch_array, because you might be handling the returned values incorrectly.

http://stackoverflow.com/comment/44116719
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27856646
has text: @SergiuParaschiv See my updated post. I think it is `$apply`ed because when having the console open, the view is updated...
score: 0

http://stackoverflow.com/q/27864081
has answer: http://stackoverflow.com/a/27864122
type: AnsweredQuestion
tagged with: twitter
type: Question
possible better answer: http://stackoverflow.com/a/27864160
answer count: 2
has answer: http://stackoverflow.com/a/27864160
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27864122
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: How to show my twitter feeds on a static webpage?
has body: I have a static HTML webpage which is not capable to run php or connect with MySQL. I used this page to create my personal home page. I am very interested to list my last 20 tweets in this page. Is there an easy way to fetch those tweets from twitter.com and then show them in my static homepage ? I am open to any technology that work best for this job.

http://stackoverflow.com/comment/44076119
type: Comment
comment on: http://stackoverflow.com/q/27835494
score: 0
has text: @TechGirl, na, it wont solve problem.
type: QuestionComment

http://stackoverflow.com/a/27947425
type: Answer
upvote count: 39
has comment: http://stackoverflow.com/comment/44295425
downvote count: 0
has comment: http://stackoverflow.com/comment/44295644
has comment: http://stackoverflow.com/comment/44295356
has comment: http://stackoverflow.com/comment/115145240
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27947094
has body: Remember that isDisplayed() returns a promise, you can try with: element(anyFinder).isDisplayed().then(function(result) { if ( result ) { //Whatever if it is true (displayed) } else { //Whatever if it is false (not displayed) } });
has comment: http://stackoverflow.com/comment/61515917
answers question: http://stackoverflow.com/q/27947094
score: 39
has comment: http://stackoverflow.com/comment/44290559

http://stackoverflow.com/comment/44073710
has text: I agree, but that's my problem in comprehending this. I'm actually returning an object in my factory function that links to a function w/parenthesis, which means I'm calling it via the link. e.g., return { stories: listStories, getStories: getStories('/crime/json/stories.json') };
comment on: http://stackoverflow.com/q/27833553
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27891898
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/44184929
has comment: http://stackoverflow.com/comment/44184967
has comment: http://stackoverflow.com/comment/44185179
has comment: http://stackoverflow.com/comment/44185115
upvote count: 1
has body: Your month variable is going to be a jquery object. You need to extract the string value for the month. But from what I can tell, this doesn't seem necessary. You can just assign the event listener directly to the object inside the each Try doing: $('[data-month]').each(function(i, monthEl) { $(monthEl).bind('click', function() { // If you need to get the month value, you can use jQuery's .data() var monthString = $(monthEl).data('month'); }); });
accepted answer of: http://stackoverflow.com/q/27891875
has comment: http://stackoverflow.com/comment/44185330
has comment: http://stackoverflow.com/comment/44185221
answers question: http://stackoverflow.com/q/27891875
has comment: http://stackoverflow.com/comment/44184982
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44138141
comment on: http://stackoverflow.com/a/27867729
type: Comment
score: 0
has text: ng-repeat="category in currentDiscount.DiscountProducts | filter: {ProductCategoryType: 'C'}" Worked. @DeborahK Do you want to create an answer with your solution so that I can mark it as accepted?
type: AnswerComment

http://stackoverflow.com/a/27946108
answers question: http://stackoverflow.com/q/27946063
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27946063
has body: Check the "both" condition first, else that condition will never be checked: if( $('#project-wrapper').hasClass('activated') &amp;&amp; $('#contact-me').hasClass('activated') ) { $('#contact-me, #project-wrapper').removeClass('activated'); } else if($('#project-wrapper').hasClass('activated')){ $('#project-wrapper').removeClass('activated').css('max-height', ''); } else if($('#contact-me').hasClass('activated')){ $('#contact-me').removeClass('activated'); } else { }
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/q/27934885
favorite count: 0
has answer: http://stackoverflow.com/a/60790193
has answer: http://stackoverflow.com/a/62953615
possible better answer: http://stackoverflow.com/a/50790330
has answer: http://stackoverflow.com/a/29738691
has answer: http://stackoverflow.com/a/64355177
has body: I have an ipython/jupyter notebook that I visualize using NBviewer. How can I hide all the code from the notebook rendered by NBviewer, so that only the output of code (e.g. plots and tables) and the markdown cells are shown?
has answer: http://stackoverflow.com/a/50790330
has answer: http://stackoverflow.com/a/31461570
has answer: http://stackoverflow.com/a/48028153
score: 201
has answer: http://stackoverflow.com/a/77609696
tagged with: jupyter-notebook
has answer: http://stackoverflow.com/a/34192347
has answer: http://stackoverflow.com/a/66229150
has answer: http://stackoverflow.com/a/54530234
has answer: http://stackoverflow.com/a/68005801
has answer: http://stackoverflow.com/a/31839519
downvote count: 0
has comment: http://stackoverflow.com/comment/58674939
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20290369
has title: How to hide code from cells in ipython notebook visualized with nbviewer?
has answer: http://stackoverflow.com/a/47017746
upvote count: 201
has answer: http://stackoverflow.com/a/71361472
tagged with: ipython
linked to: http://stackoverflow.com/q/24062013
has answer: http://stackoverflow.com/a/28073228
accepted answer: http://stackoverflow.com/a/28073228
type: Question
has comment: http://stackoverflow.com/comment/128918809
has comment: http://stackoverflow.com/comment/103722082
has answer: http://stackoverflow.com/a/34043321
has answer: http://stackoverflow.com/a/31434967
has answer: http://stackoverflow.com/a/30021148
has answer: http://stackoverflow.com/a/61219765
tagged with: javascript
has answer: http://stackoverflow.com/a/53136940
has answer: http://stackoverflow.com/a/38215176
answer count: 24
has answer: http://stackoverflow.com/a/34898976
has answer: http://stackoverflow.com/a/75023387

http://stackoverflow.com/q/27930803
tagged with: force-layout
score: 1
accepted answer: http://stackoverflow.com/a/27931438
type: Question
has body: When I add new nodes to D3's Force Layout, the new nodes ignore the previous nodes when positioning itself and the previous nodes becomes un-draggable. I feel I've followed the logic of: Add elements to arrays nodes and links Updated force.nodes(nodes) and force.links(links) Ran through .data().enter() with new data Called force.start() But still results in previous nodes disconnects. The new nodes are draggable and appears to take into consideration the LAST SET of added nodes position and avoids collision, all other previous nodes are clickable still, but their positioning are ignored and not updated. Here is a the code in PLNKR: http://plnkr.co/edit/5fXZf63s73cTO37zLjNQ?p=preview var width = 1000; var height = 600; var node_w = 30; var node_h = 30; var text_dx = -20; var text_dy = 20; var new_id = 9; var nodes = [], links = [], links_line, node_circles; var svg = d3.select("body").append("svg") .attr("width",width) .attr("height",height); var nodes = [ { "name": "Nucleus" , "size" : 25, "id" : 0 , "color":"#ac0000"}, { "name": "one" , "size" : 5 , "id": 1 , "color": "#ac0"}, { "name": "two" , "size" : 15 , "id": 2 , "color": "#ac0"}, { "name": "three" , "size" : 25 , "id": 3 , "color": "#ac0"}, { "name": "four" , "size" : 9 , "id": 4 , "color": "#ac0"}, { "name": "five" , "size" : 12 , "id": 5 , "color": "#ac0"}, { "name": "six" , "size" : 15 , "id": 6 , "color": "#ac0"}, { "name": "seven" , "size" : 41 , "id": 7 , "color": "#ac0"}, { "name": "eight" , "size" : 5 , "id": 8 , "color": "#ac0"} ]; var links = [ { "source": 0 , "target": 1 , "link_info":"r01" }, { "source": 1 , "target": 2 , "link_info":"r31" }, { "source": 1 , "target": 3 , "link_info":"r02" }, { "source": 1 , "target": 4 , "link_info":"r04" }, { "source": 0 , "target": 5 , "link_info":"r05" }, { "source": 0 , "target": 6 , "link_info":"r06" }, { "source": 0 , "target": 7 , "link_info":"r87" }, { "source": 0 , "target": 8 , "link_info":"r87" } ]; var force = d3.layout.force() .nodes(nodes) .links(li…
tagged with: javascript
has answer: http://stackoverflow.com/a/27931438
upvote count: 1
downvote count: 0
answer count: 1
favorite count: 0
tagged with: d3.js
has title: D3JS Force Layout new nodes disconnects existing nodes
type: AnsweredQuestion

http://stackoverflow.com/q/27860039
has title: Change background color of a datatable
tagged with: css
has answer: http://stackoverflow.com/a/27860105
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27860105
has body: I am trying to change background of a &lt;tr&gt; of a datatable which is like this. var lastIdx = null; var t = $("#campaigns_list").DataTable(); t.rows.add(['.$str_json.']).draw(); $("#campaigns_list tr").not(":first").hover( function() { $(this).css("background", "yellow"); }, function() { alert("bye"); } ); But I don't know why, the background-color of the &lt;tr&gt; isn't changing. $(this).css("background","yellow"); This code seems to be unable to change color. However, the hover function do call itself, cause if I am replacing the above line with an alert then the alert is happening fine.
downvote count: 1
type: Question
answer count: 2
upvote count: 0
possible better answer: http://stackoverflow.com/a/27860125
tagged with: javascript
has answer: http://stackoverflow.com/a/27860125
tagged with: jquery
has comment: http://stackoverflow.com/comment/44122461
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44122495
has comment: http://stackoverflow.com/comment/44122726
score: -1
favorite count: 0

http://stackoverflow.com/q/27807183
has comment: http://stackoverflow.com/comment/44023490
has comment: http://stackoverflow.com/comment/44023475
has answer: http://stackoverflow.com/a/27807264
has comment: http://stackoverflow.com/comment/44023635
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44023514
has comment: http://stackoverflow.com/comment/44023486
upvote count: 1
has comment: http://stackoverflow.com/comment/44023622
downvote count: 1
has comment: http://stackoverflow.com/comment/44023667
favorite count: 0
has comment: http://stackoverflow.com/comment/44023534
has body: I have some var data which might have a data[0].substring(1)[1] or it might won't (regarding the .substring()) I can't change the data I receive, neither does it come in a specified format. Please don't ask about it, the idea of this question is precisely to answer in this scenario. I tried to do this if(data[0].substring(1)[1]){ } but it fails anyway with Cannot read property 'substring' of undefined so now I'm in doubt on how I should do this. Is this possible? Is there a workaround?
has comment: http://stackoverflow.com/comment/44023385
has comment: http://stackoverflow.com/comment/44023346
possible better answer: http://stackoverflow.com/a/27807264
type: AnsweredQuestion
has title: Detect error in javascript (in code) and act accordingly
accepted answer: http://stackoverflow.com/a/27807277
tagged with: error-handling
has comment: http://stackoverflow.com/comment/44023546
type: Question
has answer: http://stackoverflow.com/a/27807277
has comment: http://stackoverflow.com/comment/44023456
tagged with: javascript

http://stackoverflow.com/comment/44273400
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27937456
score: 0
has text: @amit can you explain little more

http://stackoverflow.com/comment/44244936
has text: and yet under "related" questions the top two links have exactly what you need...
type: Comment
comment on: http://stackoverflow.com/q/27924037
score: 3
type: QuestionComment

http://stackoverflow.com/q/27921599
tagged with: page.js
downvote count: 0
tagged with: javascript
has body: I would like to know if it's possible to use page.js with sinatra. My images's route are intercepted by Sinatra instead of Page.js get '/' do erb :index end __END__ @@ layout page.js <%= yield %> @@ index index videos images hello world
tagged with: sinatra
answer count: 1
has title: using page.js with sinatra (or rails)
favorite count: 0
accepted answer: http://stackoverflow.com/a/27922669
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/27922669
type: AnsweredQuestion
score: 1
type: Question
upvote count: 1

http://stackoverflow.com/comment/137515007
type: Comment
has text: "ClipboardItem is not defined" >>> https://stackoverflow.com/a/73155896/3957754
comment on: http://stackoverflow.com/a/59462270
score: 0
type: AnswerComment

http://stackoverflow.com/q/27878477
tagged with: ejabberd
type: Question
has body: I can't figure out why Ejabberd (14.07 & 14.12) is Closing a BOSH session after receiving an 'available' stanza for that same session. I am using JsJac as web client lib and the session is being prebound server side and JsJac is doing 'inherit' on first page load and als on restart. The scenario in which this happens is after a successful connection and chat, i disable the network connection using chrome developer tools. Ejabberd pings every 15 Seconds and is set to 'kill' on timeout. The Inactivity_timeout for BOSH in ejabberd.yml is set to 480. The user can then click a link to try to reconnect. This is calling the exact same function as the initial prebind+client side inherit. After seemingly successful reconnect, a few seconds later, this: Close session for anonymous.c6502a950667fc79c3e1534559cc02e0@localhost/7f317c7fcbb9fb1b79c414c2d8afe05c appears in the ejabberd log and a stanza of unavailable is sent to the other party in the chat. Question: anybody have any idea why the BOSH session might be closed? Here is the relevant piece of the Ejabberd log 2015-01-09 18:25:21.308 [debug] <0.2710.0>@ejabberd_receiver:process_data:343 Received XML on stream = <<"<presence from=\"anonymous.c6502a950667fc79c3e1534559cc02e0@jaxlecho.localhost\" type=\"available\"/>">> 2015-01-09 18:25:21.309 [debug] <0.2710.0>@shaper:update:117 State: {maxrate,50000,1899.4311619841992,1420824321273332}, Size=97 M=0.9887812185897407, I=35.836 2015-01-09 18:25:21.390 [info] <0.2709.0>@ejabberd_listener:accept:313 (#Port<0.41723>) Accepted connection ::FFFF:127.0.0.1:58483 -> ::FFFF:127.0.0.1:5280 2015-01-09 18:25:21.391 [debug] <0.5331.0>@ejabberd_http:init:145 S: [{[<<"presence">>],mod_webpresence},{[<<"captcha">>],ejabberd_captcha},{[<<"admin">>],ejabberd_web_admin},{[<<"http-bind">>],mod_http_bind},{[<<"http-poll">>],ejabberd_http_poll}] 2015-01-09 18:25:21.391 [info] <0.5331.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.41723>} 2015-01-09 18:25:21.392 [debug] <0.5331.0>@ejabberd_ht…
answer count: 1
tagged with: javascript
tagged with: erlang
has answer: http://stackoverflow.com/a/27885170
has title: Ejabberd Closes BOSH session after available presence
score: 0
tagged with: xmpp
type: UnansweredQuestion
tagged with: jsjac

http://stackoverflow.com/q/27824948
tagged with: server-sent-events
upvote count: 21
type: Question
has title: How to determine that an SSE connection was closed?
has answer: http://stackoverflow.com/a/54385424
has answer: http://stackoverflow.com/a/27825561
accepted answer: http://stackoverflow.com/a/27840379
downvote count: 0
tagged with: javascript
score: 21
answer count: 4
favorite count: 0
has body: We have an SSE (Server-Sent Events) connection open in JavaScript which can time to time get closed, either because of server restarts or other causes. In that case it would be good to reestablish the connection. How to do it? Is there a way to find out on the client side that the connection was closed? Here: https://developer.mozilla.org/en-US/docs/Web/API/EventSource I found only a way to close the connection, but no callback or a test method for determining whether the connection is still alive. Thank you for your help.
has answer: http://stackoverflow.com/a/27840379
possible better answer: http://stackoverflow.com/a/52485539
has answer: http://stackoverflow.com/a/52485539
type: AnsweredQuestion

http://stackoverflow.com/q/27846333
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: php
has answer: http://stackoverflow.com/a/27846428
accepted answer: http://stackoverflow.com/a/27846428
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44096651
score: 1
upvote count: 1
has body: Hello smarter people, So as the title conveys, i'm having some difficulties, and I've wasted a good 8 hours trying to figure it out :) I posted a Question earlier, to which I got no answers. I was having difficulties with my ajax, and it's interaction with a form. This form is in an admin panel, and is for dynamically creating and editing navigation links on the front end of my (hopefully) soon-too-be site. My problem specifically is: I am unable to, via ajax, have the text-content of the anchor tag (which causes the form to dropdown), to immediately reflect on screen... http://i1379.photobucket.com/albums/ah126/conchairtoe/3_zpsb897a6a4.png As you can see, the ajax has run, no errors, yet the label (anchor tag for enacting drop-down form) remains "test", when I typed "testing!!!!!!" in. Everything behind the scenes worked, as the database successfully updates the corresponding data, and so does the anchor tag text once i reload the page, but that ain't very ajaxy now is it! Here's the Javascript for when the form is submitted. // NAV ITEM FORM - UPDATE / SUBMIT $(".nav-form").submit(function(event) { var navData = $(this).serializeArray(); // The serializeArray( ) method serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with. var navLabel = $('input[name=label]').val(); var navID = $('input[name=id]').val(); $.ajax({ url: "ajax/navigation.php", type: "POST", data: navData }).done(function(){ $("#label_"+navID).html(navLabel); }); // END $.ajax alert("navID = "+navID+" navLabel = "+navLabel); event.preventDefault(); // will prevent form from submitting });//END nav-form Please note the .done callback. I've narrowed the problem down! The ajax works ONLY on whichever of the sortable anchors is in position 1 (the top of the list) - for when I change the "Home Page", or, again, which ever one I happen to move to the top of the list, the label updates immediately as per the ajax. As you can see in the co…
type: Question
tagged with: javascript
has title: Ajax callback only applying to top div in list of jquery form groups

http://stackoverflow.com/comment/44290451
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27947746
has text: Yep. Nothing givin'.

http://stackoverflow.com/q/27815726
tagged with: dancer
has body: Apologies if this is a bit of a silly question. I'm using dancer and template_toolkit to display the results from some database queries. The code I have below doesnt seem to working in the way I'd hoped. In my dancer.pl script I have: get '/dbqr' =&gt; sub { if (not session('logged_in') ) { send_error ("Not logged in", 401); } my $db = connect_db(); my $sql = io-&gt;file('file.sql')-&gt;slurp; # Read an entire file my $sth = $db-&gt;prepare($sql) or die $db-&gt;errstr; $sth-&gt;execute or die $sth-&gt;errstr; set_flash("Pulled data from db"); template 'show_entries.tt', { 'msg' =&gt; get_flash(), 'add_entry_url' =&gt; uri_for('/add'), 'entries' =&gt; $sth-&gt;fetchall_hashref('system_id'), }; }; In my show_entries.tt ... some other html &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt; some other html and in my app.js file I'd like to do something with the entries from the db fetch ( $sth->fetchall_hashref('system_id') )... for example window.onload = function () { console.log( "[% entries %]" ); }; Again, apologies if this is a sill question... have looked about and didnt find an obvious answer. Thanks
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27894464
has title: access template_toolkit variable from external javascript
tagged with: template-toolkit
type: Question

http://stackoverflow.com/a/27810151
type: Answer
upvote count: 1
downvote count: 0
score: 1
has body: I was going through the code of bootstrap modal and they have this: resetScrollbar: function() { var openedDialogs = this.getGlobalOpenedDialogs(); if (openedDialogs.length === 0) { this.$body.css('padding-right', BootstrapDialogModal.ORIGINAL_BODY_PADDING); } }, Which is called on: hideModal: function() { this.$element.hide(); this.backdrop($.proxy(function() { var openedDialogs = this.getGlobalOpenedDialogs(); if (openedDialogs.length === 0) { this.$body.removeClass('modal-open'); } this.resetAdjustments(); this.resetScrollbar(); this.$element.trigger('hidden.bs.modal'); }, this)); } I can't seem to figure out what would cause this code to not bring the scrollbar back. It seems to be working fine on their website. If you are comfortable, I would suggest debugging the hideModal function of the api itself and figure out why it is not working and maybe put the above css snippet in there as a work around. Or maybe post your code on plunkr, jsfiddle so we can look at what is going on.
answers question: http://stackoverflow.com/q/27809921

http://stackoverflow.com/comment/44063745
type: AnswerComment
has text: So it would be something like: <?PHP echo $firstdesc; ?> <?php echo $totaldesc;?>
score: 0
comment on: http://stackoverflow.com/a/27828872
type: Comment

http://stackoverflow.com/comment/44190896
has text: Buttons in HTML by default submit forms. I guess that could be a reason.
comment on: http://stackoverflow.com/a/27894571
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27804839
upvote count: 3
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/27804779
has body: Just a little mistake : $(this).closest('.col-sm-4.col--remove').hide(); the control has both class so you need to chain it in the selector.

http://stackoverflow.com/comment/44216811
has text: The `Initialize()` function doesn't call the `sendFormByEmail()` function. And you wouldn't want it to if you only want the `sendFormByEmail()` function to run when the form is submitted.
comment on: http://stackoverflow.com/q/27908399
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44155200
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27876829
has text: Instead of classes, use `id`s like `mail1` and `mail2`, then select a correct `div` by concatenating `"mail"` and the value of `select` in `.getElementById()`'s argument.
score: 0

http://stackoverflow.com/q/27850728
upvote count: 1
has title: jQuery ui sortable: items option hash selection not being selective after changes in DOM element
type: AnsweredQuestion
tagged with: jquery-ui
has body: I only want to make "li"s without class "ui-state-disabled" to be sortable in the code you can find on jsfiddle. $("#sortable-1, #sortable-2").sortable({ items: "li:not(.ui-state-disabled)", connectWith: ".connect" }); I also added event listeners to the "ul"s so when the user double clicks on any "li", the user can disable/enable the sortable feature. I can make a disabled "li" to be sortable again by clicking on it, but I cannot re-disable it by adding class "ui-state-disabled" back to the "li". I also noticed jQuery UI library automatically adds class "ui-sortable-handle" to "li"s that are sortable, but the re-enabled (by double clicking) "li"s are still sortable without class "ui-sortable-handle".
score: 1
type: Question
has answer: http://stackoverflow.com/a/27850761
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27850761

http://stackoverflow.com/comment/49088238
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27923925
score: 0
has text: Do you have JavaScript available?

http://stackoverflow.com/comment/44110053
type: Comment
has text: Thanks for your support. The following is my real doubt. Here is my logic gets spoiled, actually no idea to get the answer. In Dash board, we'll have menus like view home page, reset password. These pages should be loaded without reloading the menu in the dashboard. How could I achieve this ? For this only, I've posted the question. Sorry I conveyed mistakenly.
type: AnswerComment
comment on: http://stackoverflow.com/a/27852951
score: 0

http://stackoverflow.com/comment/44295639
type: QuestionComment
has text: This has nothing to do with changes in `RegExp` API. Rather, what you are looping through is an array containing the main match and the captured text of **a single match**.
comment on: http://stackoverflow.com/q/27948853
score: 0
type: Comment

http://stackoverflow.com/q/27827841
has comment: http://stackoverflow.com/comment/44061630
has comment: http://stackoverflow.com/comment/44061920
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44061844
has comment: http://stackoverflow.com/comment/44061701
has title: Adding the values of select input menus
has answer: http://stackoverflow.com/a/27828137
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44061730
has body: I'm having trouble figuring this one out. I could use a little help as I have little JavaScript knowledge. I am trying to use multiple select menus and in real time add the values off the selected items and subtract from a fixed number. larry dex ryder bob jim stew Here Is my javascript function updateTotals() { var inputs = document.getElementById('extra-features').getElementsByTagName('select'); var sum = 0; var bsum = 2000000; for (var i = 0, num = inputs.length; i < num; i++) { if (inputs[i].change) { sum += parseInt(inputs[i].getAttribute('value').split(",")[1]); bsum -= parseInt(inputs[i].getAttribute('value').split(",")[1]); } } document.getElementById('total').innerHTML = sum; document.getElementById('balance').innerHTML = bsum; } var section = document.getElementById('extra-features'); var inputs = section.getElementsByTagName('select'); for (var i = 0, num = inputs.length; i < num; i++) { inputs[i].addEventListener('change', updateTotals); } Here is my fiddle JSFiddle
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27828137

http://stackoverflow.com/a/27896030
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44219424
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27895301
has body: In all those lines of code, the only reference I can see to a url property is here... var orgImgUrl = json.feed.entry[i].media$thumbnail.url ? json.feed.entry[i].media$thumbnail.url : 'http://1.bp.blogspot.com/-mxinHrJWpBo/VD6fqbvI74I/AAAAAAAAcn8/LslulDeOROg/s72-c/noimage-chalkboard.jpg'; so, I'm guessing that what the error is saying is that json.feed.entry[i] doesn't have a property named media$thumbnail...it is "undefined". You need to correct that, whether it is a typing error or something else, make sure that that property exists. If the property is "optional" then change your evaluation to check for the existence of that property as below... var orgImgUrl = (json.feed.entry[i].media$thumbnail != null &amp;&amp; json.feed.entry[i].media$thumbnail.url) ? json.feed.entry[i].media$thumbnail.url : 'http://1.bp.blogspot.com/-mxinHrJWpBo/VD6fqbvI74I/AAAAAAAAcn8/LslulDeOROg/s72-c/noimage-chalkboard.jpg';
answers question: http://stackoverflow.com/q/27895301
score: 1

http://stackoverflow.com/q/27866744
has answer: http://stackoverflow.com/a/27867798
type: Question
has answer: http://stackoverflow.com/a/27867774
has comment: http://stackoverflow.com/comment/44137464
tagged with: javascript
answer count: 2
downvote count: 0
has title: Having Trouble reading JSON file
favorite count: 0
accepted answer: http://stackoverflow.com/a/27867774
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44137698
has comment: http://stackoverflow.com/comment/44136037
has body: I am new to Anjular.Js and is having trouble reading a .JSON file (todo.json) saved in the server. I have basic express server and all my static files are saved within the 'public' folder. I can access the todo.json file directly form the browser. I am fairly new to Java Script and any help will be appreciated. Here is code for the jsdemo.html: Java Script Demo <!--[if lt IE 9]> <![endif]--> This is the javascript demo file To Do Action Done {{item.action}} {{item.done}} Here is the code for my server.js //server.js //Modules=================================================== var express=require ('express'); var app=express(); var bodyParser=require('body-parser'); var methodOverride=require ('method-override'); // set our port var port = process.env.PORT || 3000; // parse application/json app.use(bodyParser.json()); // parse application/vnd.api+json as json app.use(bodyParser.json({ type: 'application/vnd.api+json' })); // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: true })); // override with the X-HTTP-Method-Override header in the request. simulate DELETE/PUT app.use(methodOverride('X-HTTP-Method-Override')); // set the static files location /public/img will be /img for users app.use(express.static(__dirname + '/public')); app.get('/', function(req, res) { res.sendfile('./public/views/index.html'); // load our public/index.html file }); // start app =============================================== // startup our app at http://localhost:3000 app.listen(port); // shoutout to the user console.log('Magic happens on port ' + port); // expose app exports = module.exports = app;
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/27867798
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/27886516
type: AnsweredQuestion
score: 1
downvote count: 3
accepted answer: http://stackoverflow.com/a/27886825
has comment: http://stackoverflow.com/comment/44174111
has comment: http://stackoverflow.com/comment/44174344
type: Question
has body: Code1:123456 Code2:654321 ... somethings .... I want when the user clicks on Code1:123456 that they go to ShowDetails.php and when the user clicks on Code2:654321 nothing happens, so that they can copy the code. Right now when an user clicks Code2:... the user goes to ShowDetails.php too. and i want whole div linked to ShowDetails.php expect Code2:654321
has title: remove href tag a for child element
has answer: http://stackoverflow.com/a/27886577
tagged with: javascript
tagged with: jquery
upvote count: 4
answer count: 3
possible better answer: http://stackoverflow.com/a/27886577
has answer: http://stackoverflow.com/a/27886825
favorite count: 0
has comment: http://stackoverflow.com/comment/44174118
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27886561

http://stackoverflow.com/a/27819899
has comment: http://stackoverflow.com/comment/44052978
has comment: http://stackoverflow.com/comment/44045882
score: 0
has comment: http://stackoverflow.com/comment/44046196
has body: You have duplicate IDs for form element. which is targeting only first element matched with ID. You should rather use same class and target all of them for validation. give class age instead of id and then use: function formValidator(){ var age = document.getElementsByClassName('age'); for (var i = 0; i&lt; age.length; i++) { if(!isNumeric(age[i], "Please enter a valid Age")){ return false; } } return true; }
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44046072
accepted answer of: http://stackoverflow.com/q/27819756
type: Answer
answers question: http://stackoverflow.com/q/27819756
has comment: http://stackoverflow.com/comment/44046568

http://stackoverflow.com/comment/44319909
type: Comment
has text: Attaching the function to the prototype works, but it is not what I'm looking for. There is a separate object for each observable property and many of them have unique classes, for example for calculated properties. I could add it to Object.prototype but that is quite brutal.
comment on: http://stackoverflow.com/a/27958621
score: 0
type: AnswerComment

http://stackoverflow.com/q/27938635
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27939402
score: 0
has title: Angular.js default form error msg style/css
has body: I am working on an angular site which has the default form validation, i added the ngMessages module to implement my own messages. The thing is the site is using the default style for the error messages on the form. I tried to search for it online but couldn't find it. Does anybody know how I pop up this type of message?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44274292
has comment: http://stackoverflow.com/comment/44274161
has comment: http://stackoverflow.com/comment/44273835
tagged with: angularjs
tagged with: twitter-bootstrap
tagged with: css
has answer: http://stackoverflow.com/a/27939402
type: AnsweredQuestion
type: Question
answer count: 1

http://stackoverflow.com/q/27853912
accepted answer: http://stackoverflow.com/a/27853945
has answer: http://stackoverflow.com/a/27853950
tagged with: joomla
upvote count: 1
tagged with: php
has body: How to pass a form value and also user id into ajax? javascript: jQuery("#DoneBtn").click(function(){ var data = $("#insertsubs_form").serialize(); &lt;?php $db = JFactory::getDBO(); $user = JFactory::getUser(); ?&gt; var userid = &lt;?php echo $user-&gt;id; ?&gt; $.ajax({ data: { data:data, userid : userid }, type: "post", url: "../insert_subs.php", success: function(data){ alert(data); } }); }); in insert_subs.php: $userid = $_GET['userid']; **** APPRECIATED Anand Patel, Deena. Both are the same answers that I want! :D Also thanks to epascarello! I didnt try this but I think is working as well. :)
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27853945
type: Question
possible better answer: http://stackoverflow.com/a/27853942
has title: How to pass form value and individual value throught AJAX?
has answer: http://stackoverflow.com/a/27853942
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
answer count: 3

http://stackoverflow.com/q/27922232
has comment: http://stackoverflow.com/comment/46178804
tagged with: javascript
has body: I'd like to export a module using the ES6 syntax only if it is supported in the current runtime. The goal is to develop a library that support different module management systems. As export is a keyword, something like will throw a syntax error : typeof export
has answer: http://stackoverflow.com/a/52249846
score: 27
linked to: http://stackoverflow.com/q/44891421
has comment: http://stackoverflow.com/comment/44664952
has comment: http://stackoverflow.com/comment/44652201
answer count: 3
possible better answer: http://stackoverflow.com/a/28270304
has answer: http://stackoverflow.com/a/28270304
favorite count: 0
has comment: http://stackoverflow.com/comment/44650397
has comment: http://stackoverflow.com/comment/44252618
has answer: http://stackoverflow.com/a/57483968
has comment: http://stackoverflow.com/comment/44651421
linked to: http://stackoverflow.com/q/23096064
has comment: http://stackoverflow.com/comment/44242449
has comment: http://stackoverflow.com/comment/44242426
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/121389624
has comment: http://stackoverflow.com/comment/44242054
type: Question
upvote count: 27
tagged with: ecmascript-6
has title: How to feature-detect es6 modules
has comment: http://stackoverflow.com/comment/125503676
accepted answer: http://stackoverflow.com/a/57483968
downvote count: 0

http://stackoverflow.com/comment/44204848
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27902756
type: Comment
has text: @Anup You can use `getElementByClass` if the submit buttons have a provided class. You can use `getElementsByTagName` if it's suppose to match all elements of some specific type, i.e. `submit`.

http://stackoverflow.com/comment/44153559
type: AnswerComment
score: 0
type: Comment
has text: But `bytePos` holds the starting byte number of the group. So it starts at 8 and ends at 4100.
comment on: http://stackoverflow.com/a/27876063

http://stackoverflow.com/comment/44163214
has text: In that chapter's example, it creates a function called `forEach()`, which you've failed to do. http://eloquentjavascript.net/05_higher_order.html
comment on: http://stackoverflow.com/q/27880787
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/a/66186293
has body: const today = new Date(); let lastSixMonths = [] for (var i = 6; i > 0; i -= 1) { const date = new Date(today.getFullYear(), today.getMonth() - i, 1); lastSixMonths.push(moment(date).format("MMMM YYYY")) } return lastSixMonths.reverse() // Result
type: Answer
has comment: http://stackoverflow.com/comment/117018042
answers question: http://stackoverflow.com/q/27844502
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/117014146
downvote count: 0
has comment: http://stackoverflow.com/comment/117024339

cordova
tags question: http://stackoverflow.com/q/27963115
tags question: http://stackoverflow.com/q/27837270
tags question: http://stackoverflow.com/q/27901757
tags question: http://stackoverflow.com/q/27817096
tags question: http://stackoverflow.com/q/27806095
tags question: http://stackoverflow.com/q/27900177
tags question: http://stackoverflow.com/q/27914055
tags question: http://stackoverflow.com/q/27893080
tags question: http://stackoverflow.com/q/27905761
tags question: http://stackoverflow.com/q/27855806
tags question: http://stackoverflow.com/q/27865265
tags question: http://stackoverflow.com/q/27894835
tags question: http://stackoverflow.com/q/27850071
tags question: http://stackoverflow.com/q/27833594
tags question: http://stackoverflow.com/q/27962016
tags question: http://stackoverflow.com/q/27945592
tags question: http://stackoverflow.com/q/27933033
tag name: cordova
tags question: http://stackoverflow.com/q/27961033
tags question: http://stackoverflow.com/q/27841656
tags question: http://stackoverflow.com/q/27918829
tags question: http://stackoverflow.com/q/27818029
tags question: http://stackoverflow.com/q/27937898
tags question: http://stackoverflow.com/q/27815166
tags question: http://stackoverflow.com/q/27838974
tags question: http://stackoverflow.com/q/27923561
tags question: http://stackoverflow.com/q/27825394
tags question: http://stackoverflow.com/q/27910783
tags question: http://stackoverflow.com/q/27901292
tags question: http://stackoverflow.com/q/27882086
tags question: http://stackoverflow.com/q/27905135
tags question: http://stackoverflow.com/q/27813679
tags question: http://stackoverflow.com/q/27875063
tags question: http://stackoverflow.com/q/27833360
tags question: http://stackoverflow.com/q/27834806
tags question: http://stackoverflow.com/q/27856029
type: Tag
tags question: http://stackoverflow.com/q/27879983
tags question: http://stackoverflow.com/q/27831345
tags question: http://stackoverflow.com/q/27866932
tags question: http://stackoverflow.com/q/27837442

http://stackoverflow.com/comment/44027717
type: QuestionComment
comment on: http://stackoverflow.com/q/27808924
type: Comment
score: 0
has text: @Chad oh, that's a typo here. It has both of them in my code. Updated to better reflect what is actually there.

http://stackoverflow.com/q/27845570
has answer: http://stackoverflow.com/a/27845588
favorite count: 0
has answer: http://stackoverflow.com/a/46480849
answer count: 5
has comment: http://stackoverflow.com/comment/44095013
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27845588
has comment: http://stackoverflow.com/comment/44095031
has comment: http://stackoverflow.com/comment/44095143
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/27846243
type: Question
has answer: http://stackoverflow.com/a/27845831
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27845831
linked to: http://stackoverflow.com/q/8785833
has comment: http://stackoverflow.com/comment/44096481
has title: Disable anchor link after click event
tagged with: javascript
has comment: http://stackoverflow.com/comment/44095181
has answer: http://stackoverflow.com/a/44786534
has body: I have an anchor link and need behavior in that when the user clicks on it i need it to then disable until the page loads again, at which point its re-enabled again (and then disabled again when user clicks, etc).. Very same behavior as per a submit post button on a form where it can be disabled until it does the post. I haven't come across an example yet so hoping someone can help. I have tried e.PreventDefault on the click event but that prevents the link from being clicked on full stop which i don't want. (i need it to be clicked on and THEN disabled) Sample code.. $(function () { $('header.div.nav.ul').first().on("click", function (e) { // how do i disable the link? }); }); HTML sample.. (am trying to target the link with text 'Blah' blah x y z Many thanks
upvote count: 2
tagged with: jquery

http://stackoverflow.com/comment/44249237
comment on: http://stackoverflow.com/q/27914450
score: 0
type: Comment
type: QuestionComment
has text: @johnSmith I have added a console.log. Please let me know if this is not what you meant. Thanks

http://stackoverflow.com/comment/44075724
type: Comment
has text: Use `.prop()` instead of `.attr()`, As of jQuery 1.6, the `.prop()` method provides a way to explicitly retrieve property values, while `.attr()` retrieves attribute
comment on: http://stackoverflow.com/q/27835547
score: 2
type: QuestionComment

http://stackoverflow.com/a/29507039
score: 1
answers question: http://stackoverflow.com/q/27861003
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I found the solution the view is only returned by server by using route we can only get html view not cshtml because that is provided when action is called.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27861003

http://stackoverflow.com/comment/44134364
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27846102
type: Comment
has text: @Cerbrus A little salty there buddy, but give it some time to think. I described how I will be implementing this functionality into a library that will imitating `canvas`, not saying that this functionality imitates `canvas` itself. Yes, I am replacing a canvas with an image element, which should give you a good idea of what I am trying to do. Keep your pants on there buddy, but yes, building base64 image-data through parsing binary is the way that canvas works, and with the right algorithms, I can convert an `arcTo` into a base64 image-data string. Hence the image element. Duh! Hahaha!

http://stackoverflow.com/q/27823728
linked to: http://stackoverflow.com/q/650764
upvote count: 1
has title: Need direction for learning Object inheritance and code clean java script
answer count: 1
has comment: http://stackoverflow.com/comment/44053458
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44053909
has comment: http://stackoverflow.com/comment/44053341
downvote count: 0
tagged with: prototypal-inheritance
score: 1
has answer: http://stackoverflow.com/a/42715685
has body: I am really fixed with JS object related concepts. For ex: Crockford says: Objects produced from object literals are linked to Object.prototype Now on console when I type: // input represented with &gt; &gt; var a = {}; &gt; console.log(Object.getPrototypeOf(a)); Object {} // &lt;-- output &gt; console.log(a.prototype); undefined Crockford says:Function objects are linked to Function.prototype (which is itself linked to Object.prototype) &gt; function b(){}; &gt; console.log(Object.getPrototypeOf(b)); function() &gt; console.log(b.prototype); b{} &gt; console.log(b.prototype.prototype); undefined &gt; console.log(Object.getPrototypeOf(b.prototype)); Object {} When I do getPrototypeOf() I get the expected output, but when I try to use the prototype property I get undefined. Cant figure out the reason. Also for line 5 return value is function(). Can some please explain does this say ? I expected an Object to be returned. It would be great if someone please give me insight/good links/some class diagrams(as we have in java) to follow for understanding prototypal inheritance.
has comment: http://stackoverflow.com/comment/44054492
has comment: http://stackoverflow.com/comment/44054267
has comment: http://stackoverflow.com/comment/44054140
type: Question
has comment: http://stackoverflow.com/comment/44056748
linked to: http://stackoverflow.com/q/9959727
tagged with: javascript

http://stackoverflow.com/comment/44330917
has text: That's precisely what I'm using. You can check it in the Plunker.
type: Comment
comment on: http://stackoverflow.com/a/27967860
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44075394
score: 0
has text: Is there anything around "var PROGRAM", like a function ?
comment on: http://stackoverflow.com/q/27834807
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44157546
type: Comment
comment on: http://stackoverflow.com/a/27877730
has text: @dandavis Correct, but I was trying to make a point in the answer. So, I thought that it would be better if it is explicit :-)
score: 0
type: AnswerComment

http://stackoverflow.com/q/27952180
tagged with: angularjs
has body: I'm getting cached result while using $http to call an API. Here is the AngularJS code: $scope.validate = function(){ var encodedUserNameAndPassword = Base64.encode($scope.username + ':' + $scope.password); var decode = Base64.decode(encodedUserNameAndPassword); $http.defaults.headers.put = { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', 'Access-Control-Allow-Headers': '*' }; $http.defaults.headers.common['Authorization'] = 'Basic ' + encodedUserNameAndPassword; $http({method: 'GET', url: 'http://127.0.0.1:5000/user/jim',cache:false}). success(function(data, status, headers, config) { console.log(data); }). error(function(data, status, headers, config) { alert(data); }); } Can any one point out what I'm missing.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27952375
has comment: http://stackoverflow.com/comment/44327253
has title: AngularJS : Getting cached result from $http
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/27918301
type: Answer
accepted answer of: http://stackoverflow.com/q/27918151
answers question: http://stackoverflow.com/q/27918151
has body: Change this line: var formattingButtonsRow = " Formatting "; to that line: var formattingButtonsRow = ' Formatting ';
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44234670

http://stackoverflow.com/comment/44208277
comment on: http://stackoverflow.com/a/27904170
has text: So the problem was a bad version of Sortable.js? (apaprt from the _ to - typo, of course). ANyway, isn't it possible to achieve this having the instances-list empty? It seems achievable at the Sortable.js examples webpage
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44077555
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27836535
has text: what is date format??

http://stackoverflow.com/q/27948511
has answer: http://stackoverflow.com/a/27948614
possible better answer: http://stackoverflow.com/a/27948641
tagged with: javascript
has answer: http://stackoverflow.com/a/27948641
answer count: 2
downvote count: 0
tagged with: button
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27948614
has body: I have mayn different question first and for all there is this pretty normal for who wants to know your firstname and lastname (its German but I hope this deosent matter) Vorname: Nachname: Then i want to use a function who gets the Name from the form and then shows all Names who ever fill out that form like a Guestbook. Until now i just made it to call an alert whon says "Hallo" but i dont even know how to use The form input as Variables. I hope u can help me, pls only use JS and HTML.
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: onclick
tagged with: forms
has title: using Javascript HTML Formular
upvote count: 1
type: Question

http://stackoverflow.com/a/28467983
type: Answer
answers question: http://stackoverflow.com/q/27941779
has body: I think this may be related to a (now resolved) bug in firefox. Perhaps a different way of determining the scrollWidth and clientWidt is the answer (as brilliantly stated in why scrollwidth doesnt work) : Apparently by hiding the element before reading the scrollWidth gives a different value than when visible. element=document.getElementById("my_div"); var scrollWidth = $(element).css("overflow", "hidden")[0].scrollWidth; alert('clientWidt h = ' + element.clientWidth + ', scrollWidth = ' + scrollWidth ); $(element).css("overflow", "visible");
score: 0

http://stackoverflow.com/a/27836880
answers question: http://stackoverflow.com/q/27836785
score: 0
has body: var myClass = "myClass"; var myObject = { foo:'class-one' } var foo = myObject.foo; $('#test').addClass(myClass + ' ' + foo); .myClass { color: red; } .class-one { text-decoration: underline; } test
type: Answer

http://stackoverflow.com/q/27901675
type: Question
has comment: http://stackoverflow.com/comment/44203865
tagged with: javascript
has comment: http://stackoverflow.com/comment/44202973
has body: <g> </g> Here is the JS Fiddle: http://jsfiddle.net/KashifMKH/L46j18fo/6/ It works fine in Mozilla Firefox, but not in Chrome. Zoom it at large and then compare the results in Mozilla and Chrome: you will see the difference clearly. How can I fix it?
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
score: 3
has answer: http://stackoverflow.com/a/27902679
upvote count: 3
has title: SVG Grid lines are Blurred in Google Chrome while zooming but its work fine in Mozilla firefox

http://stackoverflow.com/comment/44109311
type: Comment
comment on: http://stackoverflow.com/a/27842939
has text: uh, `SomeType = …` *is* a variable assignment. Except using `eval` with another function declaration, you cannot avoid the assignment.
score: 0
type: AnswerComment

http://stackoverflow.com/a/35951045
score: 91
upvote count: 91
accepted answer of: http://stackoverflow.com/q/27939773
has body: I think the function toLocaleDateString use the default local data on the device. try this code to check the output: // America/Los_Angeles for the US // US English uses month-day-year order console.log(date.toLocaleDateString('en-US')); // → "12/19/2012" // British English uses day-month-year order console.log(date.toLocaleDateString('en-GB')); // → "20/12/2012" // Korean uses year-month-day order console.log(date.toLocaleDateString('ko-KR')); // → "2012. 12. 20." // Arabic in most Arabic speaking countries uses real Arabic digits console.log(date.toLocaleDateString('ar-EG')); // → "٢٠‏/١٢‏/٢٠١٢" // chinese console.log(date.toLocaleDateString('zh-Hans-CN')); // → "2012/12/20"
answers question: http://stackoverflow.com/q/27939773
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/120921565
type: Answer

regex
tags question: http://stackoverflow.com/q/27904331
tags question: http://stackoverflow.com/q/27947663
tags question: http://stackoverflow.com/q/27870745
tags question: http://stackoverflow.com/q/27865682
tags question: http://stackoverflow.com/q/27867077
tags question: http://stackoverflow.com/q/27827395
tags question: http://stackoverflow.com/q/27879285
tag name: regex
tags question: http://stackoverflow.com/q/27858038
tags question: http://stackoverflow.com/q/27918439
tags question: http://stackoverflow.com/q/27933793
tags question: http://stackoverflow.com/q/27902401
tags question: http://stackoverflow.com/q/27843494
tags question: http://stackoverflow.com/q/27940759
tags question: http://stackoverflow.com/q/27845159
tags question: http://stackoverflow.com/q/27886384
tags question: http://stackoverflow.com/q/27854321
tags question: http://stackoverflow.com/q/27829640
tags question: http://stackoverflow.com/q/27901760
tags question: http://stackoverflow.com/q/27852184
tags question: http://stackoverflow.com/q/27879664
tags question: http://stackoverflow.com/q/27941549
tags question: http://stackoverflow.com/q/27892307
tags question: http://stackoverflow.com/q/27860330
tags question: http://stackoverflow.com/q/27951545
tags question: http://stackoverflow.com/q/27932656
tags question: http://stackoverflow.com/q/27936526
tags question: http://stackoverflow.com/q/27929996
tags question: http://stackoverflow.com/q/27936607
tags question: http://stackoverflow.com/q/27861750
tags question: http://stackoverflow.com/q/27936367
tags question: http://stackoverflow.com/q/27901038
tags question: http://stackoverflow.com/q/27960808
tags question: http://stackoverflow.com/q/27961425
tags question: http://stackoverflow.com/q/27826212
tags question: http://stackoverflow.com/q/27948853
tags question: http://stackoverflow.com/q/27946290
tags question: http://stackoverflow.com/q/27810050
tags question: http://stackoverflow.com/q/27962811
tags question: http://stackoverflow.com/q/27954319
tags question: http://stackoverflow.com/q/27859353
tags question: http://stackoverflow.com/q/27958827
tags question: http://stackoverflow.com/q/27922338
tags question: http://stackoverflow.com/q/27958438
tags question: http://stackoverflow.com/q/27921553
tags question: http://stackoverflow.com/q/27869769
tags question: http://stackoverflow.com/q/27852429
tags question: http://stackoverflow.com/q/27808792
tags question: http://stackoverflow.com/q/27813399
tags question: http://stackoverflow.com/q/27934616
tags question: http://stackoverflow.com/q/27850355
tags question: http://stackoverflow.com/q/27848784
tags question: http://stackoverflow.com/q/27869316
tags question: http://stackoverflow.com/q/27886099
tags question: http://stackoverflow.com/q/27806256
tags question: http://stackoverflow.com/q/27822406
tags question: http://stackoverflow.com/q/27906634
tags question: http://stackoverflow.com/q/27948017
tags question: http://stackoverflow.com/q/27804445
tags question: http://stackoverflow.com/q/27948024
tags question: http://stackoverflow.com/q/27871648
tags question: http://stackoverflow.com/q/27868990
tags question: http://stackoverflow.com/q/27852888
tags question: http://stackoverflow.com/q/27905376
tags question: http://stackoverflow.com/q/27839516
tags question: http://stackoverflow.com/q/27895478
tags question: http://stackoverflow.com/q/27896895
tags question: http://stackoverflow.com/q/27876229
tags question: http://stackoverflow.com/q/27924564
tags question: http://stackoverflow.com/q/27916055
tags question: http://stackoverflow.com/q/27816567
tags question: http://stackoverflow.com/q/27904767
tags question: http://stackoverflow.com/q/27947357
tags question: http://stackoverflow.com/q/27921992
tags question: http://stackoverflow.com/q/27849907
tags question: http://stackoverflow.com/q/27843253
tags question: http://stackoverflow.com/q/27957402
tags question: http://stackoverflow.com/q/27938415
tags question: http://stackoverflow.com/q/27917523
tags question: http://stackoverflow.com/q/27820724

http://stackoverflow.com/q/27907691
type: Question
tagged with: testing
tagged with: protractor
tagged with: javascript
has title: protractor-html-screenshot-reporter not showing all the tests executed in the reporter file
has answer: http://stackoverflow.com/a/27910166
score: 3
downvote count: 0
answer count: 1
tagged with: end-to-end
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27910166
type: AnsweredQuestion
upvote count: 3
has body: Am trying to run firsttest.js: // firsttest.js describe('angularjs homepage', function() { var firstNumber = element(by.model('first')); var secondNumber = element(by.model('second')); var goButton = element(by.id('gobutton')); var latestResult = element(by.binding('latest')); beforeEach(function() { browser.get('http://juliemr.github.io/protractor-demo/'); }); it('should have a title', function() { expect(browser.getTitle()).toEqual('Super Calculator'); }); it('should add one and two', function() { firstNumber.sendKeys(1); secondNumber.sendKeys(2); goButton.click(); expect(latestResult.getText()).toEqual('3'); }); it('should add four and six', function() { // Fill this in. expect(latestResult.getText()).toEqual('10'); }); it('test1', function() { // Fill this in. expect(true).toEqual(true); }); it('test2', function() { // Fill this in. expect(true).toEqual(true); }); it('test3', function() { // Fill this in. expect(true).toEqual(true); }); }); conf file: var HtmlReporter = require('protractor-html-screenshot-reporter'); exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['firsttest.js'], multiCapabilities: [{ 'browserName': 'chrome' }], onPrepare: function() { // Add a screenshot reporter and store screenshots to `/tmp/screnshots`: jasmine.getEnv().addReporter(new HtmlReporter({ baseDirectory: './e2e-reports', takeScreenShotsOnlyForFailedSpecs: true, docTitle: 'Pytheas Tests' })); } } Console o/p: Failures: 1) angularjs homepage should add four and six Message: Expected '0' to equal '10'. Stacktrace: Error: Failed expectation at [object Object]. (/Users/bgowda1/Work/Projects/Demos/protractor-tests/firsttest.js:35:36) Finished in 6.191 seconds 6 tests, 6 assertions, 1 failure HTML report shows only 5 tests.

http://stackoverflow.com/q/27902780
tagged with: php
downvote count: 1
has title: set html button state based on query
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27902959
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44205221
has body: I have a page with 'favourite' button that when clicked runs an Ajax post and updates my db table 'favourite' accordingly user and book details. The current process is as follows, click button once > add book to favourite table > refresh page > display success div click button again > delete book from favourite table > refresh page > display success div What I would like to do now is on page load, check if the user has already added the book as a favourite, if so, set the class of this button to btn-success (green). How do I achieve this? Do I need to give the button an attribute on page load and check this on page load? I am quite new to php and js so any advice is appreciated. I have included my code for reference. ajax $(document).ready(function(){ $( "#fav" ).click(function(){ book_id = $(fav).val(); // set the value of the button as the book_id $.ajax({ type: 'POST', url: '<?php echo URL; ?>books/checkFav', data: {book_id:book_id}, success: function () { window.location.reload(true); }//end success });//end ajax }); }); checkFav php $bookid=$_REQUEST['book_id']; //get this from ajax $userid=$_SESSION['user_id']; //get this from session $sql = "SELECT * FROM favourite WHERE book_id = :book_id AND user_id = :user_id"; ... //execute if(empty($rows_found)) { $sql = "INSERT INTO favourite (book_id, user_id) VALUES (:book_id, :user_id)"; ... //execute } else { $sql = "DELETE FROM favourite WHERE book_id = :book_id AND user_id = :user_id"; ... //execute } html echo ' id.'" type="button" class="btn btn-default"> '; echo ' ';
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/27903021
has comment: http://stackoverflow.com/comment/44204969
accepted answer: http://stackoverflow.com/a/27902959
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27903021
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44205003
has comment: http://stackoverflow.com/comment/44204953

http://stackoverflow.com/comment/44053030
type: QuestionComment
has text: It should be trivial - tell your AJAX library to issue a `DELETE`, not a `GET` request.
comment on: http://stackoverflow.com/q/27823367
score: 0
type: Comment

http://stackoverflow.com/a/27918641
answers question: http://stackoverflow.com/q/27915996
downvote count: 1
type: Answer
upvote count: 0
has body: You can try using CSS3 word-breakproperty. http://www.w3schools.com/cssref/css3_pr_word-break.asp
has comment: http://stackoverflow.com/comment/44235658
score: -1

http://stackoverflow.com/comment/44147311
comment on: http://stackoverflow.com/q/27872483
type: Comment
type: QuestionComment
has text: I just wasn't sure how to use jQuery's `.promise()`. But if there is no difference then I guess I don't have to worry about it. Thank you.
score: 0

http://stackoverflow.com/comment/44182473
comment on: http://stackoverflow.com/q/27890392
has text: Yes, that is line **is** absolutely **wrong**.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27875739
has title: Uncaught TypeError: Cannot read property 'top' of undefined
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44152946
favorite count: 0
has body: I am trying to add classes based on when an element reaches the top of the page (-180px for header) but I cannot seem to get the offset top value to work. I use window load as the size of the images help dictate the height of each section. You can see a live example here http://www.amypreston.co.uk/ $(window).load(function() { var $header = $("header"); var numberOfSections = $("section").length; var sectionOffsets = []; for(var i = 0; i &lt; numberOfSections + 1; i++) { sectionOffsets.push($('section').eq(i).offset().top); } $(window).scroll(function() { var scrollTop = $(this).scrollTop(); for(var i = 0; i &lt; numberOfSections + 1; i++) { if(scrollTop &gt; sectionOffsets[i] - 180) { $header.removeClass().addClass("project" + (i + 1)); } } }); });
tagged with: css
has answer: http://stackoverflow.com/a/27875771
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/27875765
type: Question
has comment: http://stackoverflow.com/comment/44152958
has comment: http://stackoverflow.com/comment/44152942
score: -2

http://stackoverflow.com/comment/44155968
score: 1
has text: You are clearly using a server-side language here. Which one?
comment on: http://stackoverflow.com/q/27877253
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27877777
score: 0
answers question: http://stackoverflow.com/q/27877681
type: Answer
has body: You could name each genre box element with its own id and then use a generic method to handle the change. function showHide(element) { if(element.id == "drama") { $("#dramabox").show(); $("#actionbox").hide(); } elseif (element.id == "action") { $("#actionbox").show(); $("#dramabox").hide(); } } then use it in click event call $("#drama").click(function() { showHide(this); }); $("#action").click(function() { showHide(this); });

http://stackoverflow.com/comment/45714992
comment on: http://stackoverflow.com/a/27969115
score: 0
type: AnswerComment
has text: @DavidBrierton go ahead :)
type: Comment

http://stackoverflow.com/a/27818983
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44043753
downvote count: 0
has body: Look in your browser's JavaScript error console See the error about $ being undefined and thus a reference error Define $ (which you probably want to do by including the jQuery library) Alternatively, just get rid of $(document).ready(main); and call main() directly instead. You don't appear to have any need for jQuery in there. You'll then have to contend with getElementByClass not being a function. See getElementsByClassName or querySelector instead.
score: 7
has comment: http://stackoverflow.com/comment/44043718
answers question: http://stackoverflow.com/q/27818947
accepted answer of: http://stackoverflow.com/q/27818947
upvote count: 7

http://stackoverflow.com/comment/44297520
score: 0
comment on: http://stackoverflow.com/q/27950978
type: QuestionComment
type: Comment
has text: As you haven't provided the full code.From assumption i think you are facing a closure related problem.Add a wrapping immediately invoked function right after your for loop might solve your problem

http://stackoverflow.com/q/27946228
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44287622
has answer: http://stackoverflow.com/a/27963891
answer count: 3
linked to: http://stackoverflow.com/q/16245767
has body: In my Ext Js solution I am calling a service which is returning this JSON format {"success":true,"filename":"spreadsheet.xlsx","file":[80,75,3,4,20,0,...(many more)]} How can I make a file download dialog with the filename and the content of the byte array (file) ? UPDATE So I found this bit to start the downlaod var a = window.document.createElement('a'); a.href = window.URL.createObjectURL(new Blob(data.file, { type: 'application/octet-stream' })); a.download = data.filename; // Append anchor to body. document.body.appendChild(a) a.click(); // Remove anchor from body document.body.removeChild(a) So far good But the file I get is corrupted so I suspect I need to Encode/Decode the file variable?
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/12676649
has title: File download a byte array as a file in javascript / Extjs
accepted answer: http://stackoverflow.com/a/27963891
has answer: http://stackoverflow.com/a/48569588
upvote count: 16
has answer: http://stackoverflow.com/a/76355647
tagged with: extjs3
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1801076
possible better answer: http://stackoverflow.com/a/48569588
score: 16

http://stackoverflow.com/a/27805800
type: Answer
accepted answer of: http://stackoverflow.com/q/27805743
answers question: http://stackoverflow.com/q/27805743
score: 1
type: AcceptedAnswer
downvote count: 0
has body: var x='PROMPT \"Page\" '; document.getElementById("demo").innerHTML = x ; &lt;p id="demo"&gt;&lt;/p&gt; Check the code and adjust according to that
upvote count: 1

http://stackoverflow.com/q/27961323
type: Question
tagged with: angular-ngmodel
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27961544
has comment: http://stackoverflow.com/comment/44316993
has comment: http://stackoverflow.com/comment/44316193
tagged with: angularjs
type: UnansweredQuestion
has title: AngularJS ng-model not setting correct value
has body: I have a table and when clicking on a row I call this function: $scope.updateRow = function(row) { $scope.row = angular.copy(row); } $scope.row has a name attribute and I have a select menu that should display this name: {{name.fullName}} However when clicking the row it sets the option value in the select menu to even though $scope.row.name = "test name" The option value should look like: test name Seems to be a similar issue to this question: Angular adds strange options into select element when setting model value
has comment: http://stackoverflow.com/comment/44316675
has comment: http://stackoverflow.com/comment/44316842
linked to: http://stackoverflow.com/q/16783294

http://stackoverflow.com/q/27823339
tagged with: javascript
has answer: http://stackoverflow.com/a/27825291
type: Question
has title: Azure Website Single Sign On accessing Azure Mobile Service from Azure Active Directory as User
has answer: http://stackoverflow.com/a/27826821
score: 0
answer count: 2
tagged with: azure-active-directory
has body: I have an ASP.NET MVC website deployed as Azure website (called website). That website has a section that needs authorization. I already have set up Windows Azure Active Directory (WAAD) to protect access to that section. Once that protected section has loaded, it will load a Javascript app that allows integration with the Azure Mobile Service. I also have a separate Azure Mobile Service that I use for data storage (called mobserv). I want to access mobserv table and api endpoints from website. I am using the .NET backend for Azure Mobile Services. Of course, I need to protect those mobserv endpoints using [AuthorizeLevel]. Tutorials show how to do this when I want to authenticate as Application (using [AuthorizeLevel(AuthorizationLevel.Application)]) - just add a reference to the proper Javascript Client (MobileServices.web-1.2.5.js), provide mobserv app id and token. CORS is set up to allow interaction. So far, so good. But now, I want to protect certain endpoints using [AuthorizeLevel(AuthorizationLevel.User)]. So now, the request has to be authorized as User. Since the website already has been protected by WAAD, I do not want the client to perform a new sign in for the javascript client - I want to reuse the current WAAD authentication headers to have a Single Sign On Experience, so that mobserv will recognize the user. I have not found any hints on how to do this. Tutorials only show application level auth against mobserv or using explicit login dialogs. Does anybody have a clue how to do this?
tagged with: azure-mobile-services
type: UnansweredQuestion
tagged with: azure-web-app-service

http://stackoverflow.com/comment/44075563
type: Comment
comment on: http://stackoverflow.com/a/27835002
score: 0
type: AnswerComment
has text: @LeoShi So what is your so-called "all of these case"? You don't provide the information, nobody knows what you really want.

http://stackoverflow.com/q/27901760
type: Question
has title: Regular expression in bookmarklet
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44203454
favorite count: 0
has comment: http://stackoverflow.com/comment/44203226
tagged with: regex
has comment: http://stackoverflow.com/comment/44204908
answer count: 0
has body: I'm trying to build a simple bookmaklet that takes a template and fills it asking the user for the appropriate values. Then that template is inserted into the active text input element. But the boorkmarklet I'm getting is unresponsive. Here is the plain javascript text (for testing): var template="Dear ${Customer} please put your ideas inside ${hole};" alert(fillTemplate(template)); function fillTemplate(template) { var result = template; // Search for all the variables to be replaced, for instance ${Column name} var templateVars = template.match(/\$\{[^\}]+\}/g); if (!templateVars) { return result; } for (var i = 0; i &lt; templateVars.length; ++i) { var variableData = prompt("Please give a value for "+templateVars[i]) result = result.replace(templateVars[i], variableData || ""); } return result; }; The code above works as expected, but it does not when turned into bookmarklet. Thanks in advance.
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/44205180
score: 1

http://stackoverflow.com/comment/44260199
type: QuestionComment
has text: I think the best solution will be to pass only the variables you need from the DOM objects into main.js using port.emit rather than trying to pass entire DOM objects.
comment on: http://stackoverflow.com/q/27896407
score: 0
type: Comment

http://stackoverflow.com/q/27930780
linked to: http://stackoverflow.com/q/14451358
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
has answer: http://stackoverflow.com/a/27930842
favorite count: 0
has body: I am trying to get one div from one webpage URL to another webpage and display in plain text using getElementById without using AJAX or jQuery because I'm going to implement it in FitNesse. Is there a way to pass the URL?
tagged with: fitnesse
type: Question
has comment: http://stackoverflow.com/comment/44260772
has title: getElementById from another page
answer count: 2
downvote count: 2
score: 5
has comment: http://stackoverflow.com/comment/44259020
has comment: http://stackoverflow.com/comment/44258956
has answer: http://stackoverflow.com/a/27931493
upvote count: 7
has comment: http://stackoverflow.com/comment/44258960
has comment: http://stackoverflow.com/comment/44259336
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/44132458
has text: @gibsonman507 please don't play games of deleting a comment and wonder why people make comments about it
type: Comment
score: 2
comment on: http://stackoverflow.com/a/27864979
type: AnswerComment

http://stackoverflow.com/q/27863125
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/44130910
has body: I'm using angularjs with ui-router (with the helper stateHelperProvider) to collect views and controllers into the page. But got a problem with my views not updating. My code (the one that is related) config.js app.config(function($httpProvider, $urlRouterProvider, RestangularProvider, stateHelperProvider) { $urlRouterProvider.otherwise("/"); stateHelperProvider .state({ name: 'division', url: '/division/:division', views: { 'main': { templateUrl: '/templates/division.main?uri=' + segment(2), controller: 'DivisionController' } }, children: [ { name: 'appcontent', url: '/content', views: { 'content': { templateUrl: "templates/division.appcontent?uri=" + segment(2) + '&root=' + segment(4), controller: 'AppContentController' } }, children: [ { name: 'root', url: '/:root', views: { 'roots': { templateUrl: "templates/division.appcontent.roots?uri=" + segment(2) + '&root=' + segment(4) } } } ] } ] }); }); the code I use for linking // linking to another division test2 // linking to another root test2 Explaining But got a problem with my views not updating. My views are the one with the actual data, so I need them to reload on change. Like when :division in url is test1, then the template template/division.main have one set of data. But when :division in url is test2, then the template template/division.main have another set of data. So whenever :division in url changes, I need to reload the template template/division.main and as well all the child templates. But when :root changes in the url, I only need to reload the template template/division.appcontent.roots and not the template/division.main template. Is this possible somehow or should I change to use only an API in order to get data. I really hope this makes sense. Note segment is a function I have made to get some data from the angular route.
linked to: http://stackoverflow.com/q/27662818
has comment: http://stackoverflow.com/comment/44132398
tagged with: javascript
score: 0
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44142507
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27897743
has title: Reload View on change url
accepted answer: http://stackoverflow.com/a/27897743
type: Question

http://stackoverflow.com/a/27937955
has comment: http://stackoverflow.com/comment/44272431
answers question: http://stackoverflow.com/q/27937638
score: 0
has body: I can see you have an error in your code onclick"javascript:xxxx" is not correct, "javascript:xxx" should using on "a" tag "href" attribute, just remove the "javascript:" in your onclick attribute and you may get what you want.
type: Answer

http://stackoverflow.com/comment/44081652
comment on: http://stackoverflow.com/q/27828361
score: 0
type: QuestionComment
type: Comment
has text: It's exiting with a code 8 and the following: Error: Meteor.userId can only be invoked in method calls. Use this.userId in publish functions.

http://stackoverflow.com/q/27943403
downvote count: 0
has answer: http://stackoverflow.com/a/27945252
has answer: http://stackoverflow.com/a/27947262
type: Question
score: 3
has body: I am generating 5 circles with a for loop in a canvas and I want to give them a class so I can control them with jquery, but I am doing something wrong. Can you guys figure out what's happening? var stage; var quantity = 6, width = 60, height = 60, circles = []; function init(){ stage = new createjs.Stage("myCanvas"); stage.width = 500; stage.height = 600; createjs.Ticker.setFPS(60); createjs.Ticker.addEventListener("tick", onTick); setupGame(); } function setupGame() { for(var i = 0; i &lt; quantity; i++) { var circle = document.createElement("img"); circle.setAttribute('src', 'images/circles/circle'+i+'.png'); circle.className = "circle"; circle.style.position = "absolute"; circle.style.left = Math.floor((Math.random() * 100)) + "%"; circle.style.top = Math.floor((Math.random() * 100)) + "%"; circle.style.width = width + "px"; circle.style.height = height + "px"; document.body.appendChild(circle); circles.push(circle); } } function onTick(e){ stage.update(e); } NEW VERSION. With the help from JonnyD, I now have a functional loop. The only problem is that the images get appended to the body, and not to my stage. I have tried stage.appendChild(circle), but it's not working. Here is a link to an online source so you guys can check it out = LINK
has comment: http://stackoverflow.com/comment/44289463
upvote count: 3
has answer: http://stackoverflow.com/a/58548825
tagged with: canvas
has comment: http://stackoverflow.com/comment/44282470
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: createjs
has answer: http://stackoverflow.com/a/27945053
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44282550
tagged with: http://stackoverflow.com/tag/html
has title: Add class to canvas element HTML5 & CreateJS
answer count: 4
has comment: http://stackoverflow.com/comment/44282467

http://stackoverflow.com/q/27861424
answer count: 2
has answer: http://stackoverflow.com/a/27861661
tagged with: arrays
possible better answer: http://stackoverflow.com/a/27861630
tagged with: angularjs
has title: AngularJS find object in first array which is not presented in second
has comment: http://stackoverflow.com/comment/44125287
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/6012242
has body: Let's say i have such two objects: first: [ { id: "123", title: "123", options: [] }, { id: "456", title: "456", options: [ { id: "0123", title: "0123", options: [] } ] }, { id: "789", title: "789", options: [] }, ] and second [ { id: "123", title: "123", options: [] }, { id: "789", title: "789", options: [] }, ] as you could see in second array i'm missing this part: { id: "456", title: "456", options: [ { id: "0123", title: "0123", options: [] } ] } how it would be right and better to iterate and find missing elements in angular?
type: Question
accepted answer: http://stackoverflow.com/a/27861661
tagged with: javascript
has comment: http://stackoverflow.com/comment/44125183
has answer: http://stackoverflow.com/a/27861630
score: 0

http://stackoverflow.com/a/27922183
has body: In this case will better to use popup box (lightbox). Fill it with additional form and add event handler to it on form submit. Try to use event.preventDefault() inside the handler, then attach jquery.post method: $( "#additional_form" ).submit(function( event ) { event.preventDefault(); $.post('post.php', $('#additional_form').serialize()); $(#lightbox).hide(); }); There's a lot of ways to do it, you can also just serialize it without sending. Or append it to your main form.
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27921326
answers question: http://stackoverflow.com/q/27921326

http://stackoverflow.com/comment/44292103
has text: Are you testing with a mobile phone? Maybe "long click" is not the same event as "long press"... ;-) https://github.com/pisi/Longclick
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27948341

http://stackoverflow.com/a/27889456
has comment: http://stackoverflow.com/comment/44180487
type: Answer
has body: maximum number for upload file is 10.so i define this variable at the first of js file: var sssss,formaa,formab,formac,formad,formae,formaf,formag,formah,formai,formaj; and save $.ajax to sssss .after $.ajax put this switch : stra=$(this).parent().index(); switch (stra) { case 10: formaa = sssss; break; case 9: formab = sssss; break; case 8: formac = sssss; break; case 7: formad = sssss; break; case 6: formae = sssss; break; case 5: formaf = sssss; break; case 4: formag = sssss; break; case 3: formah = sssss ; break; case 2: formai = sssss; break; case 1: formaj = sssss; break; } stra is number of file that is uploading.when user click on cancel button this function called: $("form span#stop").click(function(){ stra=$(this).parent().parent().index(); switch (stra) { case 10: formaa.abort() ; break; case 9: formab.abort(); break; case 8: formac.abort(); break; case 7: formad.abort(); break; case 6: formae.abort(); break; case 5: formaf.abort(); break; case 4: formag.abort(); break; case 3: formah.abort(); break; case 2: formai.abort(); break; case 1: formaj.abort(); break; } }); stra is also number of uploading file .so i copy $.ajax to another variable and that variable consider for every file.
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/27888637
upvote count: 0

http://stackoverflow.com/comment/44032241
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27812291
type: Comment
has text: so basically you want show and hide to be animated?

http://stackoverflow.com/q/27949369
type: AnsweredQuestion
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27949422
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -2
has body: How would I go about getting which child was clicked when the container is clicked? Whichever child is clicked to store that in a variable? w html:
possible better answer: http://stackoverflow.com/a/27949422
has answer: http://stackoverflow.com/a/27949393
answer count: 2
downvote count: 2
accepted answer: http://stackoverflow.com/a/27949393
has title: How to store which child was clicked in a variable?
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27845696
has comment: http://stackoverflow.com/comment/44097552
favorite count: 0
has comment: http://stackoverflow.com/comment/44095798
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27848081
accepted answer: http://stackoverflow.com/a/27848081
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44097491
type: Question
tagged with: javascript
has title: Defaultly show the placeholder in last position in select drop down in angularjs
has body: If am passing the json data and display it in dropdown its work fine by using angularjs and html5. But when am get the data from the services and display in select drop down. The placeholder is listed down in the last position with black color and other datas from the services on the top of place holder. Then the first data is in greyed color. Can you please help me regarding this issue. json data: { key: "filterAssignedWorkGroupName", type: "select", label: "workgroup" placeholder: "select the workgroupname", option: [] } in angularjs am using &lt;option ng-if="option.placeholder" value="" selected&gt;{{option.placeholder}}&lt;/option&gt;
has comment: http://stackoverflow.com/comment/44096998
has comment: http://stackoverflow.com/comment/44095306
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/44247150
score: 0
type: Comment
has text: @iabw Your `then` implementation only (kind of) works given the assumption that a given promise's `.then()` will only ever be called once. If it is called more than once, all handlers registered after the first one will be called with an `undefined` value on the next turn of the polling loop. This is what I explained in my code sample above. Please see section [2.2.6](https://promisesaplus.com/#point-36) of the Promises/A+ spec to see how this violates the promise contract.
comment on: http://stackoverflow.com/a/27909906
type: AnswerComment

http://stackoverflow.com/q/27927351
score: 0
has body: I am getting the following error: events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at errnoException (net.js:904:11) at Server._listen2 (net.js:1042:14) at listen (net.js:1064:10) at Server.listen (net.js:1138:5) at Function.app.listen (C:\Users\mississauga\OneDrive\workspace\Editor\node_modules\express\lib\application.js:533:24) at Object.&lt;anonymous&gt; (C:\Users\mississauga\OneDrive\workspace\Editor\bin\www:7:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) I have tried changing the port from 3000 to 8000, still got the same error. I closed the program and restarted my laptop, then tried running the program and I still get the same error. I used this tutorial. My code is very similar to the tutorial. My program was working fine but when I used socket.io I got an error, I removed the socket.io codes, and replaced them with my old working codes, except now my old codes are not working. Here is my code. app.js var express = require('express'); var http = require('http'); var path = require('path'); var favicon = require('static-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var mongoose = require('mongoose'); var Parse = require('parse').Parse; var passport = require('passport'); var LocalStrategy = require('passport-local').Strategy; TwitterStrategy = require('passport-twitter'); GoogleStrategy = require('passport-google'); FacebookStrategy = require('passport-facebook'); var routes = require('./routes'); var expressSession = require('express-session'); var users = require('./routes/user'); var flash = require('connect-flash'); var app = express(); var User = require('./Models/users.js') // view engine setup app.set('views', path.join(__dirname, '/views')); app.set('view engine', 'jade'); app.use(favicon()); app.use(flash()); app.use(…
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/44252190
answer count: 0
linked to: http://stackoverflow.com/q/4075287
type: Question
has comment: http://stackoverflow.com/comment/44253128
has title: Error: listen EADDRINUSE
duplicate of: http://stackoverflow.com/q/4075287
tagged with: javascript
tagged with: express

http://stackoverflow.com/a/27935547
has body: When the user manually selects a language (changes the value of the selectbox) you might get the language chosen with $('.goog-te-combo').on('change',function(){ language = $("select.goog-te-combo option:selected").text(); alert(language); }); Fiddle In case when your page refreshes and the translator translates your page, you could get the current language that is being used by using a setTimeout. This isn't perfect, but it certainly helps mate.. :)
score: 3
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44268829
has comment: http://stackoverflow.com/comment/63497773
upvote count: 3
type: Answer
accepted answer of: http://stackoverflow.com/q/27935450
answers question: http://stackoverflow.com/q/27935450

http://stackoverflow.com/q/27816666
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/27816774
has title: How to make listener on data attribute (angularJS)?
answer count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27816774
tagged with: listener
tagged with: angularjs
has body: I have js pie timer which is getting time from node.js and rendering pie chart. here is code: here I have several data-...="" attributes which is rendering the pie chart &lt;div id="myStat2" data-dimension="104" data-text="45" data-percent="0"&gt;&lt;/div&gt; here is jQuery part of what i have it is somehow listener but not best solution. var time = 0; setInterval(function(){ time = $('#myStat2').attr('data-percent'); $('#myStat2').empty(); $('#myStat2').attr('data-percent', time); $('#myStat2').attr('data-text', parseInt(time)); $('#myStat2').circliful({animationstep: 0}); }, 100); here is the result of what is completely rendered: here everything correct and working fine, but i suppose this is not best solution. I thought that i can do this through angularJS but i have not idea how it is working. Can any one offer me something better ?
has comment: http://stackoverflow.com/comment/44039524
tagged with: node.js
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/44039550
type: Question
has comment: http://stackoverflow.com/comment/44039740

http://stackoverflow.com/a/27958186
has comment: http://stackoverflow.com/comment/72376843
has comment: http://stackoverflow.com/comment/109919876
type: Answer
has comment: http://stackoverflow.com/comment/125279598
has comment: http://stackoverflow.com/comment/45500343
has comment: http://stackoverflow.com/comment/128767587
has comment: http://stackoverflow.com/comment/44312826
has comment: http://stackoverflow.com/comment/44311578
has comment: http://stackoverflow.com/comment/87025631
has comment: http://stackoverflow.com/comment/125077897
has comment: http://stackoverflow.com/comment/72397218
has comment: http://stackoverflow.com/comment/67941275
has comment: http://stackoverflow.com/comment/57442563
has comment: http://stackoverflow.com/comment/44312134
has comment: http://stackoverflow.com/comment/79905732
has comment: http://stackoverflow.com/comment/45504238
answers question: http://stackoverflow.com/q/27957766
has comment: http://stackoverflow.com/comment/67952433
has comment: http://stackoverflow.com/comment/116812265
has comment: http://stackoverflow.com/comment/59156348
has comment: http://stackoverflow.com/comment/77228510
has comment: http://stackoverflow.com/comment/112697731
has comment: http://stackoverflow.com/comment/44311965
has comment: http://stackoverflow.com/comment/109342556
has comment: http://stackoverflow.com/comment/45472848
score: 375
accepted answer of: http://stackoverflow.com/q/27957766
has comment: http://stackoverflow.com/comment/45586768
has comment: http://stackoverflow.com/comment/86499241
downvote count: 5
has comment: http://stackoverflow.com/comment/111223262
has comment: http://stackoverflow.com/comment/86444073
has comment: http://stackoverflow.com/comment/114928737
upvote count: 380
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/59117936
has body: No browsers currently have the code necessary to render Word Documents, and as far as I know, there are no client-side libraries that currently exist for rendering them either. However, if you only need to display the Word Document, but don't need to edit it, you can use Google Documents' Viewer via an to display a remotely hosted .doc/.docx. Solution adapted from "How to display a word document using fancybox". Example: JSFiddle However, if you'd rather have native support, in most, if not all browsers, I'd recommend resaving the .doc/.docx as a PDF file Those can also be independently rendered using PDF.js by Mozilla. Edit: Huge thanks to cubeguerrero for posting the Microsoft Office 365 viewer in the comments. This is an embedded Microsoft Office document, powered by Office Online. One more important caveat to keep in mind, as pointed out by lightswitch05, is that this will upload your document to a third-party server. If this is unacceptable, then this method of display isn't the proper course of action. Live Examples: Google Docs Viewer Microsoft Office Viewer
has comment: http://stackoverflow.com/comment/77275121
has comment: http://stackoverflow.com/comment/120867419
has comment: http://stackoverflow.com/comment/95362131
has comment: http://stackoverflow.com/comment/44314665
has comment: http://stackoverflow.com/comment/132262138

http://stackoverflow.com/comment/44280775
has text: I don't see the problem right now. The only difference is async coding vs sync coding. For everything else, you can dynamically create the dependency list and grab the singletons using the `arguments` object.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27941939

http://stackoverflow.com/q/27817704
has body: I've built the jhipster sample application. I am quite new to angular so this may be a silly question, but how do I debug the angular javascript (ex. app.js). I am using Intellij Idea Ultimate 14.0.2 on Windows. I installed the JB plugin for browser debug in chrome and of course enabled debugging. Still I can't get the editor to stop on break points. Hummm frustrating...if anyone has an idea I would greatly appreciate their wisdom.
has comment: http://stackoverflow.com/comment/44052156
type: Question
tagged with: debugging
tagged with: intellij-idea
tagged with: javascript
has title: Jhipster and debugging angular js
upvote count: 3
tagged with: jhipster
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28498141
has answer: http://stackoverflow.com/a/28498141
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/27837370
tagged with: select
type: Question
has answer: http://stackoverflow.com/a/27839088
tagged with: javascript
has title: Tooltipster hover select and option not working in IE
tagged with: tooltipster
score: 0
answer count: 1
has body: Im not sure if this the right place to ask this but Im having a problem with tooltipster and IE. When I make an interactive tooltipster that shows on hover and add a form with an selectbox in it, it is impossible too select an option in IE because the tooltipster closes and your unable to make an selection. I made an Plunker to quickly show the problem (open in IE): http://plnkr.co/lckgcT Hover me for the tooltipster! $(document).ready(function() { $('#corres_button').tooltipster({ interactive: 'true', contentAsHTML:'true', trigger: 'hover', arrow: false, position: 'bottom', content: $(' Try selecting an option in IE the tooltipster will close since it loses its hover Testing Test Test 2 Test 3 Test 4 ') }); }); I tried adding all kinds of css options too the form select options (display: block/inline-block etc) and playing with the Z-index. But nothing works and the tooltipster keeps closing when I 'open' the select options. Im sorry for the bad english and I hope the problem is clear!
tagged with: hover
type: AnsweredQuestion
tagged with: internet-explorer
accepted answer: http://stackoverflow.com/a/27839088

http://stackoverflow.com/comment/44099329
score: 0
type: Comment
has text: There is a place where calling `ko.applyBindings()` is acceptable, and that place is not the view model, it is custom bindings that have `controlsDescendantBindings` enabled.
comment on: http://stackoverflow.com/a/27846678
type: AnswerComment

http://stackoverflow.com/comment/44220237
type: Comment
comment on: http://stackoverflow.com/q/27909856
score: 0
type: QuestionComment
has text: The search code example is right [here](https://script.google.com/macros/d/17492XWKmLs3dl2y-YV2qILZ5sbvfIMxo0ZRsK0nyA3BLwWhJ-HYDBeTg/edit?usp=drive_web&splash=yes) And this is the code that I edited slightly to acctually make work, before I got to it, it wouldn't run as there were undefined variables and the like.

http://stackoverflow.com/comment/44167951
score: 0
comment on: http://stackoverflow.com/q/27883026
type: Comment
type: QuestionComment
has text: Correct! But I will have to re-add the ID's that is removed if the page is re sized.. what can I use for re-adding?

http://stackoverflow.com/a/68159001
has body: In react-router-v3, I do NOT find any working solutions, so I make a big trade-off, use class inherit instead of props. for example: class MyComments extends Comments{ constructor(props) { super(props); this.myProp = myValue; } } and, you use MyComments in Router's component without props. then, you can use this.myProp to get 'myValue' in componentDidMount() function;
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27864720

dojo
tags question: http://stackoverflow.com/q/27830052
tags question: http://stackoverflow.com/q/27821020
tags question: http://stackoverflow.com/q/27911762
tags question: http://stackoverflow.com/q/27916737
type: Tag
tags question: http://stackoverflow.com/q/27836363
tags question: http://stackoverflow.com/q/27828122
tags question: http://stackoverflow.com/q/27855052
tags question: http://stackoverflow.com/q/27876254
tags question: http://stackoverflow.com/q/27868782
tags question: http://stackoverflow.com/q/27879706
tags question: http://stackoverflow.com/q/27824402
tag name: dojo
tags question: http://stackoverflow.com/q/27821690
tags question: http://stackoverflow.com/q/27949054
tags question: http://stackoverflow.com/q/27905588

web-storage
tags question: http://stackoverflow.com/q/27850976
tag name: web-storage
type: Tag
tags question: http://stackoverflow.com/q/27806141

http://stackoverflow.com/comment/44307378
type: Comment
comment on: http://stackoverflow.com/a/27938590
type: AnswerComment
has text: As you can see the social icon have gap between it. How can i remove the gap. Please help me?
score: 0

http://stackoverflow.com/q/27859936
tagged with: charts
has answer: http://stackoverflow.com/a/27861014
has body: I am using Fusion Charts for creating graphs. I am using StackedBar2D currently for displaying my data. As my data increases, the graphs starts overlapping, and nothing is readable. I am unable to find a way to incorporate x-axis scrolling, i.e., vertical scrolling. Can somebody please help me?
tagged with: javascript
tagged with: fusioncharts
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27861014
type: Question
has title: FusionChart StackedBar2D vertical Scrolling
score: 0
answer count: 1
tagged with: graph

http://stackoverflow.com/q/27941549
tagged with: regex
has comment: http://stackoverflow.com/comment/44279869
has answer: http://stackoverflow.com/a/27941751
has title: How to match '+abc' but not '++abc' without lookbehind?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44279687
has comment: http://stackoverflow.com/comment/44279939
upvote count: 7
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27941732
accepted answer: http://stackoverflow.com/a/27941650
has answer: http://stackoverflow.com/a/27941629
tagged with: javascript
score: 6
has answer: http://stackoverflow.com/a/27941697
has body: In a sentence similar to: Lorem ipsum +dolor ++sit amet. I'd like to match the +dolor but not the ++sit. I can do it with a lookbehind but since JavaScript does not support it I'm struggling to build a pattern for it. So far I've tried it with: (?:\+(.+?))(?=[\s\.!\!]) - but it matches both words (?:\+{1}(.+?))(?=[\s\.!\!]) - the same here - both words are matched and to my surprise a pattern like: (?=\s)(?:\+(.+?))(?=[\s\.!\!]) doesn't match anything. I thought I can trick it out and use the \s or later also the ^ before the + sign but it doesn't seem to work like that. EDIT - background information: It's not necessarily part of the question but sometimes it's good to know what is this all good for so to clarify some of your questions/comments a short explanation: any word in any order can by marked by either a + or a ++ each word and it's marking will be replaced by a &lt;span&gt; later cases like lorem+ipsum are concidered to be invalid because it would be like splitting a word (ro+om) or writing two words together as one word (myroom) so it has to be corrected anyway (the pattern can match this but it's not an error) it should however at least match the normal cases like in the example above I use a lookahead like (?=[\s\.!\!]) so that I can match words in any language an not only \w's characters
has comment: http://stackoverflow.com/comment/44281517
favorite count: 0
possible better answer: http://stackoverflow.com/a/27941697
has comment: http://stackoverflow.com/comment/44280033
answer count: 5
has answer: http://stackoverflow.com/a/27941650
linked to: http://stackoverflow.com/q/23589174

http://stackoverflow.com/a/27848602
answers question: http://stackoverflow.com/q/27848531
has body: Your problem is that you are sending a single string instead of key - value pairs: selected = chkArray.join(',') + ","; ... data: selected, Although I would not recommend building the query string manually - serialize() will take care of the correct escaping - you can send your check-list string like: data: {check_list: selected}, Edit: Now in php you will have a $_POST['check_list'] variable but that is a list in a comma-separated string. So to convert it into an array and loop over it, you would need something like: $arr = explode(',', $_POST['check_list']); foreach ($arr as $selected) { echo $selected."&lt;/br&gt;"; }
score: 0
has comment: http://stackoverflow.com/comment/44102327
has comment: http://stackoverflow.com/comment/44102373
type: Answer
has comment: http://stackoverflow.com/comment/44103773
has comment: http://stackoverflow.com/comment/44101833
has comment: http://stackoverflow.com/comment/44101748

http://stackoverflow.com/comment/44164498
type: QuestionComment
has text: When I invert the require() calls, I still get the same results. @Louis, I'm using the Parse API, which doesn't explicitly say that I need to configure RequireJS, so I haven't been. I already have a lot of code that's running using modules, but a few modules aren't getting properly loaded. Is this a common symptom of an improperly configured RequireJS instance? The Parse docs don't mention having to configure the RequireJS instance anywhere on their site, and state that it should work they way I'm using it.
comment on: http://stackoverflow.com/q/27843225
score: 0
type: Comment

http://stackoverflow.com/q/27850092
type: Question
tagged with: google-chrome-extension
has title: chrome.tabs.onCreated and executescript for Chrome Extensions not working
upvote count: 6
tagged with: google-chrome
accepted answer: http://stackoverflow.com/a/27850144
answer count: 1
has comment: http://stackoverflow.com/comment/44104366
has body: I'm trying to execute some script inside another external page off of a new tab listener. background.js function onCreatedChrome(){ chrome.tabs.onCreated.addListener(function(tab) { if (tab.url.indexOf("chrome-devtools://") == -1) { localStorage.setItem("tabid", tab.id); chrome.tabs.executeScript(tab.id, {code: "alert('Hello World')"}, function() { if (chrome.runtime.lastError) { localStorage.setItem("Error", chrome.runtime.lastError.message); console.error(chrome.runtime.lastError.message); } else{ localStorage.setItem("Else case", "This should work") } }); } }); } function createTab(){ return function(){ var url = "https://www.yahoo.com/"; chrome.tabs.create({ url: url }); } } $(document).ready(function(){ onCreatedChrome(); $("#button").click(createTab()); }); manifest.json { "manifest_version": 2, "name": "Execute Script", "description": "ExecuteScript extension", "version": "1.0", "permissions": [ "activeTab", "tabs", "http://*/*", "https://www.yahoo.com/*" ], "content_scripts": [ { "matches": ["https://*/*"], "js": ["jquery.js"] } ], "background":{ "scripts": ["background.js", "jquery.js"] }, "browser_action": { "default_popup": "index.html" } } index.html Click Me I want thealert('Hello World')to be injected into Yahoo!'s homepage (This is just an example of what I am trying to do in another extension)
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 6
favorite count: 0
has answer: http://stackoverflow.com/a/27850144
has comment: http://stackoverflow.com/comment/44104304

http://stackoverflow.com/a/27846901
answers question: http://stackoverflow.com/q/27846766
has body: jQuery will let you scroll to a location, but you will need more than jQuery. You will need to use a web framework that will interpret the url path (like /about/ or /works/) and pass that as a parameter to the page. For example, if your site is really just one page, you will need to configure your framework (be it .NET MVC, Struts 2, NodeJS, etc.) to always return the same page no matter the path, but to take that path and insert it on the page in some way, either into the HTML or the JavaScript. For example, var desiredSection = "&lt;%=blah%&gt;"; // if you are using Java JSPs Once you have that value assigned to a JavaScript variable, you can use some jQuery or JavaScript scrolling library to perform the action as mentioned in other answers. One thing to be aware of is that this will create a potential XSS security issue so be careful if you are using this on a public-facing website.
score: 0
type: Answer

http://stackoverflow.com/a/27886819
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27886697
answers question: http://stackoverflow.com/q/27886697
score: 1
has body: Adding !important to the background-color of the red class does the trick. ids identify elements. classes classify elements. ids have higher specificity and so their styles have higher precedence. .red{ background-color: red !important; } See fiddle : http://jsfiddle.net/2v9fn1np/1/ Using !important is bad practice and usually an indicator that you have not utilized classes and ids effectively. In this case, to add the style, you can edit the style attribute of the element directly and achieve the highest precedence. Use jQuery's css method.

http://stackoverflow.com/a/27867680
answers question: http://stackoverflow.com/q/27867304
has body: Add some kind of identifier for the item you don't want to trigger the modal, a class like no-modal for example, then in your jQuery add code for the modal's show.bs.modal event. Capture the relatedElement, which is the element that triggered the event, then see if it has the class you're looking for. If it does, run e.stopPropagation(). BOOTPLY jQuery: $('#myModal').on('show.bs.modal', function (e) { var button = e.relatedTarget; if($(button).hasClass('no-modal')) { e.stopPropagation(); } }); HTML: Launch demo modal Launch demo modal × Modal Header ... Close Save changes As you can see, the second button has a class called no-modal. When clicked, the jQuery checks for the existence of that class, and if it exists it prevents the modal from popping. Clicking the first button causes the modal to pop normally because it doesn't have that class. Bootstrap modals trigger specific events when they're popped by an element on the page, from the moment they're triggered through the moment they've fully popped. You can read about these events to get an idea of what you can use them for by checking the Events section for Bootstrap modals in the official documentation.
has comment: http://stackoverflow.com/comment/52728737
has comment: http://stackoverflow.com/comment/78319661
score: 24
has comment: http://stackoverflow.com/comment/86428168
has comment: http://stackoverflow.com/comment/92948804
accepted answer of: http://stackoverflow.com/q/27867304
downvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/120082107
upvote count: 28
type: Answer

http://stackoverflow.com/q/27865614
accepted answer: http://stackoverflow.com/a/27866806
tagged with: selenium
tagged with: web-scraping
answer count: 1
tagged with: javascript
has title: Retrieve a zip file from a website in an automated script
type: AnsweredQuestion
has body: For reference: http://wogcc.state.wy.us/urecordsMenu.cfm?Skip=%27Y%27&amp;oops=ID14447 I am trying to retrieve a zip file from a that has no dedicated url. I was doing well with Python Mechanize and beautiful soup, but ran into a problem as I neared the end of the process. After selecting the option that I want in the table (via mechanize/bs4), I then tried to get my browser to "submit" the form and retrieve my zip file. However, the "submit" button is just a gif image with an onclick="javascript:submit()" call. When you hit that button by hand in a browser, it redirects you to a generic ".....testdwn.cfm?RequestTimeout=2000" page, no matter which option you select prior to clicking the gif image (also downloads your zip file). So there's my problem with the no dedicated zip url. So from what I've read online the past few days, Python/Mechanize cannot read javascript in any capacity, so I'm SOL on that avenue it seems. If mechanize could somehow just click that button, all would be fine and well. What method should I pursue in order to pull this data? I've read about selenium, but I was wondering what option would be absolutely easiest and best to pull this data, javascipt-based or python-selenium based, or something else? Python is preferred if it can be managed. Thanks in advance!
has answer: http://stackoverflow.com/a/27866806
type: Question
tagged with: mechanize
tagged with: python
score: 0

http://stackoverflow.com/comment/44262336
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27930791
has text: @Steve Don't get smart with me =)
score: 1

http://stackoverflow.com/comment/44172327
comment on: http://stackoverflow.com/q/27885556
has text: `onclick` is expected to be a function, that's why you have to assign a function.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/tag/csv
type: Tag
tags question: http://stackoverflow.com/q/27838875
tag name: csv
tags question: http://stackoverflow.com/q/27825943
tags question: http://stackoverflow.com/q/27948264
tags question: http://stackoverflow.com/q/27914590
tags question: http://stackoverflow.com/q/27928404
tags question: http://stackoverflow.com/q/27883900
tags question: http://stackoverflow.com/q/27912763
tags question: http://stackoverflow.com/q/27951754
tags question: http://stackoverflow.com/q/27823770

http://stackoverflow.com/a/27818079
has body: You could use JSONP request to avoid getting CORS errors, but this SOAP service does not wrap data in script. Just try reading the docs here. You'll most probably have to create a client. NWS also provides a RESTful API. Read the tutorials here.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27815442

http://stackoverflow.com/comment/44090442
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27843225
has text: Try inverting the require() calls. What happens ? Do you only have moduleTwo defined ?

http://stackoverflow.com/comment/130550426
score: 0
type: AnswerComment
has text: This answer is no longer valid in react as @ccalvert stated. This answer needs to be edited.
type: Comment
comment on: http://stackoverflow.com/a/32761932

http://stackoverflow.com/comment/44289666
type: QuestionComment
type: Comment
has text: ***manipulate as seen in the picture/screenshot*** does not say very much; maybe some description would be helpful.
comment on: http://stackoverflow.com/q/27927445
score: 0

http://stackoverflow.com/q/27863515
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/6583330
has comment: http://stackoverflow.com/comment/44129255
has answer: http://stackoverflow.com/a/27863597
answer count: 3
has answer: http://stackoverflow.com/a/27863747
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44129151
has body: Suppose I have below codes written with jquery: &lt;script&gt; $(function () { $("#btn1").click(function () { alert("OK"); }); }); &lt;/script&gt; &lt;body&gt; &lt;input type="button" value="input" id="btn1" /&gt;&lt;label id="lbl"&gt;&lt;/label&gt;&lt;br /&gt; &lt;/body&gt; I need get the function of btn1. The pseudo code as follows: var f=Get_function_of_btn1("#btn1"). Then, when I call f(), it alerts "OK". How to implement it? BTW, can jquery print the function as string? like below: console.log(f); then it will print : function () { alert("OK"); }
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44129206
linked to: http://stackoverflow.com/q/9086106
has comment: http://stackoverflow.com/comment/44129725
has answer: http://stackoverflow.com/a/27863574
linked to: http://stackoverflow.com/q/9046741
has title: with Jquery, how to get the function that the button binds
tagged with: dom
type: Question
score: 0
has comment: http://stackoverflow.com/comment/44129970

http://stackoverflow.com/q/27819842
upvote count: 2
type: UnansweredQuestion
tagged with: node.js
score: 1
downvote count: 1
tagged with: unit-testing
type: Question
has body: I am just trying out jasmine-node. I need some help with promise resolution. I have simple js file //dataService.js var Q = require('q'); console.info("Q is "+Q); exports.test = function() { console.warn("Will call promise now"); this.getQuestions().then(function() { console.log("Test.."); }); }; exports.getQuestions = function() { var deferred = Q.defer(); for(i=0; i&lt;=10; i++) { if(i===10) { deferred.resolve(i); } } return deferred.promise; // return { // 'Question1': 'What is your name' // } } //end of dataService.js And the test is // testspec.js var assert = require("assert"); var q = require('q'); var testFile = require('../routes/dataService'); var fs = require('fs'); describe('#indexOf()', function(done){ it('should return -1 when the value is not present', function(done){ console.log("Teststststst" + fs); assert.equal(-1, [1,2,3].indexOf(5)); assert.equal(-1, [1,2,3].indexOf(0)); spyOn(testFile, 'getQuestions').andCallFake(function() { console.warn("Spy Called********************"); var deferred = q.defer(); deferred.resolve(1); console.info("passing 1****"); //done(1); return deferred.promise; }); spyOn(console, 'log'); testFile.test(); console.info("Testststststsinggggggggg"); expect(console.log).toHaveBeenCalledWith("Test.."); console.info("Done*****************"); }) }); //end of test file Now as you can see I am calling testFile.test() function which is nothing but the test function in dataService.js. This function calls the getQuestions() in the dataService.js (same file), which returns a promise. I have mocked the getQuestions() function in my test, it is getting called and is resolving the promise, but my test() success method is not getting called, so my test is failing.
has answer: http://stackoverflow.com/a/27897216
tagged with: javascript
answer count: 2
tagged with: jasmine
has answer: http://stackoverflow.com/a/27820315
favorite count: 0
tagged with: promise
has title: How to test a function using jasmine-node which internally calls a function which returns a promise?

http://stackoverflow.com/a/27951636
downvote count: 0
has comment: http://stackoverflow.com/comment/44300306
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27951545
type: Answer
answers question: http://stackoverflow.com/q/27951545
has body: You can do something like this: ^(?:\d{4,5}\w{0,2}(?:\.\w{1,2})?|\w{3}-\d{6})$ Demo I just used the alternative operator (|) to split between old and new formats. Note that your original regex ([0-9]{4,5}[\.?\w*]{0,4}) probably has an issue: [\.?\w*] means . or ? or a word character or *, and it doesn't seem that's what you're after. I made it stricter per your examples, but you may have to adjust it. Also, note that \w means [0-9a-zA-Z_] in JS - this may not be exactly what you're after (particularly the underscore).
score: 2

http://stackoverflow.com/a/27904491
has body: According to the official documentation, the .click() method only accepts a single handler. You cannot declare two different handlers for that purpose. There are two solutions to that — one is to delegate the animation to CSS, and use .toggleClass() instead, or to use stateful code: Store the toggle status of the element in its own jQuery data object Read the data object. If it doesn't exist or is 0, do something (condition 1) If it exists and is 1, do something else (condition 2) You can of course modify the binary conditions 1 and 2 into the effect you want to achieve. In addition, in order to prevent jerky animation due to rapid clicking/toggling, you should stop the animation before you more animations to the queue. This is done by chaining .stop(true, true) to the object. $(function() { $('.bet-slip-outer').click(function() { // Check state if(!$(this).data('toggle') || $(this).data('toggle') == 0) { $(this).data('toggle', 1); $('.bet-slip').stop(true, true).animate({ 'right': '-240px' }); } else { $(this).data('toggle', 0); $('.bet-slip').stop(true, true).animate({ 'right': '0' }); } }); }); .bet-slip { position: relative; } bet-slip
answers question: http://stackoverflow.com/q/27904326
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/27817712
score: 3
has comment: http://stackoverflow.com/comment/44049443
downvote count: 0
answer count: 1
tagged with: helenus
has answer: http://stackoverflow.com/a/27822301
tagged with: javascript
favorite count: 0
tagged with: cassandra
has body: I am developing an application in nodejs with cassandra driver using helenus. the version of helenus is 0.6.10. This is app.js. var helenus = require('helenus'); var pool = new helenus.ConnectionPool({ hosts: ['localhost:9160'], keyspace: 'test_dev', user: '', password: '' }); pool.connect(function(err, keyspace) { if (err) throw err; console.log('Listening on port 3000....'); }); pool.on('error', function(err) { if (err) throw err; }); When we call pool.connect then it is throwing following error in the callback. error name : "HelenusNoAvailableNodesException" error message: "Could Not Connect To Any Nodes" When i have gone through the troubleshooting the problem. I have found that onDescribe method in Connection.prototype.use method is being throwing an error which is "NotFoundException". What i am doing wrong? Any help.
tagged with: node.js
type: AnsweredQuestion
has title: Helenus isn't able to connect
upvote count: 3
accepted answer: http://stackoverflow.com/a/27822301
type: Question
has comment: http://stackoverflow.com/comment/44041832

http://stackoverflow.com/comment/44156656
comment on: http://stackoverflow.com/a/27877235
type: Comment
has text: I meant az sorry for the confusion.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27958984
has answer: http://stackoverflow.com/a/27959197
accepted answer: http://stackoverflow.com/a/27959197
tagged with: javascript
has comment: http://stackoverflow.com/comment/44312400
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have two files, named main_page.html and dialog_box.html (see code below). I want my handleCloseDialogButton() to "close the dialog box", in other words to reload main_page.html, with theFrame.style.display reset to "none". How can I do this ? Should I use window.open("main_page.html") or window.location.href="main_page.html" or something else ? Note: I do not want to use Javascript’s alert() function because its capabilities are not sufficient for what I need. Contents of main_page.html : Hello world. This is the main page. Contents of dialog_box.html : Hello world. I am the dialog box.
has title: Close a (dialog box) iFrame from a button within the iFrame
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44312129
score: 1
has comment: http://stackoverflow.com/comment/44312309
upvote count: 1
type: Question

http://stackoverflow.com/q/27863009
has title: Detecting composed characters to ignore some of them
answer count: 3
score: 5
tagged with: firefox
downvote count: 0
favorite count: 0
has body: I am writing a contenteditable-based widget which needs to handle text input on its own. It is fairly easy to deal with both ascii and non-ascii characters with something like this: container_element.addEventListener('keypress', function(event) { if (event.ctrlKey || event.altKey || event.metaKey) { return; } if (event.which != 0 &amp;&amp; event.charCode != 0) { event.preventDefault(); var c = String.fromCharCode(event.which); handle_character(c); } }); Now, if I configure my local system to input non-ascii characters through dead key composition (say, altgr for example), the above fails miserably. Fancy editors like google docs appear to handle this case quite well across a wide range of OSes and browsers without any need for external plugins so, it is clear that it is possible from the browser-fired events to detect which character is generated from a composition sequence of dead keys. However, I have been unable to find out how exactly (not even for a single browser/OS combination, say, Chrome/Linux). Hence my question: would anyone know how to detect which character is being input from a keypress or keydown handler when we are getting a dead-key composition sequence ?
has answer: http://stackoverflow.com/a/30768926
tagged with: http://stackoverflow.com/tag/html
tagged with: safari
accepted answer: http://stackoverflow.com/a/30768926
possible better answer: http://stackoverflow.com/a/27897174
has answer: http://stackoverflow.com/a/76820833
has answer: http://stackoverflow.com/a/27897174
tagged with: google-chrome
type: Question
type: AnsweredQuestion
upvote count: 5
tagged with: javascript

http://stackoverflow.com/comment/44224197
has text: What's the server side code that processes this request?
comment on: http://stackoverflow.com/q/27912336
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27823480
has comment: http://stackoverflow.com/comment/44053263
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/44053025
upvote count: 3
has comment: http://stackoverflow.com/comment/44053003
has comment: http://stackoverflow.com/comment/44053076
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44053937
tagged with: window.open
type: Question
tagged with: google-chrome-extension
score: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/44054082
has title: Chrome Extension not working with window.open
has body: I am writing a chrome extension that needs to modify the html of a popup window that popups with the javascript code something like: var myWindow = window.open("", "MsgWindow", "width=200, height=100"); myWindow.document.write(" This is 'MsgWindow'. I am 200px wide and 100px tall! "); This javascript code is on another website, and I want the extension to run when the popup is opened. In manifest.json, I have { "name":"PresentIT", "description":"Connects Google Drive to PresentIT", "version":"0.1", "manifest_version":2, "content_scripts": [ { "matches": ["<all_urls>"], "js": ["script.js"] } ] } and script.js I have alert(document.title); When I open a normal webpage I get an alert dialog with the title. However, when I use the javascript code window.open, there is no alert. How can I get the extension to work on the popup page as well? Thanks

http://stackoverflow.com/comment/44057468
type: Comment
comment on: http://stackoverflow.com/q/27825813
type: QuestionComment
has text: `Object` is the constructor function to create an object, so that is an instance of the `Function` type.
score: 0

http://stackoverflow.com/q/27944231
tagged with: wordpress
type: Question
has answer: http://stackoverflow.com/a/27944397
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44283771
has title: Javascript Conflicts in Console for Wordpress Plugin Global Gallery
has body: I hope you can help me to debug my conflicts on the site I am working on: URL: http://metalotechnika.com PW: 12345678 If you then go to http://metalotechnika.com/foto-galeri/foto-kangjella-hekuri/ You will find a gallery that isn't loading. Most probably due to javascript conflicts. Could you pint me in the right direction here? You will find some errors in the console: "TypeError: jQuery(...).lcweb_lazyload is not a function" I thougt, that it must be jQuery not loading correctly. But I already tested jQuery in my main.js, and is working. Don't know about this time.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27944397

undefined
tags question: http://stackoverflow.com/q/27857498
tag name: undefined
type: Tag
tags question: http://stackoverflow.com/q/27834820
tags question: http://stackoverflow.com/q/27941288
tags question: http://stackoverflow.com/q/27862560

http://stackoverflow.com/comment/44965597
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27879163
has text: I'm doing something similar to this but not quite the same. In my `webpack.config.js` I created several different configurations that I switch between depending on the NODE_ENV environment variable that I set when i run different `npm` scripts. For example, in my `package.json` I have a script called `build-dev` which runs `"set NODE_ENV=development&& webpack"`. Hope this gives you some ideas!

http://stackoverflow.com/comment/44054265
comment on: http://stackoverflow.com/q/27823348
score: 0
has text: no they dont, i use a plugin to sync the users across domains which are on different servers and database.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27848589
type: Answer
accepted answer of: http://stackoverflow.com/q/27847720
has comment: http://stackoverflow.com/comment/44155849
has comment: http://stackoverflow.com/comment/44179583
answers question: http://stackoverflow.com/q/27847720
has body: What you can do : Solution one is to have family model which have a id and in the user model I would have a field with the family id (if you don't think a family model is needed you can just have a field with a family name, but it will need to be unique for each family). Exemple with family model: var FamilySchema = new Schema({ name: String }); var family = db.model('family', FamilySchema); var PersonSchema = new Schema({ name : String, family : { type : Mongoose.Schema.ObjectId, ref : 'family' } }); Simple exemple with family name as a string: var PersonSchema = new Schema({ name : String, family : String }); Plus if you put a index on the family field in the user model it would be really fast to retrieve all the family members of someone. Here is more about index in mongodb database : http://docs.mongodb.org/manual/indexes/ Solution two you can make use of a collection, family model containing all the family members. var PersonSchema = new Schema({ name : String }); var person = db.model('person', PersonSchema); var FamilySchema = new Schema({ name : String, members : [{ type : Mongoose.Schema.ObjectId, ref : 'person' }] });
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/44094993
type: QuestionComment
has text: Run `Object.keys` on `titles`. This returns an array of property keys present on the `title` object. You can access the object properties by using `titles[key]`.
comment on: http://stackoverflow.com/q/27845166
score: 0
type: Comment

http://stackoverflow.com/comment/44175820
has text: There's nothing wrong with nesting if you want to differentiate errors in different parts.
score: 1
comment on: http://stackoverflow.com/q/27883439
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44197964
comment on: http://stackoverflow.com/a/27898801
type: Comment
has text: Template url is also same , (we use same form in both cases)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44070521
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27832338
type: QuestionComment
has text: http://esprima.org/ http://marijnhaverbeke.nl/acorn/ --- took me 10 seconds to google.

http://stackoverflow.com/a/27921958
type: Answer
has comment: http://stackoverflow.com/comment/44414522
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/27902548
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27902548
has body: SOLVED: In application.js I moved the file with the error to the bottom. Everything seems to work fine. Apparently in production mode files with warnings/error act differently.

http://stackoverflow.com/comment/44133727
has text: I think I got it! When you declare your slick slider add this `arrows: false` I'll update my snippet.
type: Comment
comment on: http://stackoverflow.com/a/27864777
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44046808
comment on: http://stackoverflow.com/a/27820561
score: 1
type: AnswerComment
has text: You are missing the fact that string can also contain numbers. That is why you can't just post-process it like this.
type: Comment

http://stackoverflow.com/comment/44303584
type: AnswerComment
has text: Thanks for the clarification. Any idea why the #pausebutton does not do as desired?
type: Comment
comment on: http://stackoverflow.com/a/27953995
score: 0

http://stackoverflow.com/comment/44303340
type: Comment
has text: Yes, the text inside the popup needs to be bigger
type: QuestionComment
comment on: http://stackoverflow.com/q/27954129
score: 0

http://stackoverflow.com/q/27949820
linked to: http://stackoverflow.com/q/5525795
has comment: http://stackoverflow.com/comment/44295314
has answer: http://stackoverflow.com/a/27960599
type: AnsweredQuestion
has title: _.sortBy object key value for d3 chart
tagged with: d3.js
type: Question
has comment: http://stackoverflow.com/comment/44296035
tagged with: underscore.js
accepted answer: http://stackoverflow.com/a/27960599
has body: I know you're not supposed to sort javascript objects but I need to for a d3 chart. I have an object with a key of FICO score ranges and value of the count of how many in that range var counts = {680-700: 30, 620-640: 41, 640-660: 24, 660-680: 10} I need to return a sorted object such that the lowest value keys come first. var desired_obj = { 620-640: 41, 640-660: 24, 660-680: 10, 680-700: 30 } I attempted to use _.sortBy but it only returns the values _.sortBy(counts, function(val, key) { return val })
score: 0
has comment: http://stackoverflow.com/comment/44295738
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44295165

http://stackoverflow.com/a/27939891
has comment: http://stackoverflow.com/comment/44276871
has body: See this answer. You'll need to override the real storage service with your mocked one: module(function ($provide) { $provide.value('storage', mockStorage); });
accepted answer of: http://stackoverflow.com/q/27927922
answers question: http://stackoverflow.com/q/27927922
has comment: http://stackoverflow.com/comment/50910153
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/50887129
upvote count: 2

http://stackoverflow.com/comment/44206869
type: AnswerComment
comment on: http://stackoverflow.com/a/27893136
type: Comment
has text: Does it make any difference if I replace div id using your technique or mine? Well omitting a little bit of performance which I don't really care about there's no difference. It doesn't work for styles for both of them
score: 0

http://stackoverflow.com/q/27964068
answer count: 4
has answer: http://stackoverflow.com/a/27964120
has body: I have some checkboxes in an overlay and as long as they are not checked the and the tag should not be seen. HTML for the and tag: This is the checkbox: Alles And this is the function: $("#extra").css("display","none"); $("#checkme").click(function(){ if ($("#checkme").is(":checked")) { $("#extra").show("fast"); } else{ $("#extra").hide("fast"); } }); I also tried some other ways but nothing helped.
has title: Hide a tag and img if the checkbox is not checked
has comment: http://stackoverflow.com/comment/44321356
downvote count: 1
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27964199
has comment: http://stackoverflow.com/comment/44321605
has answer: http://stackoverflow.com/a/27964512
has comment: http://stackoverflow.com/comment/44321130
upvote count: 0
has answer: http://stackoverflow.com/a/27964330
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
tagged with: css

http://stackoverflow.com/a/27810135
score: 2
downvote count: 0
has body: First of all, there is no such error when I do: var Promise = require("bluebird"); Promise.promisifyAll(require("restify")); Secondly, restify unfortunately uses some weird getters when exporting the module, as getters can (and do) have side effects, promisifyAll will not visit them, so the one line magic won't work. You need to promisify the classes manually, e.g. Promise.promisifyAll(require("restify").JsonClient.prototype); Then you would call: client.getAsync(path).spread(function(req, res, obj) { });
has comment: http://stackoverflow.com/comment/68546190
has comment: http://stackoverflow.com/comment/44032395
has comment: http://stackoverflow.com/comment/44029621
has comment: http://stackoverflow.com/comment/44030196
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27810012
type: Answer
has comment: http://stackoverflow.com/comment/44029670
answers question: http://stackoverflow.com/q/27810012
has comment: http://stackoverflow.com/comment/44029882

http://stackoverflow.com/comment/44024065
score: 2
has text: Also, the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font) tag is long both deprecated, and obsoleted.
comment on: http://stackoverflow.com/q/27807495
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44130759
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27863806
has text: True. The missing } is a typo when entering the question. Still working on the issue
type: QuestionComment

http://stackoverflow.com/comment/44193345
type: QuestionComment
has text: please, update your post with the change event code.
score: 1
comment on: http://stackoverflow.com/q/27896322
type: Comment

http://stackoverflow.com/a/27865620
answers question: http://stackoverflow.com/q/27844883
type: Answer
has comment: http://stackoverflow.com/comment/44250903
score: 0
has comment: http://stackoverflow.com/comment/44248349
has body: To prevent submitting you can change the page template. Open page properties, in the section Shared Components find Templates. Near the word Page you will see a link to its template. Follow this link, then find a section Standard Tab Attributes. In the field Current Tab you will see something like this: &lt;li&gt;&lt;a href="#TAB_LINK#" class="active"&gt;#TAB_LABEL#&lt;/a&gt;#TAB_INLINE_EDIT#&lt;/li&gt; Change this value to: &lt;li&gt;&lt;a class="active"&gt;#TAB_LABEL#&lt;/a&gt;#TAB_INLINE_EDIT#&lt;/li&gt; After that an active item in a menu will be displayed as a static text, not as a link. All pages with this page template will have this behavior. If you don't need to change behavior of all pages: before changing template make copy of it, change the copy and choose the new template in a page properties.

http://stackoverflow.com/comment/44041273
has text: @chipChocolate.py Show or it didn't happen ;)
comment on: http://stackoverflow.com/q/27817632
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/a/41770906
has body: I was looking to do something similar to pass linting, and this regex finds all quotes before semicolons in the string: "(\w*)": And replace that with just the text, excluding the quotes: $1:
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27952695
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27952695
score: 2

http://stackoverflow.com/comment/44106464
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27851103
type: Comment
has text: I couldn't find anything in HTML 4, but HTML5 defines this behavior: http://www.w3.org/html/wg/drafts/html/master/webappapis.html#event-handler-attributes

http://stackoverflow.com/a/27873485
type: Answer
has body: You should be able to access it through the node mongo driver directly as in this question. So for the system.js collection I think you use: // on server var db = MongoInternals.defaultRemoteCollectionDriver.mongo.db; var systemJS = db.collection('system.js'); This question shows some non-meteor examples of code for the node driver.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27869279
answers question: http://stackoverflow.com/q/27869279
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44311650
comment on: http://stackoverflow.com/a/27958780
type: Comment
has text: Updated answer. Please check
score: 0
type: AnswerComment

http://stackoverflow.com/q/27871932
tagged with: ajax
tagged with: angularjs
type: UnansweredQuestion
score: 0
has title: Query MVC controller with Ajax POST then redirect with a model
type: Question
has answer: http://stackoverflow.com/a/27872254
tagged with: asp.net-mvc
has body: Let's say that I have data that has a complicated format (a list of object) that I want to post to an MVC controller, and then I want this controller to redirect me to the page i want with the model it generated. Just like a POST request from a regular form would do. Instead, when I do this angular request with angular: $http({ method: 'POST', url: '/user/search', data: $scope.dataToSearch }).success(function() { // what do put here ? }) .error(function() { }); the controller successfully receives the data the controller successfully generates the model I want the controller returns "View("viewWanted", model") but it DOESN'T redirect. All I receive is a status code 200, and the raw html of the page I wanted without redirecting me to this actual page. The thing is, if I do "window.location" on success, my controller won't generate the model because I have to post the data. In conclusion, how to post then redirect like with a regular form, but with using Ajax/Angular/Javascript in general ? Thanks.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44146353
answer count: 1

http://stackoverflow.com/a/27957006
type: Answer
score: 0
has body: This code should work fine, if I understand your problem well enough. lorem ipsum lorem ipsum
answers question: http://stackoverflow.com/q/27956932

http://stackoverflow.com/comment/44227651
has text: I'm not getting what special here, just call that after `for` loop finished.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27914209
score: 0

openlayers-3
type: Tag
tag name: openlayers-3
tags question: http://stackoverflow.com/q/27817709
tags question: http://stackoverflow.com/q/27903389
tags question: http://stackoverflow.com/q/27820784
tags question: http://stackoverflow.com/q/27890583

http://stackoverflow.com/comment/44051598
has text: @Teemu that solved my issue, there's over 2k more rows of javascript, and i had a variable declaration with same name.
score: 1
comment on: http://stackoverflow.com/q/27822758
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44292221
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27948608
has text: I think the text bit is probably meant to be `$('#' + myId + '-text').text()`. (I have my mind-reading hat on today)
score: 0

http://stackoverflow.com/a/27876617
score: 1
has body: Because of how HTML works you can't put a class on a textnode. You can only put a class on an element which may or may not contain textnodes. What you can do though is cut up the text in JavaScript so you don't manually need to add the spans. Here is a live example: http://codepen.io/anon/pen/YPNvZy the animation behaviour is a little bit strange. I'm not sure what causes that, but it does demonstrate how to automatically split the text. I've also opted to keep the structure like a poem, I'm not sure if you want that. var poem = "I will arise and go now,\n" + "and go to Innisfree,\n" + "And a small cabin build there,\n" + "of clay and wattles made;\n" + "Nine bean-rows will I have there,\n" + "a hive for the honey-bee,\n" + "And live alone in the bee-loud glade.\n" + "And I shall have some peace there,\n" + "for peace comes dropping slow,\n" + "Dropping from the veils of the morning\n" + "to where the cricket sings;\n" + "There midnight’s all a glimmer,\n" + "and noon a purple glow,\n" + "And evening full of the linnet’s wings.\n" + "I will arise and go now,\n" + "for always night and day\n" + "I hear lake water lapping\n" + "with low sounds by the shore;\n" + "While I stand on the roadway,\n" + "or on the pavements grey,\n" + "I hear it in the deep heart’s core."; var lines, i, div, divs = []; lines = poem.split("\n"); for (i = 0; i &lt; lines.length; i += 1) { div = document.createElement("div"); div.className = "line"; div.appendChild(document.createTextNode(lines[i])); divs.push(div); document.getElementById("container").appendChild(div); } function shuffle(divs) { var item = divs[Math.floor(Math.random() * divs.length)]; var remove = divs[Math.floor(Math.random() * divs.length)]; item.className = "shine"; remove.className = ""; } setInterval(function () { shuffle(divs); }, 1000);
downvote count: 0
answers question: http://stackoverflow.com/q/27876479
type: Answer
upvote count: 1

http://stackoverflow.com/q/27913206
type: Question
answer count: 2
has title: ng-click fires multiple times inside ng-repeat ie9
tagged with: javascript
has body: I have a weird quirk that appears to only be happening in ie9 with AngularJS. I have a repeated button with ng-repeat and a function with ng-click. When the button is clicked the function appears to run multiple times and goes between the buttons. I've tried to remove as much conflicting code as possible and whittled it down to these parts. I have come to the conclusion that it only happens on the add remove class if else statement, when this is removed it appears to work ok. Here is my code: {{ answer.Answer }} And the function code is here: $scope.triggerNext = function(QuestionNo, AnswerValue) { console.log('function run'); console.log(QuestionNo); console.log(AnswerValue); if($('.ansbtn[data-ans="'+AnswerValue+'"]').hasClass('active')) { $('.ansbtn[data-ans="'+AnswerValue+'"]').removeClass('active'); } else { $('.ansbtn[data-num="'+QuestionNo+'"]').removeClass('active'); $('.ansbtn[data-ans="'+AnswerValue+'"]').addClass('active'); } };
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/27954772
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27913415

http://stackoverflow.com/q/27856504
has comment: http://stackoverflow.com/comment/44116407
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44116535
has title: Using Javascript add border style color for input field(when submit with no value) which has already border in css with !important tag
has comment: http://stackoverflow.com/comment/44116997
has comment: http://stackoverflow.com/comment/44116554
has answer: http://stackoverflow.com/a/27856982
has body: I am already using script below for that but can override !important in CSS &lt;script&gt; var forms = document.getElementsByTagName('form'); for (var i = 0; i &lt; forms.length; i++) { forms[i].noValidate = true; forms[i].addEventListener('submit', function(event) { //Prevent submission if checkValidity on the form returns false. if (!event.target.checkValidity()) { event.preventDefault(); //Implement you own means of displaying error messages to the user here. document.getElementById("first_name").style.border ="1px solid red"; } }, false); } &lt;/script&gt; &lt;form action="" method="post" target="_top"&gt; &lt;input type="text" name="first_name" id="first_name" value="" style="width:100px;height: 25px !important;" placeholder="Name" required &gt; &lt;/form&gt; and why i want border color when submit button clicked if no value set in input field because safari does not support required attribute.......... If any one can help pls help me out either overriding border attribute solution or alternative solution for required attribute which can work on safari browser too. NOTE:- No use of JQuery in any way....
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44116809
accepted answer: http://stackoverflow.com/a/27856982
has comment: http://stackoverflow.com/comment/44116939
linked to: http://stackoverflow.com/q/11178673
type: Question
has comment: http://stackoverflow.com/comment/44116950
tagged with: javascript

http://stackoverflow.com/q/27875090
tagged with: javascript
score: 1
favorite count: 0
type: Question
tagged with: node.js
has body: I'm new to JavaScript and Node.js and trying to solve the challenge "juggling async" of learnyounode. When the error occured, I've tested my other solutions that use http.get() and all of them throw the exact same error. They worked just fine before, though. That's a code that worked before: var http = require('http'); var url = process.argv[2]; function cb_resp(res) { res.setEncoding('utf-8'); res.on("data", console.log); res.on("error", console.error); } var respo = http.get(url, cb_resp) The error I keep getting: $node httpclient.js www.google.de events.js:72 throw er; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at errnoException (net.js:904:11) at Object.afterConnect [as oncomplete] (net.js:895:19) If it helps, I run a Mac with OS X 10.10.1 and use Brackets as my IDE of choice. I have only 1 terminal open and rebooted my system. How can I fix it and could somebody please explain what happened, so that I can prevent/solve that problem on my own from now on?
has answer: http://stackoverflow.com/a/27875495
tagged with: econnrefused
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/27875495
has title: node.js http.get() throws: events.js:72 ECONNREFUSED
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/27950539
has title: Javascript create array and check 5th element
downvote count: 4
upvote count: 0
possible better answer: http://stackoverflow.com/a/27950568
has comment: http://stackoverflow.com/comment/44296099
score: -4
has body: I would like to know if it is possible to take a string and turn it an array, and also check its 5th letter. Like "I am walking on the street", check if its 5th letter is "z",for example.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44296110
linked to: http://stackoverflow.com/q/96428
type: Question
has answer: http://stackoverflow.com/a/27950568
has comment: http://stackoverflow.com/comment/44298557
accepted answer: http://stackoverflow.com/a/27950652
tagged with: arrays
has comment: http://stackoverflow.com/comment/44296054
tagged with: javascript
has answer: http://stackoverflow.com/a/27950572
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/27950652

http://stackoverflow.com/comment/44114762
has text: @DaveSanders: I am wrong man to answer that question really as I lack the experience necessary. Also it is out of scope for this question and would require much more specification about what is needed actually and is unanswerable with that few information. Sorry mate :(
type: Comment
comment on: http://stackoverflow.com/a/27847998
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44310309
has text: So you are saying either text of another image cannot be drawn on an existing image dynamically? I have done the static image (such as the URL that you mentioned here) and that works fine, but I need it dynamcally. Is there a possibility that I could use another canvas of same size over this canvas to write text or draw images?
type: Comment
comment on: http://stackoverflow.com/a/27957997
score: 0
type: AnswerComment

http://stackoverflow.com/a/27877684
has body: Use Nokogiri And you can also use Css Selector Gadget to find your classes. This should be helpful to find proper header and body classes or id's. Reader View doesn't save bandwidth
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27871462
has comment: http://stackoverflow.com/comment/44160663

http://stackoverflow.com/a/27916249
has comment: http://stackoverflow.com/comment/44231411
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27916059
answers question: http://stackoverflow.com/q/27916059
type: Answer
has body: $('iframe[src*="youtube.com"]').each(function() { $(this).closest("div").attr("id","resp-video"); });
downvote count: 0
has comment: http://stackoverflow.com/comment/44231326
score: 1
has comment: http://stackoverflow.com/comment/44231376

http://stackoverflow.com/comment/44278594
comment on: http://stackoverflow.com/a/27941187
has text: @Sébastien Gicquel: In that case single quotes will do: http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44118262
comment on: http://stackoverflow.com/q/27857696
has text: Use `@Url.Content("~/js/bootstrap.js")"` for the source.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/27844883
has answer: http://stackoverflow.com/a/27865620
has answer: http://stackoverflow.com/a/28071469
score: 1
has comment: http://stackoverflow.com/comment/44094291
has comment: http://stackoverflow.com/comment/44118531
upvote count: 1
type: Question
has body: I have just started working with Oracle APEX and would like users to be able to download reports from my application.The problem is I have a number of reports which have a large number of rows. Each time a user clicks on a page tab, the page is resubmitted and the query for the reports are executed again. This results in a lot of delay and is becoming frustrating for the users! Is it possible to stop APEX from resubmitting the page until the user clicks a refresh button or is it possible to stop the query for reports from executing everytime the user clicks on a page tab?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44248252
has comment: http://stackoverflow.com/comment/44288280
answer count: 2
has comment: http://stackoverflow.com/comment/44248837
has comment: http://stackoverflow.com/comment/44121565
downvote count: 0
tagged with: oracle-apex
favorite count: 0
has title: is it possible to prevent oracle apex from submitting a page until a user clicks on a refresh button on that page?
type: UnansweredQuestion
tagged with: oracle-database

http://stackoverflow.com/q/27957240
score: 0
has answer: http://stackoverflow.com/a/27965867
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27957392
possible better answer: http://stackoverflow.com/a/27965867
has body: I am a fairly beginner programmer, so excuse me if the solution to this one is fairly simple (Although I have looked hard into finding an already-posted solution). I am experimenting with object oriented programming, but get this error message when running the program "Uncaught TypeError: undefined is not a function" at line 14. var Gladiator = Object.create(null); Gladiator.prototype = { becomeGladiator: function(attack, defense, hitPoints, name) { this.attack = attack; this.defense = defense; this.hitPoints = hitPoints; this.name = name; }, }; var Human = Object.create(Gladiator.prototype); Human.prototype = { becomeHuman: function(attack, defense, hitPoints, name) { this.becomeGladiator(attack, defense, hitPoints, name); //Error here }; var ethan = Object.create(Human.prototype); ethan.becomeHuman(14, 12, 15, "Ethan") Thank you.
has title: Uncaught TypeError: undefined is not a function
has comment: http://stackoverflow.com/comment/44308845
type: AnsweredQuestion
tagged with: oop
has comment: http://stackoverflow.com/comment/44308982
tagged with: prototype
type: Question
has answer: http://stackoverflow.com/a/27957392

http://stackoverflow.com/a/27836224
has comment: http://stackoverflow.com/comment/44077256
has comment: http://stackoverflow.com/comment/44077311
score: 1
has comment: http://stackoverflow.com/comment/44077612
has comment: http://stackoverflow.com/comment/44085478
answers question: http://stackoverflow.com/q/27836169
has body: You are try to get the attribute data-value. There is no property like that. Check JSFIDDLE Try this: return $(a).data('site').toLowerCase() &gt; $(b).data('site').toLowerCase(); or return $(a).attr('data-site').toLowerCase() &gt; $(b).attr('data-site').toLowerCase(); Output will be: atlass batch book crm capsule chat hip force hangouts ...
has comment: http://stackoverflow.com/comment/44085700
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44077544

http://stackoverflow.com/q/27828374
answer count: 1
tagged with: javascript
score: 0
tagged with: node.js
has body: So i send a normal string from a java client to the server and the server successfully recieves it. The problem is that the recieved data is more than just the string which i originally sent. i send the data in java with a DataOutputStream - > writeUTF("Welcome..."); See console output without using JSON.stringify() nodeJS client connection --&gt; 127.0.0.1 Data arrived type = string Data = Welcome... end Disconnect --&gt; 127.0.0.1 java client connection --&gt; 127.0.0.1 Data arrived type = string Data = Welcome... end Disconnect --&gt; 127.0.0.1 with JSON.stringify() nodeJS client connection --&gt; 127.0.0.1 Data arrived type = string Data = "Welcome..." end Disconnect --&gt; 127.0.0.1 java client connection --&gt; 127.0.0.1 Data arrived type = string Data = "\u0000\nWelcome..." end Disconnect --&gt; 127.0.0.1 so i wonder how i can get rid of the stuff in front of my message when i recieve it from the java client? A normal replace() makes no sense because it varies.
accepted answer: http://stackoverflow.com/a/27828577
has comment: http://stackoverflow.com/comment/44063686
has title: send data from java client to nodejs server
type: AnsweredQuestion
tagged with: java
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/27828577
has comment: http://stackoverflow.com/comment/44062798

http://stackoverflow.com/comment/44072991
type: Comment
has text: @JohnSt Please mark as correct answer if this helped you solve your problem. Thanks.
comment on: http://stackoverflow.com/a/27831809
score: 0
type: AnswerComment

http://stackoverflow.com/q/27919203
has answer: http://stackoverflow.com/a/27919784
answer count: 1
tagged with: jquery
has body: I got this script to use on my project, one single page with scroll. Now my problem was everytime the page scrolled on the exact section the title always been hide by my fixed menu. Below are the script $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1500,'easeInOutExpo'); return false; } } }); Hope you guys can help me. Many thanks!
tagged with: scrolltop
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27919784
tagged with: javascript
has title: How could I add class on this script
has comment: http://stackoverflow.com/comment/44236238
type: Question
has comment: http://stackoverflow.com/comment/44236173
score: 0

http://stackoverflow.com/comment/44235896
comment on: http://stackoverflow.com/q/27918043
has text: Ok.. I am looking it..
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27833229
upvote count: 1
has comment: http://stackoverflow.com/comment/44072032
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44072119
score: 1
has answer: http://stackoverflow.com/a/27833302
has answer: http://stackoverflow.com/a/27833273
has title: Method, function, this in javascript
has comment: http://stackoverflow.com/comment/44072132
has comment: http://stackoverflow.com/comment/44072196
type: Question
has answer: http://stackoverflow.com/a/27833271
possible better answer: http://stackoverflow.com/a/27833273
downvote count: 0
tagged with: javascript
has body: I have the following javascript code. &lt;script&gt; var myobj = { fname : "abc", lname: "xyz", getvalue : function(v) { alert(typeof this.getvalue); alert( this.fname + " " + this.lname + " " + this.v ); } }; myobj.getvalue(3); &lt;/script&gt; As per my understanding, getvalue in the above code is method not function then how come typeof this.getvalue return function. Why is the second alert in the above code shows undefined when point v as this.v ?
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44072497
accepted answer: http://stackoverflow.com/a/27833271
has comment: http://stackoverflow.com/comment/44072074
has comment: http://stackoverflow.com/comment/44072084

http://stackoverflow.com/q/27877962
tagged with: css
score: 0
answer count: 2
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27879241
has comment: http://stackoverflow.com/comment/44157586
has comment: http://stackoverflow.com/comment/44157809
has comment: http://stackoverflow.com/comment/44157643
type: UnansweredQuestion
has body: Having trouble changing the class for a li using javascript. html Contact us css #mainmenu { list-style: none; margin-left: 35px; display: block; } #mainmenu li { float: left; padding: 3px 3px 3px 3px; position: relative; margin-right: 15px; margin-top: 1px; border: none; cursor: default; z-index: 999; display: hidden; } This is the class I want to change: #mainmenu li:hover { border: 1px solid #aaa; background: #fffff; border-radius: 2px 2px 0px 0px; padding: 2px 2px 2px 2px; display: hidden; } rest of css #mainmenu li a { font-family: Verdana, Arial; font-size: 12px; color: #444444; text-decoration: none; display: block; } #mainmenu li:hover a { color: #333333; } #mainmenu li .drop { padding: 1px 20px 2px 4px; background: url("../images/arrow2.gif") no-repeat right 4px ; } #mainmenu li:hover .drop { background: url("../images/arrow.gif") no-repeat right 4px; } js (wanting to use) $(#mainmenu li:hover).click(function(){ $(this).removeClass('menuhoverswap'); $(this).addClass('menuhoverswap'); }); id to swap #menuhoverswap { border: 1px solid #aaa; } Normally would be ok doing it but cant get my head around it as I have done the css for the menu in a different markup, referring css to mainmenu then li rather then giving the li a class of its own.
has title: changing li class on click
has comment: http://stackoverflow.com/comment/44158025
tagged with: javascript
has comment: http://stackoverflow.com/comment/44157705
tagged with: jquery
has comment: http://stackoverflow.com/comment/44157478
has answer: http://stackoverflow.com/a/27878303
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44159861

http://stackoverflow.com/a/27916168
type: Answer
answers question: http://stackoverflow.com/q/27916074
has comment: http://stackoverflow.com/comment/44230983
has body: First of all, check post url is correct or not using test echo in function or a contructor Try like this way, var request = $http({ method: "post", url: "http://localhost:90/vendor/dashboard/accountinfosave/", data: { uname : 'vikrant', pswd : '111', email : 'bhallavikrantvir@gmail.com' } }); request.success( function( data ) { $scope.data = data; alert('success'); } );
score: 0

http://stackoverflow.com/q/27855637
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27856172
has comment: http://stackoverflow.com/comment/44115099
has comment: http://stackoverflow.com/comment/44115113
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/44115289
has comment: http://stackoverflow.com/comment/44115304
has comment: http://stackoverflow.com/comment/44114976
has body: I am a newbie on javascript and was implementing a loader in the project.. I have used the below code for the implementation of loader but it is not working:- var url = "http://localhost:3500/#!/Movies"; &lt;script&gt; $(function(){ //Loader implementation if (location.href==url){ $(window).ready(function(){ $('#loadIndicator1').fadeOut(1000); return false; }); } }); &lt;/script&gt; I am calling the loadindicator in the code as:- &lt;ul&gt; &lt;li id="loadIndicator1" style="position:absolute ;top:50%;left:50%;z-index:99999;"&gt;&lt;/li&gt; &lt;/ul&gt; I am not very sure why this is giving an issue.I am using jquery-1.8.3.min.js and jqueryui-1.10.2.js Also when I hover on location..I get unresolved variable location.Please help me with this.
has answer: http://stackoverflow.com/a/27856106
type: Question
has title: Rails:-location.Href not working in project
has answer: http://stackoverflow.com/a/27855671
has comment: http://stackoverflow.com/comment/44115259
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44114980

http://stackoverflow.com/q/27844729
type: Question
tagged with: asp.net-mvc
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27844790
score: 0
has body: Here is my Javascript code that goes to the url with the correct id from model but I am not sure how to hide it if the url has no model id. function lnkBack_Confirm() { var bResponse = confirm('Are you sure you want to go back to the Details Page?'); if (bResponse === true) { ////console.log("lnkBack_Confirm clciked."); var url = '@Url.Action("NewHireDetails", "Home", new { id = Model.ID })'; window.location.href = url; } return bResponse; } All I would like to do is hide it if the url has no id = Model.ID. I am not sure how to do this. Can someone please help. Thanks in advance.
answer count: 1
has title: MVC ASP.Net Javascript - How do I use a javascript function to hide a button if Url has no id
has answer: http://stackoverflow.com/a/27844790
has comment: http://stackoverflow.com/comment/44093326
tagged with: asp.net-mvc-4
type: AnsweredQuestion

http://stackoverflow.com/comment/44063358
comment on: http://stackoverflow.com/q/27828688
score: 0
type: Comment
type: QuestionComment
has text: these are all bad things.

http://stackoverflow.com/comment/44111381
score: 0
type: Comment
has text: Yes, even if you type in lowercase "yes", you need to use toLowerCase() method, I don't know why, there might be something bug in js...
type: AnswerComment
comment on: http://stackoverflow.com/a/27840597

http://stackoverflow.com/a/27915584
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: row is a jQuery object, not a string, and as such you end up with [Object, object] when you try to concantenate the object into a string. You could use the context selector instead var row = $('.draw-selection-wrapper.selections div:nth-child(' + line_counter + ')'); var link = $('a:nth-child(' + number_counter + ')', row); FIDDLE
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27915517
accepted answer of: http://stackoverflow.com/q/27915517

http://stackoverflow.com/q/27929258
has answer: http://stackoverflow.com/a/27929485
has title: JSON.parse variable
has comment: http://stackoverflow.com/comment/44255713
has body: I'm using JSON parsing for the below data (using JavaScript in XML). &lt;script&gt; vURI = 'rc_p\\49'; vData = '{ "params" : {"20":"1000","21":"5299","58":57}, "udata" : {"aaa":"bbb"}}'; vMessage = JSON.parse(vData) &lt;/script&gt; In the vData, is it possible to use variable vThisDN instead of value "1000"? &lt;session:fetch method="'lib'" srcexpr="vURI"&gt; &lt;content expr= "vMessage"/&gt;
favorite count: 0
score: -1
has answer: http://stackoverflow.com/a/27929426
type: Question
answer count: 2
downvote count: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44255578
upvote count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/44295563
has text: Try with some other filter for instance, `numberFilter` and see if it gets injected fine
comment on: http://stackoverflow.com/q/27950052
score: 0
type: Comment
type: QuestionComment

google-chrome
tags question: http://stackoverflow.com/q/27846313
tags question: http://stackoverflow.com/q/27914693
tags question: http://stackoverflow.com/q/27848063
tags question: http://stackoverflow.com/q/27903924
tags question: http://stackoverflow.com/q/27930420
tags question: http://stackoverflow.com/q/27840316
tags question: http://stackoverflow.com/q/27919233
tags question: http://stackoverflow.com/q/27857605
tags question: http://stackoverflow.com/q/27857506
tags question: http://stackoverflow.com/q/27929547
tags question: http://stackoverflow.com/q/27892282
tags question: http://stackoverflow.com/q/27908309
tags question: http://stackoverflow.com/q/27876220
tags question: http://stackoverflow.com/q/27926924
tags question: http://stackoverflow.com/q/27823740
tags question: http://stackoverflow.com/q/27869063
tags question: http://stackoverflow.com/q/27899740
tags question: http://stackoverflow.com/q/27904582
tags question: http://stackoverflow.com/q/27947395
tags question: http://stackoverflow.com/q/27831016
tags question: http://stackoverflow.com/q/27806402
tags question: http://stackoverflow.com/q/27906965
tags question: http://stackoverflow.com/q/27844214
tags question: http://stackoverflow.com/q/27930016
tags question: http://stackoverflow.com/q/27809688
tags question: http://stackoverflow.com/q/27945484
tags question: http://stackoverflow.com/q/27906485
tags question: http://stackoverflow.com/q/27826998
tags question: http://stackoverflow.com/q/27870101
tags question: http://stackoverflow.com/q/27912213
tags question: http://stackoverflow.com/q/27815363
tags question: http://stackoverflow.com/q/27869491
tags question: http://stackoverflow.com/q/27925872
tags question: http://stackoverflow.com/q/27830861
tags question: http://stackoverflow.com/q/27941739
tags question: http://stackoverflow.com/q/27950300
tags question: http://stackoverflow.com/q/27843189
tags question: http://stackoverflow.com/q/27945501
tags question: http://stackoverflow.com/q/27939805
type: Tag
tags question: http://stackoverflow.com/q/27916632
tags question: http://stackoverflow.com/q/27804315
tags question: http://stackoverflow.com/q/27894215
tags question: http://stackoverflow.com/q/27941075
tags question: http://stackoverflow.com/q/27913065
tag name: google-chrome
tags question: http://stackoverflow.com/q/27831795
tags question: http://stackoverflow.com/q/27957118
tags question: http://stackoverflow.com/q/27895656
tags question: http://stackoverflow.com/q/27821980
tags question: http://stackoverflow.com/q/27957726
tags question: http://stackoverflow.com/q/27893898
tags question: http://stackoverflow.com/q/27852932
tags question: http://stackoverflow.com/q/27927924
tags question: http://stackoverflow.com/q/27930424
tags question: http://stackoverflow.com/q/27855110
tags question: http://stackoverflow.com/q/27925077
tags question: http://stackoverflow.com/q/27959590
tags question: http://stackoverflow.com/q/27950889
tags question: http://stackoverflow.com/q/27888522
tags question: http://stackoverflow.com/q/27961977
tags question: http://stackoverflow.com/q/27812907
tags question: http://stackoverflow.com/q/27954633
tags question: http://stackoverflow.com/q/27867088
tags question: http://stackoverflow.com/q/27872908
tags question: http://stackoverflow.com/q/27893300
tags question: http://stackoverflow.com/q/27823480
tags question: http://stackoverflow.com/q/27963279
tags question: http://stackoverflow.com/q/27854021
tags question: http://stackoverflow.com/q/27863009
tags question: http://stackoverflow.com/q/27828804
tags question: http://stackoverflow.com/q/27869360
tags question: http://stackoverflow.com/q/27921894
tags question: http://stackoverflow.com/q/27931094
tags question: http://stackoverflow.com/q/27899989
tags question: http://stackoverflow.com/q/27850092
tags question: http://stackoverflow.com/q/27963829
tags question: http://stackoverflow.com/q/27954806

http://stackoverflow.com/q/27846263
type: Question
answer count: 1
tagged with: javascript
has title: How to keep scrolling div at the bottom of the page
tagged with: jquery
has comment: http://stackoverflow.com/comment/44096429
score: 0
has comment: http://stackoverflow.com/comment/44096440
has comment: http://stackoverflow.com/comment/44096785
type: UnansweredQuestion
has body: I have this js that works great until I get to the bottom of the div, it then is relative and jumps back up to the top. I would like it to stay at the 2000px location instead of jumping back to the top as I continue to scroll down (we have a very large footer). Any ideas? I have looked through a lot of these, and I have been unable to get any codes to work that indicate they could do what I am trying to do. $(window).scroll(function () { if ($(window).scrollTop() &gt;= 2000) { $('#scrollingDiv').css({ position: 'relative' }); } else { $('#scrollingDiv').css({ position: 'fixed' }); $("#scrollingDiv").css("top", Math.max(0, 170 - $(this).scrollTop())); } }); Fiddle Here is the general idea of it. The main difference is that our footer is very large (i was not able to add the footer without major editing) so I need it to stop at a point that is at the end of the image but also stay at the bottom of the image as I continue to scroll down to view the footer.
has comment: http://stackoverflow.com/comment/44096882
has answer: http://stackoverflow.com/a/27847065

http://stackoverflow.com/comment/44202327
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27901443
has text: You cannot remove `__proto__`, an internal property.
score: 0

http://stackoverflow.com/q/27856915
score: 0
downvote count: 2
answer count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/27856973
accepted answer: http://stackoverflow.com/a/27856973
has body: If an array is created using a literal in a top-level script, JavaScript interprets the array each time it evaluates the expression containing the array literal. Source: MDN, "Values, variables, and literals" I can't understand it well. Someone can give me a example detailly.
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44117058
has title: javascript evaluate the expression containing the array literal each time
type: Question
tagged with: evaluate
tagged with: expression
tagged with: javascript
upvote count: 2

http://stackoverflow.com/comment/44207482
type: Comment
comment on: http://stackoverflow.com/q/27899984
score: 1
has text: @ZikO Take off HttpGet attribute from your action. And try to add HttpPost if you need.
type: QuestionComment

http://stackoverflow.com/q/27896407
score: 1
has body: Hi i am currently working on a firefox Addon-sdk and i would like to know if there is a way to import JS files which uses DOM objects(like window) into the main.js code. I did use "mozIJSSubScriptLoader" but the addon keeps returning all the dom objects defined in the loaded scripts as "NOT DEFINED" and i think this should be because the main.js code does not have access to the DOM. Please, let me know if there is any other way to import/load these js files. Thanks in advance.
tagged with: dom
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44260199
downvote count: 0
has comment: http://stackoverflow.com/comment/44234384
tagged with: javascript
tagged with: firefox-addon
tagged with: firefox-addon-sdk
favorite count: 0
has title: Import JS files which uses DOM objects in a firefox Addon-sdk addon script
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28019186
has comment: http://stackoverflow.com/comment/44423214
upvote count: 1
has comment: http://stackoverflow.com/comment/44209033
has answer: http://stackoverflow.com/a/27904475

http://stackoverflow.com/q/27912345
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/27912356
has comment: http://stackoverflow.com/comment/44224186
has body: Is there any other more convenient way of preventing variable from going negative than a if statement? Example code var scrollTop = window.pageYOffset, sW = (44 - .06*scrollTop); if( sW &lt; 0 ){ sW = 0; }
favorite count: 0
has comment: http://stackoverflow.com/comment/44224171
possible better answer: http://stackoverflow.com/a/27912383
has comment: http://stackoverflow.com/comment/44224245
upvote count: 2
has answer: http://stackoverflow.com/a/27912383
tagged with: negative-number
type: AnsweredQuestion
has title: Is there a way to prevent a number from being negative in JavaScript?
accepted answer: http://stackoverflow.com/a/27912356
score: 1
has comment: http://stackoverflow.com/comment/44224178
downvote count: 1
type: Question

http://stackoverflow.com/q/27960974
has title: convert 3d coordinates to 2d screen coordinates (plane mesh)
has body: Hello I have a plane in three.js with width 5000 and height 5000. With the following code I convert 3d coordinates into 2d, more specific I get the top left point of the plane and the bottom right. I initialize my camera with position x: 0, y: 0, z: 70000 and rotation x:0,y:0,z:0. The coordinates I get if I don't rotate my camera (using orbit controls) are correct: however if I rotate my camera the coordinates are not correct and I cant figure out why. Here is my code so far: var vec3 = new THREE.Vector3(); vec3.set( _that.model.position.x - 2500, _that.model.position.y + 2500, _that.model.position.z ); // top left corner vec3.project( _that.vise.camera ); var percX = Math.abs(vec3.x + 1) / 2; var percY = Math.abs(-vec3.y + 1) / 2; this.topLeft = { x : percX * _that.vise.options.generic.container.clientWidth, y : percY * _that.vise.options.generic.container.clientHeight } var vec4 = new THREE.Vector3(); vec4.set( _that.model.position.x + 2500, _that.model.position.y - 2500, _that.model.position.z ); // top left corner vec4.project( _that.vise.camera ); var percX = Math.abs(vec4.x + 1) / 2; var percY = Math.abs(-vec4.y + 1) / 2; this.bottomRight = { x : percX * _that.vise.options.generic.container.clientWidth, y : percY * _that.vise.options.generic.container.clientHeight } this.projectedVector = { x : Math.abs(this.topLeft.x - this.bottomRight.x), y : Math.abs(this.topLeft.y - this.bottomRight.y) }
type: UnansweredQuestion
tagged with: three.js
upvote count: 1
score: 1
type: Question
tagged with: 3d
tagged with: javascript
has answer: http://stackoverflow.com/a/27975947
downvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/a/27910206
type: Answer
has body: From the example jQuery ToDo app that's provided (this code snippet is from app.js): function checkSession() { $("#loading").show(); // check for existing session, relevant when code is hosted on the dsp window.df.apis.user.getSession({"body":{}}, function (response) { $("#loading").hide(); // existing session found, assign session token // to be used for the session duration var session = new ApiKeyAuthorization("X-Dreamfactory-Session-Token", response.session_id, 'header'); window.authorizations.add("X-DreamFactory-Session-Token", session); runApp(); }, function (response) { $("#loading").hide(); // no valid session, try to log in doLogInDialog(); }); }
score: 0
answers question: http://stackoverflow.com/q/27888088

http://stackoverflow.com/a/27839492
answers question: http://stackoverflow.com/q/27839096
type: Answer
score: 0
has body: function checkConsonants(letterToCheck) { var consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']; var isConsonant = false; for (i = 0; i &lt; consonants.length; i++) { if (letterToCheck == consonants[i]) { isConsonant = true; } } return isConsonant; } function translate(funString, letterO) { console.log('The original string is: "' + funString + '"'); console.log('The separator is: "' + letterO + '"'); var newString = ''; for (var i = 0; i &lt; funString.length; i++) { if (checkConsonants(funString[i])) { newString += funString[i] + letterO + funString[i]; } else { newString += funString[i]; } } console.log('The "rövarspråket" result is: ' + '"' + newString + '"'); } translate('this is fun', 'o'); Take a look of this. JS Fiddle Example

http://stackoverflow.com/comment/44108885
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27852433
has text: When you say 'duplicate', do you mean the arrays are the same object, or that the arrays have the same length and order of items, or have the same length but not order of items?
score: 0

http://stackoverflow.com/a/27878303
type: Answer
has comment: http://stackoverflow.com/comment/44158243
has comment: http://stackoverflow.com/comment/44208282
has comment: http://stackoverflow.com/comment/44158519
score: 0
has body: UPDATED Do you want to add the class on hover only? $('.drop').hover( function() { $(this).addClass('selected'); }, function() { $('.drop').removeClass('selected'); }); Here the full working example with your code.
answers question: http://stackoverflow.com/q/27877962

http://stackoverflow.com/comment/44075363
type: QuestionComment
has text: What kind of problem? Any error occurred? Which jQuery version?
type: Comment
score: 4
comment on: http://stackoverflow.com/q/27835266

http://stackoverflow.com/comment/44101987
type: Comment
comment on: http://stackoverflow.com/a/27847439
has text: Very cool, and lots to digest, but the problem is slightly more complicated the petals are smaller circles that point to the centre. So, rather than drawing a flower, I called it that because the mini arcs are like sunflowers that always look at the sun (middle point) while it moves across the sky.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44086182
comment on: http://stackoverflow.com/a/27835965
has text: @Qinten it is not a rectangle. It is the background of your page. What else would you like to see instead? That's going to happen in any site. Your image is very big and takes time to load, meanwhile, whatever is under your image will be shown. Nothing to do with fullPage.js.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44095539
type: Comment
has text: see simplified example
comment on: http://stackoverflow.com/a/27845789
score: 0
type: AnswerComment

http://stackoverflow.com/a/27912670
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44232982
type: Answer
accepted answer of: http://stackoverflow.com/q/27912568
upvote count: 3
has comment: http://stackoverflow.com/comment/44233040
answers question: http://stackoverflow.com/q/27912568
score: 3
has body: Answering your title question: No, recursion does not improve performance. It's likely it always makes implementation slower (compared to the identical loop based counterpart) About complexity: Your recursion solution is likely to be O(n^2) since arr.shift() operation is likely to be linear. As of V8 implementation: array.shift operation is linear. See https://github.com/v8/v8/blob/master/src/array.js#L596 and https://github.com/v8/v8/blob/master/src/array.js#L313 Alternative implementation: function isPalindromeZ(s) { for (var i = 0, len = s.length; i &lt; len / 2; ++i) { if (s[i] != s[len - i - 1]) { return false; } } return true; } What is good about this implementation compared to yours is that it is O(1) by additional memory consumption.

http://stackoverflow.com/comment/44198528
score: 0
comment on: http://stackoverflow.com/a/27899130
has text: I suggest you go with jQuery for convenience sake but if you want to really learn how to work with `getElementsByTagName`, here's how you could do it. `getElementsByTagName` returns an array so then you can loop over the array to set an `eventListener` to each element, and you are good to go.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44145211
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27870485
has text: I've added in the code you've written and when I load the page the video loads in and on click the video disappears and nothing else is placed in. I've checked for any errors in the console and don't receive any either. Also, how would I make it so that the page will randomize onload as well?

http://stackoverflow.com/comment/44352383
has text: @Bergi i agree that the wording could be better. bear with me.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27960828

http://stackoverflow.com/q/27848431
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44101270
answer count: 0
has comment: http://stackoverflow.com/comment/44100756
type: Question
tagged with: xmlhttprequest
has title: Form onsubmit return fails after xmlhttp.open
has body: My form adds a line to a database. What I am trying to do is to check if my data is already in it, and make me confirm if the new data shall be added. Form: &lt;form method="POST" onsubmit="return check();"&gt; &lt;input type="text" name="lok" placeholder="lokalitet" value=""&gt; &lt;input type="text" id="cr" name="cr" value="" autocomplete="off"&gt; &lt;input type="submit" value="Add"&gt; &lt;/form&gt; And the js: function check() { 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){ var response = xmlhttp.responseText; if(response!="") { if(!(confirm('Already added:\n' + response + '\n\nAdd anyway?'))) { return false; } } } } var cr = document.getElementById('cr').value; xmlhttp.open("GET","check.php?q=" + cr); xmlhttp.send(); } If I keep my confirm prompt alone, the return false works as it should and stops the submit. Nested in the xmlhttp.open on the other hand, it submits whatever I answer. Any good or bad ideas are appreciated!
tagged with: form-submit
tagged with: return-value
score: 0
has comment: http://stackoverflow.com/comment/44100626
has comment: http://stackoverflow.com/comment/44100745

http://stackoverflow.com/comment/44232946
comment on: http://stackoverflow.com/a/27917248
type: Comment
score: 0
type: AnswerComment
has text: include jquery library as well

http://stackoverflow.com/comment/44240283
type: QuestionComment
has text: More details would be great like which classes is it adding and what you don't want to show etc etc
score: 0
comment on: http://stackoverflow.com/q/27921531
type: Comment

http://stackoverflow.com/comment/44064918
comment on: http://stackoverflow.com/q/27829147
type: Comment
type: QuestionComment
has text: no shit. i am saying often people leave out the "/" or "./" which then points to the wrong level of directory.
score: 0

postback
tag name: postback
tags question: http://stackoverflow.com/q/27833564
type: Tag

http://stackoverflow.com/comment/44275725
score: 0
type: AnswerComment
type: Comment
has text: i already have content type see my above code,image is generated when i access the getphoto.php on browser but via ajax garbled text show
comment on: http://stackoverflow.com/a/27939730

http://stackoverflow.com/a/27917034
accepted answer of: http://stackoverflow.com/q/27916656
type: Answer
answers question: http://stackoverflow.com/q/27916656
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44233003
has body: When you passed params in the function did you check that it contains params.triggerElement and params.dateField, because if this line var triggerElement = $(params.triggerElement || params.dateField) assigns null to triggerElement then you will get the error that you are getting. After this line var triggerElement = $(params.triggerElement || params.dateField) you can put a null check and create the element if not created before binding a click event.
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/27858229
has comment: http://stackoverflow.com/comment/44119470
accepted answer: http://stackoverflow.com/a/27858959
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27858959
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap
has title: jQuery UI Sortable can't drag children back into parent
has body: Fiddle I'm having some trouble getting Sortable to work with these Bootstrap panels. I can drag child panels out of other ones, but not back in. Here is the HTML: title 1 title 2 title 3 title 4 And the Javascript: $(".panel-body, .header-extend-config").sortable({ connectWith: ".panel-default, .header-extend-config" }).disableSelection(); Even this very basic version fiddle doesn't work, so it can't be Bootstrap causing this issue. How can I get this to work correctly? (Preferably without some terrible hack)
type: Question
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/44119854
tagged with: javascript

http://stackoverflow.com/a/27894908
score: 5
answers question: http://stackoverflow.com/q/27894448
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 5
has comment: http://stackoverflow.com/comment/44191451
has body: @meagar summed this up pretty well in the comments Any pending AJAX requests will be aborted when the browser navigates away from the page. So depending on how you define "killing" an AJAX request, that means the request may be started, but it also might not have finished. If it's a short request, most likely it won't be aborted by the time it finishes. But if it's a long request (lots of data processing, takes a second or two to complete), then most likely it's going to be aborted somewhere in the middle. Of course, this all depends on the browser. The issue typically is that the request makes it to the server, but the browser aborts the request before the response comes through. This all depends on the server and how it processes the data. Some servers will interrupt the execution of your view, where the requests data is being processed and the response is being generated. Many servers will just let the code run and trigger an error when you try to write output to the response. This is because there is nobody on the other end, so you're writing the response to a closed connection. although if the user clicks an external link, the unload is really the only solution I can think of to save that data From my own experience, most browsers will allow you to send out a request during the beforeunload event. This is not always true for unload though, as by that time the page change cannot typically be stopped. One way to get around this, especially when the response matters, is to halt the page change after the user clicks the link. This can be as simple as calling evt.preventDefault() on the click event for the link, and then later redirecting the user to where they wanted to go when the request is finished. You should make sure to indicate to the user that their request has not just been ignored, but that they're waiting on something to finish first. Users don't want to be left in the dark, so make sure to give them some feedback (like changing the button text, disablin…
accepted answer of: http://stackoverflow.com/q/27894448

http://stackoverflow.com/a/27836015
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27835996
has body: This will work for ALL buttons on the page. It will get the button that is clicked, and will return the ID attribute value of the button. So you can have 5 buttons with all different ID's, and when one of them is clicked it will return the ID of the clicked button. $('button').click(function(){ alert($(this).attr('id')); }); WORKING FIDDLE
has comment: http://stackoverflow.com/comment/44077183
has comment: http://stackoverflow.com/comment/44077477

http://stackoverflow.com/comment/44216890
comment on: http://stackoverflow.com/q/27908666
type: Comment
type: QuestionComment
has text: Do you mind help me started - please ?
score: 0

http://stackoverflow.com/comment/44041297
type: AnswerComment
score: 0
type: Comment
has text: Thanks, now this kind of works, although $scope.data=$scope.$eval($attrs.data); isn't the best-looking code ;)
comment on: http://stackoverflow.com/a/27817438

http://stackoverflow.com/comment/44176974
type: Comment
score: 0
has text: On a another topic,Could you tell me how to align the text on the error message label so that its in the center
type: AnswerComment
comment on: http://stackoverflow.com/a/27887927

http://stackoverflow.com/a/47277140
upvote count: 2
has comment: http://stackoverflow.com/comment/112791101
has comment: http://stackoverflow.com/comment/96415257
has body: A solution in React for a JavaScript SPA with Laravel The accepted answer is the best explanation of why such problems happen. As already explained, you have to configure both the client side and server side. In your blade template, include the JavaScript bundled file, make sure to use URL facade like this: &lt;script src=&quot;{{ URL::to('js/user/spa.js') }}&quot;&gt;&lt;/script&gt; In your routes, make sure to add this to the main endpoint where the blade template is. For example, Route::get('/setting-alerts', function () { return view('user.set-alerts'); }); The above is the main endpoint for the blade template. Now add an optional route too, Route::get('/setting-alerts/{spa?}', function () { return view('user.set-alerts'); }); The problem that happens is that first the blade template is loaded, then the React router. So, when you're loading '/setting-alerts', it loads the HTML content and the JavaScript code. But when you load '/setting-alerts/about', it first loads on the server side. Since it is on the server side, there isn't anything on this location, and it returns not found. When you have that optional router, it loads that same page and React Router is also loaded, then the React loader decides which component to show.
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27928372

http://stackoverflow.com/q/27883792
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27883838
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27883829
answer count: 4
score: 1
upvote count: 1
has body: Sorry if the question is fool .. I have no jquery experience and I need Help with something that may be easy I have a JQuery script that uses a selector to hide content (Social Locker) for example $(".post_message_1").sociallocker({ my problem is that when I apply this code to a div with subelement .. It don't work for example &lt;div id="post_message_1"&gt; &lt;blockquote class="postcontent restore "&gt; Content Here &lt;/blockquote&gt; &lt;/div&gt; If I use selector $(".postcontent").sociallocker({ it works fine and content is hidden but when I use $(".post_message_1").sociallocker({ it doesn't work The problem here I want to hide the content for post_message_1 not postcontent as postcontent is not specific and used in all text &lt;divs&gt;s I hope this is clear
has answer: http://stackoverflow.com/a/27883831
has answer: http://stackoverflow.com/a/27883834
type: Question
has comment: http://stackoverflow.com/comment/44169378
tagged with: jquery-ui
tagged with: javascript
has title: JQuery SubDiv Selector

http://stackoverflow.com/a/27880799
answers question: http://stackoverflow.com/q/27880787
type: Answer
score: 3
upvote count: 3
downvote count: 0
has body: forEach is Array method not global function var numbers = [1, 2, 3, 4, 5], sum = 0; numbers.forEach(function(number) { sum += number; }); console.log(sum); Update: in your case, you forgot copy function declaration for forEach.

http://stackoverflow.com/comment/44265273
has text: @Phylogenesis I didn't think of that. It worked. I changed `data[i]` to just `i` as well. I still have no idea what was not working before. You can post this as an answer if you want and I can mark it correct.
type: QuestionComment
comment on: http://stackoverflow.com/q/27933692
score: 0
type: Comment

http://stackoverflow.com/q/27924356
has answer: http://stackoverflow.com/a/27924415
has body: I am storing an array of objects in localStorage, retriving it each time, attachibg the new object and again storing. the code works fine, only if there is already an entry in localStorage Following is the code: var companies=[]; companies=JSON.parse(localStorage.getItem("companies")); //IMP line companies.push(company); localStorage.setItem("companies", JSON.stringify(companies)); This works fine, when I comment the 'IMP line' for first time, so that a record is inserted with single record. once the local storage contains a record with key "companies" everything goes fine. please suggest a condition that can be checked while inserting the array first time. Thank You.
tagged with: http://stackoverflow.com/tag/json
has title: Assigning JSON array retrived from local storage to JavaScript array
has answer: http://stackoverflow.com/a/27924434
type: Question
answer count: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: local-storage
score: 2

http://stackoverflow.com/a/27806612
answers question: http://stackoverflow.com/q/27804650
type: Answer
has body: I don't know if that is the only answer.. according to NodeJS Sequelize and FindAll with Include and constraints and node.js sequelize associations, include on condition this seems impossible without going to direct sql - though this kind of seems to defy the purpose of sequelize. var qstring = "SELECT * FROM mydb.person p \ join mydb.personrole pr on p.id = pr.person_id \ join mydb.work w on w.id = pr.work_id \ join mydb.bookwork bw on bw.work_id = w.id \ join mydb.book b on b.id = bw.book_id;"; sequelize.query(qstring).success(function (result) { console.log(result.count); result.forEach(function ProcessRatingResult(oneresult) { console.log(oneresult); }); }); This runs considerably faster as well.
score: 0

http://stackoverflow.com/q/27881536
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/27881594
answer count: 3
has title: How can I get the child node based on clickevent
has body: I have a have several divs on a page called parent_container inside it I have a heading, image and a button how can I get the value for the specific heading of the container it was clicked from? title 1 button1 title 2 button2 //getting the elements var update_buttons = document.getElementsByClassName( 'cta-btn' ), parentElement = document.getElementsByClassName( 'parent_container' ), itemTitle = document.getElementsByClassName( 'news_title' ); //trying to get the title from the div it was clicked in var getTitle = function( evt ) { var title = this.itemTitle; console.log( title ); //undefined } //setting up a event listener on all the buttons on the page for( var i=0;i<update_buttons.length;i++ ){ update_buttons[i].addEventListener('click', getTitle); }
has comment: http://stackoverflow.com/comment/44164789
possible better answer: http://stackoverflow.com/a/27881589
has answer: http://stackoverflow.com/a/27881589
has answer: http://stackoverflow.com/a/27881632
has answer: http://stackoverflow.com/a/27881594
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44164754
tagged with: javascript
tagged with: dom

http://stackoverflow.com/comment/44202614
score: 1
comment on: http://stackoverflow.com/q/27901567
type: Comment
type: QuestionComment
has text: You want `if (check.value ==`

http://stackoverflow.com/q/27871123
has comment: http://stackoverflow.com/comment/44144911
has comment: http://stackoverflow.com/comment/44146424
has comment: http://stackoverflow.com/comment/44145145
has comment: http://stackoverflow.com/comment/44146277
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44144786
upvote count: 1
has comment: http://stackoverflow.com/comment/44144810
has comment: http://stackoverflow.com/comment/44145480
has comment: http://stackoverflow.com/comment/44145406
has comment: http://stackoverflow.com/comment/44145485
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/44144684
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/27872075
has comment: http://stackoverflow.com/comment/44146374
type: Question
has body: I have this javascript function that I use in an MVC project. It's been working fine, no code has changed, other than some nuget packages have been updated since the last time I tested it (not sure which ones). Now suddenly I'm getting a parse error. The parameter being passed is simply 'indoor' or 'outdoor', and just to make sure that had nothing to do with the issue, I hard-coded it instead of passing it, both with and without the JSON.stringify to see if that mattered, which it didn't. Any ideas why this is suddenly breaking? function LoadHobbies(category) { var data = { type: category }; return $.ajax({ type: 'post', contentType: 'application/json; charset=utf-8', url: '/Hobby/LoadHobbies', dataType: 'json', data: JSON.stringify(data) }); } Remote Address:[::1]:9925 Request URL:http://localhost:9925/Hobby/LoadHobbies Request Method:POST Status Code:302 Found Request Headersview source Accept:application/json, text/javascript, */*; q=0.01 Accept-Encoding:gzip, deflate Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:17 Content-Type:application/json; charset=UTF-8 Host:localhost:9925 Origin:http://localhost:9925 Referer:http://localhost:9925/Account/Index User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 X-Requested-With:XMLHttpRequest Request Payloadview source {type: "indoor"} type: "indoor" Response Headersview source Cache-Control:private Content-Length:162 Content-Type:text/html; charset=utf-8 Date:Sat, 10 Jan 2015 01:28:13 GMT Location:/Login/Index?ReturnUrl=%2fHobby%2fLoadHobbies Server:Microsoft-IIS/8.0 X-AspNet-Version:4.0.30319 X-AspNetMvc-Version:5.2 X-Powered-By:ASP.NET X-SourceFiles:=?UTF-8?B?RDpcVXNlcnNcQW5kcmV3XERvY3VtZW50c1xjb2RlXEhvYmJ5TWF0cml4U29sdXRpb25NVkNcSG9iYnlNYXRyaXhXZWJcSG9iYnlcTG9hZEhvYmJpZXM=?=
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44146393
favorite count: 0
has title: JSON parse error on ajax call
has comment: http://stackoverflow.com/comment/44144914

http://stackoverflow.com/comment/44093868
type: AnswerComment
comment on: http://stackoverflow.com/a/27837753
type: Comment
has text: That was just a typo. It's 'paths' in the real code. Sorry.
score: 0

http://stackoverflow.com/comment/44050517
has text: My chrome extension uses `localStorage` without any issues inside a content script, there's no need to create script tags.
type: AnswerComment
comment on: http://stackoverflow.com/a/27822320
score: 0
type: Comment

http://stackoverflow.com/a/29110083
upvote count: 1
has body: What worked for me was to: Use svgCrowbar to serialize the SVG var uri = svgCrowbar(eGraph); Write the serialized SVG to a PNG dataURI using canvas // Create image object which will enable the graph to be saved (via canvas) var image = new Image(); image.onload = function () { // Create canvas var canvas = document.createElement('canvas'); canvas.width = image.width; canvas.height = image.height; var context = canvas.getContext('2d'); context.drawImage(image, 0, 0); // Save DataURI for later use window.sitescriptdata.dataURI[id] = canvas.toDataURL('image/png'); window.sitescriptdata.numDataURIsLoaded++; ... }; image.src = uri; Use jsPDF.addImage() to embed that PNG into the PDF Using this method I was able to embed multiple dynamically generated SVGs into a single PDF. I'm not 100% happy with the outcome as the images on the PDF look distorted, but it might be that I need to do more tweaking of the jsPDF settings to get everything to look crisp.
answers question: http://stackoverflow.com/q/27856670
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/46456599
score: 1

http://stackoverflow.com/q/27871019
has comment: http://stackoverflow.com/comment/44144750
tagged with: http-status-code-404
has answer: http://stackoverflow.com/a/27871212
score: 0
has comment: http://stackoverflow.com/comment/44145062
has body: I am beginning work on a web app that involves text-to-speech. Using a technique learned from youtube user Wes Bos, my code passes a random number through Google's english text-to-speech API (literally pasting it into the URL and returning the audio) each time a button is clicked. SujiQ Dev.0 generate random number Random number This code executes swimmingly without fail when run locally on my browser, but when hosting the exact same code on my godaddy provided site, the random number generator works but access to google's speech API almost always fails, returning a network console error along the lines of: "GET https://translate.google.com/translate_tts?ie=UTF-8&q=152&tl=en 404 (Not Found)". Interestingly, once in a very blue moon, it goes through and reads the number out loud. What gives? I've looked around but I'm stumped. Edit The code also fails to read the number out loud when run as a Stack Overflow snippet
answer count: 1
has comment: http://stackoverflow.com/comment/44144521
has comment: http://stackoverflow.com/comment/44144459
accepted answer: http://stackoverflow.com/a/27871212
has comment: http://stackoverflow.com/comment/44144471
has comment: http://stackoverflow.com/comment/44145392
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44144524
tagged with: javascript
has comment: http://stackoverflow.com/comment/44144780
tagged with: jquery
has comment: http://stackoverflow.com/comment/44144642
has title: JavaScript/jQuery reference to a third party website works locally, not when hosted on godaddy run site (404 error)
has comment: http://stackoverflow.com/comment/44144611
has comment: http://stackoverflow.com/comment/44144829
type: Question
tagged with: google-text-to-speech

http://stackoverflow.com/q/27825469
tagged with: node.js
type: AnsweredQuestion
has title: Node.js unexpected number conversion from parsing fs.readFile()
has comment: http://stackoverflow.com/comment/44061938
type: Question
linked to: http://stackoverflow.com/q/1458633
answer count: 1
tagged with: javascript
score: 0
has body: I'm getting unexpected float values when I read in my file. So I have a program that accumulates scores for elements in my object e.g. [{a:0.001}, {b:0.002},....]. The scores are incremented by 0.001. When I exit out, the array is written to a file with the following function: function(filename, result, msg) { var fs = require('fs'); var stream = fs.createWriteStream(filename); stream.once('open', function(fd) { stream.write(JSON.stringify(result)); stream.end(function() { console.log(msg); }); }); } and when I start the program, in another module, the object is read in as so: fs.readFile('scoreboard.json', 'utf8', function (err, data) { console.log(JSON.parse(data)); } When I initially run my script, it produces the expected results - scores that are multiples of 0.001. But when I save and reload the object, the scores turn up as: [{a:0.009000000000000001},{b:0.011000000000000003}] Is this occurring because of the way fs is reading and writing floats? To fix this should I explicitly convert the scores to floats after loading and convert them back into strings before writing?
has answer: http://stackoverflow.com/a/27828147
accepted answer: http://stackoverflow.com/a/27828147
has comment: http://stackoverflow.com/comment/44056815
tagged with: parsing

http://stackoverflow.com/q/27842255
tagged with: asp.net
has body: I have the following JS embedded in an aspx file. The purpose is to take the flight identification in the TextBoxAirportPkup box, call FlightAware, and write the destination airport in the TextBoxAirportName textbox. <asp:TextBox class="input1" ID="TextBoxAirportPkup" placeholder="Enter Flight Number" runat="server"></asp:TextBox> <asp:TextBox class="input1 " ID="TextBoxAirportName" placeholder="Airport" runat="server" /> I can step through the procedure using the JS debugger in Chrome DevTools. No error is thrown, but the textbox is not updated. I suspect a syntax error in the call to $('#TextBoxAirportName').html(flight.origin), but JS is not my strength. Can anyone identify the error?
has answer: http://stackoverflow.com/a/27842569
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27842569
possible better answer: http://stackoverflow.com/a/27842557
type: Question
has answer: http://stackoverflow.com/a/27842557
tagged with: javascript
has comment: http://stackoverflow.com/comment/44088712
score: 0
answer count: 2
has title: JS not updating Textbox

http://stackoverflow.com/q/27868690
has comment: http://stackoverflow.com/comment/44139822
score: 0
duplicate of: http://stackoverflow.com/q/122102
has comment: http://stackoverflow.com/comment/44140042
linked to: http://stackoverflow.com/q/122102
has comment: http://stackoverflow.com/comment/44140558
has answer: http://stackoverflow.com/a/27868711
accepted answer: http://stackoverflow.com/a/27868711
type: AnsweredQuestion
has body: I co ordinates stored as an object and have duplicated the data so i have a copy before the co ordinates change. But the problem is, when I change the co ordinates both copies change to the new version and I lose the original. So i create it like this: myObj = {}; myObj.position = {'x':12,'y':24}; myObj.startPos = myObj.position; So if i change myObj.position, I don't want myObj.startPos to change. What is the simplest way to prevent this from occurring?
type: Question
answer count: 1
tagged with: javascript
has title: Assigned object to another object and preserve original data?

http://stackoverflow.com/q/27917252
type: UnansweredQuestion
tagged with: three.js
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/45629070
type: Question
has comment: http://stackoverflow.com/comment/44350519
tagged with: javascript
tagged with: webgl
has comment: http://stackoverflow.com/comment/44247719
has title: Three.js throws error for scene object and float32array in IE9
has body: When trying to use CanvasRenderer to draw 3D object to make it compatible in IE9 I am getting error float32array error, scene error. My code is here - var renderer = new THREE.CanvasRenderer(); // Fallback to canvas renderer, if necessary. renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); var geometry = new THREE.CubeGeometry(20, 20, 20); var material = new THREE.MeshBasicMaterial({ color: 0x0000FF }); var cube = new THREE.Mesh(geometry, material); scene.add(cube); camera.position.z = 50; var render = function () { cube.rotation.x += 0.01; cube.rotation.y += 0.01; renderer.render(scene, camera); requestAnimationFrame(render); }; render(); // Start the rendering of the animation frames. Any suggestion?
has comment: http://stackoverflow.com/comment/45602385
has comment: http://stackoverflow.com/comment/44251455

http://stackoverflow.com/a/27911500
has comment: http://stackoverflow.com/comment/44292539
type: Answer
has body: Try this instead: $(this).parent().appendChild(mapDiv); Assuming you want the new element to appear at the end of the element containing the link, which is what your example shows, this should work Update: this is an example sentence with a link coming up (Here's the link content). More text may or may not follow here. To make my previous solution work you can simply wrap the link in a span so that the end of the parent of the anchor is where you would like to insert the new element Or, if you want to deal with looking at the html, here is a start to a solution that will find the character proceeding the anchor tag, but this solution requires that all of your anchors have a unique id and that the id is the last attribute, i.e. it should appear right before the closing tag: HTML: this is an example sentence with a link coming up (Here's the link content). More text may or may not follow here. Javascript: $("a.insertpoint").click(function() { var mapDiv = $(" "); var parent = $(this).parent(); var indexOfAnchorId = $(parent).html().indexOf($(this).attr("id")); var indexOfAnchorEnd = indexOfAnchorId + $(this).html().length + 7; alert($(parent).html()[indexOfAnchorEnd]); //mapDiv.insertAfter($(this)); }); fiddle: http://jsfiddle.net/y09cvu6q/
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27911408
has comment: http://stackoverflow.com/comment/44223116
has comment: http://stackoverflow.com/comment/44292318
accepted answer of: http://stackoverflow.com/q/27911408
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/63233331
has text: you could add a stateless component syntax (just lambda) there also, it's pretty short `<Route path="comments" component={() => (<Comments myProp="value" />)}/>`
type: AnswerComment
type: Comment
score: 30
comment on: http://stackoverflow.com/a/27868548

http://stackoverflow.com/comment/44110989
comment on: http://stackoverflow.com/a/27851285
score: 0
type: Comment
has text: For example, If I only store the the answers under the question, then in order for me to show the user a list of the question that he/she answered, I must run a full query on all the questions, and then check the array of answers and see if the user did indeed answer that question, which would be very inefficient. But again my dilemma is, it seems to me that storing the data in 2 places is redundant. I hope this is not too confusing.
type: AnswerComment

http://stackoverflow.com/q/27865392
duplicate of: http://stackoverflow.com/q/1606797
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44133550
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44133327
downvote count: 0
tagged with: javascript
has title: create new objects using arrays providing parameters
has comment: http://stackoverflow.com/comment/44133583
has body: I have no idea how to even look for an answer to this question. I've tried loads of variations of search to no avail. I bet it's the most simple thing too. I need to use an array to store parameters for a new object. var params = [0, 0, false]; var obj = new google.maps.LatLng(params); Obviously the above will fail as it doesn't accept an array, but separate parameters. This is just an example. I'd rather not have to step through the array, like params[0]. The reason is, I am wanting to set up an object factory, that may have variable parameter lists, so I would set some options, with a type, and array of params, and then when I call a create function it does var factory = new Factory({ type: 'LatLng', params: [0, 0, false] }); var latLng = factory.create();
has comment: http://stackoverflow.com/comment/44133556
score: 1
linked to: http://stackoverflow.com/q/1606797
favorite count: 0
has comment: http://stackoverflow.com/comment/44133457
answer count: 0

http://stackoverflow.com/q/27914076
tagged with: javascript
has comment: http://stackoverflow.com/comment/44227423
has comment: http://stackoverflow.com/comment/44227531
tagged with: iphone
tagged with: uislider
tagged with: jquery
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6360249
has comment: http://stackoverflow.com/comment/44227433
answer count: 0
score: 0
has title: jQuery UI Slider does not work well in iphone
has body: I have jquery ui slider it works good form laptop but if i test it form iphone or any touch screed device id doesn't work like normal iPhone app sliders , is there any way to make it work like iphone normal sliders ? i am Using this code right now : var resolution= ["800 x 600", "1024 x 768", "1280 x 960", "1280 x 1024", "1600 x 1200", "1280 x 720", "1280 x 800", "1440 x 900", "1680 x 1050", "1920 x 1080", "All"]; $(function() { $("#slider").slider({ min: 0, max: resolution.length-1, orientation:"vertical", values: [resolution.length-1], slide: function( event, ui ) { $( "#size" ).val( resolution[ui.values[ 0 ]] ); } }) $( "#size" ).val("All"); $('#slider').slider("float", { labels: resolution }); });
has comment: http://stackoverflow.com/comment/44227538
type: Question
tagged with: jquery-ui

http://stackoverflow.com/a/27894321
downvote count: 0
answers question: http://stackoverflow.com/q/27893934
has comment: http://stackoverflow.com/comment/44196821
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27893934
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44195741
has body: The problem stems from confusion over the use of the this pointer in Javascript. Change your Julia calculation in doesPointEscape() to complexNum = new addComplex(new multComplex(complexNum, complexNum), c); and it works. This will return a new complex number from multComplex, then add it to c and return a new complex number from addComplex that is assigned to complexNum. Your multComplex and addComplex functions use the this pointer, but for the this pointer to be referring to one of your complex numbers, you would have to be calling the function on an existing one, or calling new to create a new one. Alternatively, you could rewrite your multComplex() and addComplex() functions as function multComplex(c1, c2) { var real = (c1.real * c2.real) - (c1.imaginary * c2.imaginary); var imaginary = (c1.real * c2.imaginary) + (c2.real * c1.imaginary); return new ComplexNum(real, imaginary); } function addComplex(c1, c2) { var real = c1.real + c2.real; var imaginary = c1.imaginary + c2.imaginary; return new ComplexNum(real, imaginary); } then your doesPointEscape() function should work as-is.
score: 2

http://stackoverflow.com/q/27959672
has answer: http://stackoverflow.com/a/27960110
has answer: http://stackoverflow.com/a/27960014
answer count: 5
has title: change color on clicked linked span tag
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44313114
type: Question
has body: I have a span square with other span classes inside. The span square is linked, so everything inside that square, is also linked. I wonder if it is possible to change the background color of the span square if the square is clicked? Thanks for answers!
has answer: http://stackoverflow.com/a/27960034
tagged with: javascript
has comment: http://stackoverflow.com/comment/44313078
has answer: http://stackoverflow.com/a/27960040
score: 0
has answer: http://stackoverflow.com/a/27959787

http://stackoverflow.com/comment/44130765
score: 0
type: Comment
type: QuestionComment
has text: You should probably reset the original transitions, see also: http://bassjobsen.weblogs.fm/change-bootstraps-carousel-animantion/
comment on: http://stackoverflow.com/q/27861435

http://stackoverflow.com/a/27902796
type: Answer
answers question: http://stackoverflow.com/q/27902672
upvote count: 1
has body: Inline javascript in general should be avoided, you'd be better of with something like Link var link = document.getElementById('someButton'); link.addEventListener('click', function (e) { e.preventDefault(); printDoc(); }); I've put in a call to preventDefault() there but realistically if your using a tag for something that isn't a link you should consider a button or span
score: 1
has comment: http://stackoverflow.com/comment/44205658
downvote count: 0
has comment: http://stackoverflow.com/comment/44205913

http://stackoverflow.com/comment/44176900
comment on: http://stackoverflow.com/a/27880360
type: Comment
has text: the route and the view
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44185221
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27891898
has text: Thanks Brennan. Is this each method compatible with most browsers? And how about the data-attributes?
score: 0

http://stackoverflow.com/q/27879764
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/49555998
score: 0
answer count: 2
tagged with: angularjs
has title: Hide elemnt if clicked outside Angular
has body: i'm new to write custom directive . I'm trying to create something like backdrop(modal ui.bootstrap) in angular. this is the fiddle i'm working on : LINK . here's what i want : when user click on button (top left) menu get open and i want to close it after click outside the menu . Directive : app.directive("Trigger", function () { return { restrict: 'C', link: function (scope, element, attrs, event) { element.click(function(){ if (e.target.id != "parentUl" &amp;&amp; !$(e.target).closest("#rightMenu").length) { $("#rightMenu").removeClass("noneStyle"); } }); } }; }); i don't know exactly if restrict: 'C'is suitable for this case . Thanks for helping me .
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/49555998
has answer: http://stackoverflow.com/a/27884363
accepted answer: http://stackoverflow.com/a/27884363
type: Question

http://stackoverflow.com/comment/44306338
type: Comment
comment on: http://stackoverflow.com/q/27955699
type: QuestionComment
has text: [This is a really nifty jQuery plugin](http://ricostacruz.com/jquery.transit/) to do exactly what you are trying to accomplish. [Then check out how to implement setTimeout.](http://www.w3schools.com/jsref/met_win_settimeout.asp) I know you didn't tag this post with jQuery, but this would make things really easy for you.
score: 0

http://stackoverflow.com/q/27830964
linked to: http://stackoverflow.com/q/27826381
has comment: http://stackoverflow.com/comment/44095083
has comment: http://stackoverflow.com/comment/44095201
downvote count: 2
has comment: http://stackoverflow.com/comment/44067913
answer count: 1
accepted answer: http://stackoverflow.com/a/27844898
has title: How to not validate form on reset()?
tagged with: javascript
tagged with: jquery-validate
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/44067876
tagged with: jquery
has comment: http://stackoverflow.com/comment/44067842
favorite count: 0
has body: I'm using $('#myform')[0].reset(); to clear HTML form fields when a clear button is clicked. I'm also using jquery.validate.js. So when the above runs, it triggers form validation. All form fields with any validation then display their error messages. How do I prevent this? I have tried this but it didn't do anything: $('#myform').removeAttr("nonvalidate");
has answer: http://stackoverflow.com/a/27844898
type: Question
score: -2
has comment: http://stackoverflow.com/comment/44067950

http://stackoverflow.com/q/27925869
has comment: http://stackoverflow.com/comment/44249612
tagged with: http://stackoverflow.com/tag/html
has title: how to fetch and remove a script on the body before it loaded
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44248976
has comment: http://stackoverflow.com/comment/44249001
tagged with: brightcove
downvote count: 0
has answer: http://stackoverflow.com/a/27927920
score: 1
has comment: http://stackoverflow.com/comment/44248950
has comment: http://stackoverflow.com/comment/44248814
type: Question
has comment: http://stackoverflow.com/comment/44248967
upvote count: 1
answer count: 1
tagged with: javascript
has body: I have a Script in the Body and i want that my script in the Head will remove the script on the body before it loaded, can i do that?(with no jquery)
favorite count: 0

http://stackoverflow.com/a/27921658
upvote count: 1
type: AcceptedAnswer
has body: try this.. var alphaExp = /^[a-zA-Z]+ [a-zA-Z]+$/; var firstname =prompt("Please enter your first name And Last Name",""); if (firstname ==null || firstname =="") { alert("First and last name must be filled out!"); location.reload(true); } else if (!firstname.matches(alphaExp)) { alert("Name must contain letters only!") location.reload(true); } else{ // your code here. }
accepted answer of: http://stackoverflow.com/q/27921553
answers question: http://stackoverflow.com/q/27921553
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/27921922
favorite count: 0
has answer: http://stackoverflow.com/a/27922136
tagged with: http://stackoverflow.com/tag/html
answer count: 10
score: 8
type: AnsweredQuestion
has body: In a JSP page, I have a dropdown list. When the first element of the list is selected, I want a text area to show right on click. I'm new to Javascript/Jquery, so I'm obviously missing something in the function (the text area never shows up). Hope someone can help. This is the HTML: Show text area YES NO Text area This is the function, on top of the JSP:
downvote count: 0
has answer: http://stackoverflow.com/a/27922010
has answer: http://stackoverflow.com/a/27922050
possible better answer: http://stackoverflow.com/a/27921972
has answer: http://stackoverflow.com/a/27923277
upvote count: 8
type: Question
has answer: http://stackoverflow.com/a/27921972
has title: Show and hide html element on selected option change
has answer: http://stackoverflow.com/a/27922130
has answer: http://stackoverflow.com/a/28671643
accepted answer: http://stackoverflow.com/a/27922969
has answer: http://stackoverflow.com/a/27922648
tagged with: javascript
has comment: http://stackoverflow.com/comment/44240870
has answer: http://stackoverflow.com/a/27922969
tagged with: jsp
tagged with: jquery
has answer: http://stackoverflow.com/a/27922281

http://stackoverflow.com/comment/44269522
type: AnswerComment
has text: @AndyM focused on the curve and dots.
type: Comment
comment on: http://stackoverflow.com/a/27936213
score: 0

http://stackoverflow.com/q/27820636
has body: I'm developing a PNaCl project and a requirement is to run this on Internet Explorer 11. I have started with the Google Native Client tutorial, with the "Part1" example., and now I'm stuck. All indicate that the native Client Module has loaded successfully, but when I try to send a message to the PNaCl module, written in C++, I got the next error: Object doesn't support property or method 'postMessage' the line where I got the error is: HelloTutorialModule.postMessage("Hello"); I'm thankful for your help. :)
type: AnsweredQuestion
tagged with: internet-explorer
tagged with: google-nativeclient
type: Question
has answer: http://stackoverflow.com/a/27824054
accepted answer: http://stackoverflow.com/a/27824054
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44046940
has title: Google Native Client: Internet Explorer error
score: 0
tagged with: c++

http://stackoverflow.com/comment/44088266
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27840496
has text: Expert solution.This works really fine for me.Thanks @Sabastian.

http://stackoverflow.com/comment/44250892
comment on: http://stackoverflow.com/a/27926705
has text: @Amitay - exactly why you see the two getAge() functions. Me trying to understand why I couldn't get this to work with a click handler. I'm betting armed with the knowledge from this thread I'll be successful.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/86411623
comment on: http://stackoverflow.com/a/49450651
type: Comment
has text: Unfortunately, it would be quite difficult and time consuming to provide an accurate demo of my situation on codepen. I can describe it, though. Multi-line text box for markdown input. Div element to preview output. Div has CSS setting display:none when :empty. We use remarkable for text -> html and React 15.6.2. The case that triggers the problem is when you have one paragraph of text and you add a character that makes a second paragraph. It seems that when React renders the updated content in the div, it removes the one tag then adds the two new tags. I hope this helps.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/67731719
comment on: http://stackoverflow.com/q/27955121
has text: do u have `connection.sid` cookie on ur client side ?
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/44302690
type: AnswerComment
type: Comment
has text: They're all 1-character slices, so `.charAt(n)` would probably be the best.
comment on: http://stackoverflow.com/a/27953753
score: 0

http://stackoverflow.com/comment/44104024
has text: @ThomasPerez &#176; can be used without tag, nothing wrong with it
comment on: http://stackoverflow.com/a/27849868
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44071946
type: AnswerComment
comment on: http://stackoverflow.com/a/27833112
type: Comment
has text: @user3754674: I don't think you are finding the root div at all. What you are trying to reference is the root document/frame, rather than a ` ` (otherwise I've misunderstood your question and the code you posted makes no sense at all).
score: 0

http://stackoverflow.com/a/27890641
type: Answer
score: 1
upvote count: 1
has body: where cityList is list containing city model var result = from item in cityList select new { value = item.CityId, text = item.Name }; return Json(result, JsonRequestBehavior.AllowGet); and in script add $('#State').change(function () { $.getJSON('/Cascading/Citylist/' + $('#State').val(), function (data) { var items = []; items.push(" Select City "); $.each(data, function () { items.push(" " + this.text + " "); }); $(city).html(items.join(' ')); }); }); do same for state
downvote count: 0
answers question: http://stackoverflow.com/q/27885702

http://stackoverflow.com/comment/44071275
type: AnswerComment
type: Comment
has text: Before I go, I would just like to mention that your timeout fails to accomplish anything because as soon as the unhover is triggered, the submenu will disappear regardless of where the mouse is after 800ms.
comment on: http://stackoverflow.com/a/27827355
score: 0

http://stackoverflow.com/comment/44201196
comment on: http://stackoverflow.com/q/27900636
type: Comment
has text: Can you please elaborate?
score: 0
type: QuestionComment

http://stackoverflow.com/q/27943496
tagged with: asp.net-mvc
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/35510425
has title: MVC on bootstrap tab click reload controller and refresh
score: 2
downvote count: 0
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/37709273
type: Question
has answer: http://stackoverflow.com/a/27943911
has comment: http://stackoverflow.com/comment/71035292
tagged with: asp.net-mvc-4
upvote count: 2
answer count: 2
has body: Basically i implement a bootstrap tab like this in ASP.NET MVC I would like to call the controller on tab click to fetch the latest data from database and display the latest data. How could this be done? Assume my controller name is TabList(int? id) The code for triggering onclick is as follow but i am not sure of what code to be put inside $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { //code here }); Tab 1 Tab 2 Tab 3 { Html.RenderPartial("_Tab1", Model.Tab1); } { Html.RenderPartial("_Tab2", Model.Tab2); } { Html.RenderPartial("_Tab3", Model.Tab3); }

http://stackoverflow.com/comment/44165863
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27882019
score: 0
has text: Ah, I see, but assuming it did do something with it, the engine would create a single instance of the inner function with multiple environments, one for each closure? +1 for the link by the way.

http://stackoverflow.com/comment/44315936
comment on: http://stackoverflow.com/a/27961031
has text: I've tried Number() and parseInt() for theose var's in previous attemps to debug this prior to posting here, I hadn't tried parseFloat so just gave that one a go - I'm still getting an NaN error... It passes the % symbol back to the 's with the id value its at but not the numeric value... Thoughts?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27833401
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/27833420
has body: This is going to sound a bit vague, but i'll try and be as clear as possible. I have this section of jquery that animates a slide down box. $(function() { $('.toggler').hover(function() { $(this).find('div').slideToggle(); }); }); I'm just wondering if there is a way to stop when the user wiggles their mouse over and over the box, the box pops up and down then up and down for the amount of times the users mouse has crossed the box. I hope that's clear. HTML This is the title This is the content to be toggled This is the title This is the content to be toggled This is the title This is the content to be toggled This is the title This is the content to be toggled This is the title This is the content to be toggled
has comment: http://stackoverflow.com/comment/44072384
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/27833477
has title: Jquery sliding animation
has answer: http://stackoverflow.com/a/27833477
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27833420
downvote count: 0

http://stackoverflow.com/a/27821083
has body: There is a split function offered by javascript. Essentially what you are trying to do is split the string into array of strings based on the character you need. var str = "image.jpg"; var array = str.split("."); array.pop(); var imageName = array.join(""); PS: This is pure javascript so you don't really need any other library.
has comment: http://stackoverflow.com/comment/44048382
answers question: http://stackoverflow.com/q/27821028
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44048600
downvote count: 0
type: Answer

http://stackoverflow.com/a/27864213
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27864138
score: 1
upvote count: 1
has body: Pass a reference to self, then you can do whatever you want with it. &lt;input checked="" type="checkbox" id="check1" onchange="checkChange(this)"&gt;Ch1 &lt;input checked="" type="checkbox" id="check2" onchange="checkChange(this)"&gt;Ch2 &lt;input checked="" type="checkbox" id="check3" onchange="checkChange(this)"&gt;Ch3 function checkChange(bx){ console.log(bx) }

firebase
tags question: http://stackoverflow.com/q/27877612
tags question: http://stackoverflow.com/q/27954014
tags question: http://stackoverflow.com/q/27880275
tags question: http://stackoverflow.com/q/27864228
tags question: http://stackoverflow.com/q/27908318
tags question: http://stackoverflow.com/q/27871466
tags question: http://stackoverflow.com/q/27919135
tags question: http://stackoverflow.com/q/27898302
tags question: http://stackoverflow.com/q/27824952
tags question: http://stackoverflow.com/q/27832656
tags question: http://stackoverflow.com/q/27851838
tags question: http://stackoverflow.com/q/27879654
tags question: http://stackoverflow.com/q/27806343
type: Tag
tags question: http://stackoverflow.com/q/27947570
tag name: firebase

http://stackoverflow.com/q/27881841
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: Getting content to show in individual divs using hover in jquery
has answer: http://stackoverflow.com/a/27881856
type: Question
tagged with: javascript
tagged with: jquery
has body: So I'm building an online portfolio using bootstrap and jquery. I have a set of images lined up and formatted next to each other and I'm trying to get the description for each of them to pop up when the individual image is hovered over. Each image is wrapped in a ".col-md-3" tag and has a ".description" tag with information in it below the image tag. I can get all of the descriptions to show when a user hovers over any of the image tags but I can't get the description to show for one image when that individual image is hovered over. HTML: These are the wireframes and sitemaps for this portfolio JQuery: $(document).ready(function() { $(".description").hide(); $(".col-md-3").hover(function() { $(".description").show(); },function() { $(".description").hide(); }); }); How do I get the browser to select individual description s when individual images are hovered over?
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/27958553
type: Question
has title: ScriptControl.AddCode without executing the code?
tagged with: c#
has answer: http://stackoverflow.com/a/27962484
has answer: http://stackoverflow.com/a/27959875
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27962484
answer count: 2
upvote count: 1
has body: I'm working on a project in C# that get scripts (VBScript, Jscript and JavaScript) from the EA database and executes certain functions at specific moments. To be able to do this I use the Microsoft ScriptControl. First I add all script code to the ScriptControl using ScriptControl.AddCode and then I functions with a specific name. The code that adds the code to the script control looks like this: //create new scriptcontroller this.scriptController = new ScriptControl(); this.scriptController.Language = this.language.name; this.scriptController.AddObject("Repository", model.getWrappedModel()); //Add the actual code. This must be done in a try/catch because a syntax error in the script will result in an exception from AddCode try { //first add the included code string includedCode = this.IncludeScripts(this._code); //then remove any statements that execute a function or procedure because scriptControl.AddCode actually executes those statements string cleanedCode = this.language.removeExecutingStatements(includedCode); //then add the cleaned code to the scriptcontroller this.scriptController.AddCode(cleanedCode); The problem is that apparently AddCode also executes the script code in some way, which is not what I want. Say I have following VBScript: sub main MsgBox("main executed") end sub main As soon as I add the code of this script to the ScriptControl using AddCode the main sub is executed and I see the messagebox appear. Does anyone know an easy way to avoid executing the main sub in cases like this? My current workaround (currently only implemented for VBScript) involves parsing the script code and stripping the line that calls functions or procedures, but that is pretty tedious and error prone. /// /// removes the statements that execute a function/procedure from the code /// /// the code with executing statements /// the code without executing statements public override string removeExecutingStatements(string code) { StringReader reader = new StringReader(code)…
favorite count: 0
tagged with: jscript
tagged with: enterprise-architect
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/27959875
tagged with: vbscript

http://stackoverflow.com/a/27937090
score: 0
type: Answer
has body: $scope.checkCodeMeli = function (id) { var result = myHellperService.checkCodeMeli(id); if (result === false) { $scope.requesterViewModel.NationalCode = ""; $scope.inValidMeliCode = "کد ملی نا معتبر می باشد"; return false; } else { $scope.GetRequesterByNationalCode(id); return true; } } And Span is like :- &lt;span ng-show="checkCodeMeli(requesterViewModel.NationalCode)"&gt;{{inValidMeliCode}}&lt;/span&gt;
answers question: http://stackoverflow.com/q/27936851

currency
tag name: currency
tags question: http://stackoverflow.com/q/27913601
type: Tag

http://stackoverflow.com/comment/44128229
type: AnswerComment
has text: how do i do that cuz its my first time using javascript
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27862075

http://stackoverflow.com/comment/44241032
has text: @JamieBarker I want to select all in one array
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27921938

http://stackoverflow.com/a/27940135
downvote count: 2
has comment: http://stackoverflow.com/comment/44276561
has body: As per my understanding what you want is to execute some code only when the user click on the okBtn and some code when the user click on cancelBtn. If that you can change your code in this way function confirm(callback) { okBtn.on('click', function(){ // return true to the callback callback(true) }); cancelBtn.on('click', function(){ // return false to the callback callback(false) }); } confirm(function(confirmed){ if(confirmed) { // make something } else { // do something } });
answers question: http://stackoverflow.com/q/27939840
has comment: http://stackoverflow.com/comment/44276464
score: -2
type: Answer
upvote count: 0

http://stackoverflow.com/a/31603297
has comment: http://stackoverflow.com/comment/59005870
has comment: http://stackoverflow.com/comment/53936204
downvote count: 1
upvote count: 33
has comment: http://stackoverflow.com/comment/60168985
has body: You can pass props by passing them to &lt;RouteHandler&gt; (in v0.13.x) or the Route component itself in v1.0; // v0.13.x &lt;RouteHandler/&gt; &lt;RouteHandler someExtraProp={something}/&gt; // v1.0 {this.props.children} {React.cloneElement(this.props.children, {someExtraProp: something })} (from the upgrade guide at https://github.com/rackt/react-router/releases/tag/v1.0.0) All child handlers will receive the same set of props - this may be useful or not depending on the circumstance.
score: 32
type: Answer
answers question: http://stackoverflow.com/q/27864720

http://stackoverflow.com/comment/44119997
score: 0
has text: @bakkupavan You're welcome. Did my answer help you out? If so, please remember to accept my answer and upvote it.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27835595

http://stackoverflow.com/a/34777308
has comment: http://stackoverflow.com/comment/85588806
has body: NVM will set the path for node and npm once you run nvm use &lt;node_version&gt; However, that is just for the current shell and any new shells will not have a version of node an npm selected until your run the previous command unless you set a default version nvm alias default &lt;node_version&gt; voila! You have a working version of npm and node in any new shell you open. To change the default simply run it again with the new version of node you want to use. e.g. nvm alias default v5.4.0
downvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/108412102
has comment: http://stackoverflow.com/comment/121154172
has comment: http://stackoverflow.com/comment/76190999
has comment: http://stackoverflow.com/comment/125001013
has comment: http://stackoverflow.com/comment/116416217
has comment: http://stackoverflow.com/comment/90246097
upvote count: 53
answers question: http://stackoverflow.com/q/27876557
has comment: http://stackoverflow.com/comment/116413254
score: 45
has comment: http://stackoverflow.com/comment/123861245

http://stackoverflow.com/comment/44063478
has text: even when I clear the console and check about:memory page again it's still around 500,000
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27828688
score: 0

http://stackoverflow.com/comment/44117932
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27857214
has text: That means you're not getting valid JSONP back.
score: 0

http://stackoverflow.com/comment/44208538
type: AnswerComment
type: Comment
has text: When I click on it, It linked to it. It really hard to see, can you help me change the color of the `selected` country-name to red and when I click on it.
comment on: http://stackoverflow.com/a/27904624
score: 0

http://stackoverflow.com/q/27911539
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27913817
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27913817
score: 1
tagged with: directive
upvote count: 1
type: Question
has body: I have a select drop down generated from the server side so I cannot change it to use a javascript or array or ng-select. I would like to convert the attributes of the selection into a javascript object. opt1 opt2 opt3 I would like 'selectedVal' to look like this: {"value":"val2","attr1":"attr21val","attr2":"attr22val"} The best solution I can come up with is adding a directive to each option that gets the attributes and pushes them to an object array. I then can use ng-change on the select drop down. Then get the selected object on the array based on the selection's value. Is there a better way to do this? Here what directive looks like: app.directive('cpOption', function () { function link(scope, elem, attr) { var obj = {}; for (var property in attr.$attr) { if (attr.hasOwnProperty(property)) obj[property] = attr[property]; } scope.cpOption.push(obj); } return { restrict: 'A', link: link, scope: { cpOption: '=cpOption' } } }); and the controller app.controller('myCtrl', function ($scope) { $scope.allObjs = []; $scope.selectedVal = {}; $scope.selecteObj = {}; $scope.selectVal = function () { for (var val in $scope.allObjs) { if ($scope.allObjs[val].value === $scope.selectedVal) { $scope.selecteObj = $scope.allObjs[val]; break; } } } }); Any better ways to accomplish this? Ideally I wouldn't need the array with all the objects, I just need the selected object. jsfiddle: http://jsfiddle.net/ocLrt7vp/7/
tagged with: javascript
has title: Getting selection attribute values from a server side generated drop down with Angular

http://stackoverflow.com/q/27942712
has title: NodeJs using Nodemailer to spoof sender/from email aadress for gmail
type: Question
downvote count: 0
tagged with: javascript
tagged with: nodemailer
answer count: 1
tagged with: email
has answer: http://stackoverflow.com/a/27943854
favorite count: 0
has body: Is it possible/How to send an email through nodemailer with a "dynamic" sender email? (smtp) For example: In Gmail I would receive a new email that was sent from 121llkkjsdf@mytestsite.com Where "121llkkjsdf" is a randomly generated string and mytestsite.com is where I have nodemailer setup. var message = { // sender info from: '121llkkjsdf &lt;121llkkjsdf@mytestsite.com&gt;', // Comma separated list of recipients to: '&lt;someone@somewhere.com&gt;', // Subject of the message subject: '', // // plaintext body text: '', // HTML body html: '' }; If i only give nodemailer this above object, it still uses the smtp account sender email.
upvote count: 2
type: UnansweredQuestion
tagged with: node.js
tagged with: gmail
score: 2

http://stackoverflow.com/comment/44225584
comment on: http://stackoverflow.com/q/27913065
type: Comment
type: QuestionComment
has text: In your content script code? Or are you injecting some other code from the content script?
score: 0

http://stackoverflow.com/comment/44255642
has text: @ClintNash Where are you setting window.whatever? did you try window['whatever'] ? How does your original constant looks like , before minification.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27929195
type: QuestionComment

http://stackoverflow.com/q/27899740
type: Question
has title: chrome.tabs.executeScript runs multiple times
answer count: 1
has comment: http://stackoverflow.com/comment/44199453
tagged with: javascript
has answer: http://stackoverflow.com/a/27900421
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/44199490
type: UnansweredQuestion
score: 0
tagged with: google-chrome
has body: Hey I have a Chrome extension and I need to stop page given from loading (before it starts). So we have the following code in background.js: chrome.webNavigation.onBeforeNavigate.addListener(function (e){ // Important! there's more code that make sure this runs once - it isn't recuresive killPage(e.tab); }); function killPage(tabId){ chrome.tabs.executeScript(tabId, { code: "window.stop();", runAt: "document_start" }); } When we use window.stop, the execute script happens twice, and when we use document.open();document.close() it runs endless times and reaches max callstack. We made sure that the only thing that runs again is the code in the execute script (not event the line chrome.tabs.executeScript) How can I make the execute script run only once?
has comment: http://stackoverflow.com/comment/44201234
has comment: http://stackoverflow.com/comment/44201109

http://stackoverflow.com/a/27831988
score: 0
type: Answer
has body: I think you're looking for the DOM function getElementByClassName(). For example, if you run var x = document.getElementByClassName('wrap') in your case, x will be a list of all dom elements which have the class 'wrap' . source: w3schools
answers question: http://stackoverflow.com/q/27831919

http://stackoverflow.com/a/27940720
answers question: http://stackoverflow.com/q/27940598
has comment: http://stackoverflow.com/comment/44277702
has body: Here you are attaching the click event listener two times. One normal and one after clicking, thats why its happening use jquery toggle or use in this way $(document).ready(function(){ $('.menu-icon').click(function(){ var navigator = $('#navigator'); if(navigator.offset().left == 0) { navigator.animate({left:'-250px'},200); $(this).animate({left:'0px'},200); } else { navigator.animate({left:'0px'},200); $(this).animate({left:'250px'},200); } }); });
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44277808
has comment: http://stackoverflow.com/comment/44277530
has comment: http://stackoverflow.com/comment/44277739

http://stackoverflow.com/comment/44289224
has text: Thanks a lot. I wish I could give more reputation for this.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27947101
score: 0

http://stackoverflow.com/q/27954014
has title: Finding an element by value using the Firebase Javascript API
type: Question
has answer: http://stackoverflow.com/a/27954165
has body: Here is my code that adds new colors to the table, it works perfectly and the Firebase Dashboard shows that each color is added with a new id to the colors table: // example pushColor('yellow') { function pushColor(colorName) { var colorsRef = fireBaseRef.child("colors"); colorsRef.push(colorName, function(error) { if (error) { alert("Color could not be saved." + error); } }); } Before I add a new color, however, I want to make sure that the one I am adding doesn't already exist in the table. Here is my attempt so far: function colorExists(colorName) { var colorsRef = fireBaseRef.child("colors"); colorsRef.once('value', function(snapshot) { exists = (snapshot.val() !== null); if (exists) { alert(colorName + ' exists!'); } else { alert(venueName + ' does not exist!'); } }); } The problem is that when I submit my form, I get the following behavior: First time checking for color "black" (with an empty table): "black does not exist!" I add black as a color. Second time checking color "black": "black exists!" ...so far, so good. But then if I submit color "purple" (not in the database) I get: "purple exists!" Anything I search for after inserting the first color returns "exists!" I'm guessing that I am not understanding the way that the colorExists() method is working, can anyone point me in the right direction towards fixing this function so that it does what I want, or help me find the related documentation to find an entity by one of its values?
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: firebase

http://stackoverflow.com/comment/44261857
type: Comment
type: QuestionComment
has text: well I've seen codes to scroll the parent page up. Can't I do something like that once the whole iframe loads? @MarcoDelValle
comment on: http://stackoverflow.com/q/27930995
score: 0

http://stackoverflow.com/comment/44262620
type: AnswerComment
has text: You could abstract all that CSS out into a CSS class to keep the JS clean. Then simply use `.addClass()` and `.removeClass()`...
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27932452

http://stackoverflow.com/comment/44019228
has text: I have several ajax calls. They work fine but they are all independent.
score: 0
comment on: http://stackoverflow.com/q/27805072
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44263629
type: QuestionComment
type: Comment
score: 0
has text: Nevermind, that does actually fix it. This seems like a bug to me though...Why should it work when I wrap the element, but not for the individual input?
comment on: http://stackoverflow.com/q/27932759

http://stackoverflow.com/comment/44039760
type: QuestionComment
comment on: http://stackoverflow.com/q/27816824
has text: (The snipped) It says `nanoGallery` is not a function, which isn't surprising. Since you provide a snippet I expected a self-contained example?
score: 0
type: Comment

http://stackoverflow.com/comment/44108799
has text: Fyi, my numbers in actually are percentages. So they will always be between 0 an 100. So although multiplying by 1is a bit hacky because it fails for numbets over 999, it is good enough for my purposes for now. I would prefer that than having to write my own filter.
comment on: http://stackoverflow.com/a/27850900
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27870490
type: Question
has comment: http://stackoverflow.com/comment/44143417
has comment: http://stackoverflow.com/comment/44144788
has answer: http://stackoverflow.com/a/27871414
answer count: 2
tagged with: cartesian
score: 5
has comment: http://stackoverflow.com/comment/44145086
has comment: http://stackoverflow.com/comment/44144522
has comment: http://stackoverflow.com/comment/44144975
has comment: http://stackoverflow.com/comment/44144757
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27871393
possible better answer: http://stackoverflow.com/a/27871414
favorite count: 0
has comment: http://stackoverflow.com/comment/44144928
has comment: http://stackoverflow.com/comment/44145129
has comment: http://stackoverflow.com/comment/44145084
has comment: http://stackoverflow.com/comment/44145595
tagged with: powerset
has comment: http://stackoverflow.com/comment/44144210
accepted answer: http://stackoverflow.com/a/27871393
has comment: http://stackoverflow.com/comment/44145229
has comment: http://stackoverflow.com/comment/44144391
has comment: http://stackoverflow.com/comment/44144959
has title: Create cartesian product (powerset?) of JavaScript objects by looping through unknown number of arrays
has comment: http://stackoverflow.com/comment/44144771
has comment: http://stackoverflow.com/comment/44144486
has body: I'm a beginner, so please pardon my ignorance if this is trivial. I have a javascript object of unknown length, and each property's value is an array (also of unknown length to me). For example: var obj = {"varA":[1,2,3], "varB":['good','bad'], "varC":[0,100], "varD":['low','med','high'] } I want to loop through each of the properties and create a new object for every combination of property values. If I knew the number of properties I could just brute-forcedly use for loops, but is there a way to enumerate without knowing how many loops to hard-code? I essentially want to do this kind of thing: var oblist = []; for (a in varA){ for (b in varB){ for (c in varC){ for (d in varD){ oblist.push({"varA":varA[a], "varB":varB[b], "varC":varC[c], "varD":varD[d]}); } } } } so that oblist will contain objects like: {"varA":1, "varB":"good", "varC":0, "varD":"low"} {"varA":1, "varB":"good", "varC":0, "varD":"med"} ... {"varA":3, "varB":"bad", "varC":100, "varD":"high"} Thanks! Edit: Look I'm not asking for for-loop or indexing syntax help. I'm asking what to do if I don't know the number of properties in the object (e.g. varA, varB, varC, varD, varE, hell i could have varZZ for all i know), so I can't just hard-code 4 for loops. Is there a way to set that using obj[Object.keys(obj)[i]].length?
tagged with: enumerate
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44144647
linked to: http://stackoverflow.com/q/12303989
has comment: http://stackoverflow.com/comment/44144997
linked to: http://stackoverflow.com/q/11922383
has comment: http://stackoverflow.com/comment/44144708
upvote count: 5
has comment: http://stackoverflow.com/comment/44145782
has comment: http://stackoverflow.com/comment/44145089

http://stackoverflow.com/comment/44181878
has text: you don't use prototype at all so in your case this should be true, `myFather instanceof person`
comment on: http://stackoverflow.com/q/27890392
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27876245
score: 0
has comment: http://stackoverflow.com/comment/44395085
answers question: http://stackoverflow.com/q/27876109
has body: You have a typo in your event.preventDefault, it should be event.preventDefault(); Also, check the correct usage of $.getJSON, your $.each should be inside $.getJSON success callback. For example $.getJSON("ajax/test.json", function(data) { // $.each() here. });
type: Answer

http://stackoverflow.com/q/27826212
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27826328
accepted answer: http://stackoverflow.com/a/27826328
score: -2
type: Question
downvote count: 2
has body: I'm trying to extract the file name of the string attachment; filename="contract.pdf" How can I always extract what's in between the quotes (e.g. contract.pdf)? Or maybe there is a better way.
answer count: 1
has title: reg ex for anything after a specific character and between others
tagged with: javascript
favorite count: 0
tagged with: regex
upvote count: 0

http://stackoverflow.com/q/27893371
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27893413
tagged with: http://stackoverflow.com/tag/json
has body: how should I insert some data into JSON? I need to create a JSON file through a script. The JSON file should look like this: { "index": { "colors": [ { "title": "great color", "name": "nice color" }, { "title": "worst color", "name": "bad color" } ] } } in my javascript file i amable to push to the colors array: var index = {index: {}}; var posts = {colors: []}; var single = {title: "great color", name: "nice color"}; posts.colors.push(single); however, how do i insert it into the index object? i am writing to a JSON file currently like this: fs.writeFile(file, JSON.stringify(posts, null, 2)); but this writes only the colors array, and the resulting JSON file is like this: { "colors": [ { "title": "great color", "name": "nice color" }, { "title": "worst color", "name": "bad color" } ] } how can i create the JSON structure that i need?
has comment: http://stackoverflow.com/comment/44188410
has comment: http://stackoverflow.com/comment/44188006
type: Question
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27894629
upvote count: 1
has answer: http://stackoverflow.com/a/27894629
favorite count: 0
downvote count: 5
accepted answer: http://stackoverflow.com/a/27893413
score: -4
has title: How to insert into JSON?

http://stackoverflow.com/q/27845178
favorite count: 0
has answer: http://stackoverflow.com/a/27845921
type: Question
has comment: http://stackoverflow.com/comment/44094662
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/44094444
has comment: http://stackoverflow.com/comment/44094262
tagged with: recursion
has comment: http://stackoverflow.com/comment/44094193
has title: Javascript square function
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44094461
has comment: http://stackoverflow.com/comment/44094364
has answer: http://stackoverflow.com/a/27845260
has answer: http://stackoverflow.com/a/27845864
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44094412
has body: I want to write a function that checks if the given number has a certain order. The second number has to be the square of the previous number. The first number can only be 0 - 9. So for example 2439 would return 'true' because 4 is the square of 2 and 9 is the square of 3. 39416 would also give 'true', and for example 1624 would return 'false'. I don't really have an idea how to do this. It should be a recursive function but an example of how to do it without recursion would be helpfull too.
has comment: http://stackoverflow.com/comment/44094709

http://stackoverflow.com/comment/44283950
comment on: http://stackoverflow.com/a/27944258
has text: sorry I did not get you when you say **everything is**. what about this `var a = new Date() ; var b = a`. I hope now a and b are referencing the same object, b is just another variable that points to same object created earlier.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27830948
upvote count: 52
has comment: http://stackoverflow.com/comment/44089670
accepted answer of: http://stackoverflow.com/q/27828804
answers question: http://stackoverflow.com/q/27828804
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/44089184
has comment: http://stackoverflow.com/comment/44089750
score: 51
type: Answer
has comment: http://stackoverflow.com/comment/44089348
has comment: http://stackoverflow.com/comment/44089458
has comment: http://stackoverflow.com/comment/44089233
has body: As discussed in the comments, there are actually many different ways of constructing a string that causes this issue, and it is not necessary for there to be two percent signs in most cases. http://example.com/% http://%%% http://ab% http://%ab http://%zz However, it's not just the presence of a percent sign that breaks the Chrome console, as when we enter the following well-formed URL, the console continues to work properly and produces a clickable link. http://ab%20cd Additionally, the strings http://%, and http://%% will also print properly, since Chrome will not auto-link a URL-link string unless the http:// is followed by at least 3 characters. From here I hypothesized that the issue must be in the process of linking a URL string in the console, likely in the process of decoding a malformed URL. I remembered that the JavaScript function decodeURI will throw an exception if given a malformed URL, and since Chrome's developer tools are largely written in JavaScript, could this be the issue that is evidently crashing the developer console? To test this theory, I ran Chrome by the command link, to see if any errors were being logged. Indeed, the same error you would see if you ran decodeURI on a malformed URL (i.e. decodeURI('http://example.com/%')) was being printed to the console: [4810:1287:0107/164725:ERROR:CONSOLE(683)] "Uncaught URIError: URI malformed", source: chrome-devtools://devtools/bundled/devtools.js (683) So, I opened the URL chrome-devtools://devtools/bundled/devtools.js in Chrome, and on line 683, I found the following. {var parsedURL=new WebInspector.ParsedURL(decodeURI(url));var origin;var folderPath;var name;if(parsedURL.isValid){origin=parsedURL.scheme+"://"+parsedURL.host;if(parsedURL.port) As we can see, decodeURI(url) is being called on the URL without any error checking, thus throwing the exception and crashing the developer console. A real fix for this issue will come from adding error handling to the Chrome console code, but in the meanti…
has comment: http://stackoverflow.com/comment/44089430

http://stackoverflow.com/comment/44052617
has text: Thanks. I would however make a serverside call to get the data and not get it from a file. How would I change this line $http.get('json/jsonAngular.txt') if the call is made to a database? by using the conttroller method public JsonResult GetArtists()
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27823315

http://stackoverflow.com/comment/44117810
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27857297
has text: Its not really clear what you want, but have you tried Categories? http://api.highcharts.com/highcharts#xAxis.categories
type: Comment

http://stackoverflow.com/comment/44054438
has text: @Jackhardcastle - It's just another way of doing it.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27824117

http://stackoverflow.com/a/27916808
score: 1
type: AcceptedAnswer
has body: Let me reindent the problematic part, so you can see more easily what is going wrong. The marked line contains two characters that are not in your code. { cType: types.POWER_STATE_CTYPE, onUpdate: function (value) { exec('python /home/pi/Desktop/Projects/Lights/on.py' + value, function (error, stdout, stderr) { } ); }, // &lt;---- MISSING perms: ["pw", "pr", "ev"], format: "bool", .... Without brace and comma, the object is interpreted in your code as: { cType: types.POWER_STATE_CTYPE, onUpdate: function (value) { exec('python /home/pi/Desktop/Projects/Lights/on.py' + value, function (error, stdout, stderr) { } ); perms: ["pw", "pr", "ev"], format: "bool", .... Here, perms: is taken as a label, ["pw", "pr", "ev"], format as an expression (which is also a statement), and then you find a : which should never follow a statement, but only either a key inside an object, or a label before a statement; and neither can be an expression. Hence the syntax error.
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44248540
has comment: http://stackoverflow.com/comment/44236191
accepted answer of: http://stackoverflow.com/q/27916510
answers question: http://stackoverflow.com/q/27916510
downvote count: 0

http://stackoverflow.com/comment/44228436
score: 0
has text: [Just opened an issue on github](https://github.com/google/google-api-nodejs-client/issues/347)
comment on: http://stackoverflow.com/q/27914545
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44234978
type: QuestionComment
score: 0
has text: @freefaller - it would
comment on: http://stackoverflow.com/q/27918439
type: Comment

http://stackoverflow.com/comment/44250526
type: QuestionComment
has text: Not sure understood my first comment, sorry, you don't even need JavaScript, why would you insist on it? You can just do it in HTML, if you don't want to leave the page, then target the links to a hidden IFRAME.
comment on: http://stackoverflow.com/q/27925420
score: 0
type: Comment

http://stackoverflow.com/a/27822900
score: 1
has body: You can wrap the text in a label tag, and then use nextSibling.innerHTML to get the text inside the label. Add the label: Red color Then use nextSibling.innerHTML instead of value: var x = document.getElementById("myRadio").nextSibling.innerHTML;
answers question: http://stackoverflow.com/q/27822673
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/44209492
comment on: http://stackoverflow.com/a/27888531
score: 0
type: Comment
has text: This CSS basically makes iFrame expand to fill its parent, so if an iFrame is the child of BODY, it should cause the iFrame to expand to fill the screen. If it's a child of a div, then that div will need to have a height/width that the iFrame can expand into. But like you said I think that's a red hearing in what you're trying to accomplish.
type: AnswerComment

http://stackoverflow.com/comment/44260520
comment on: http://stackoverflow.com/q/27930420
type: Comment
type: QuestionComment
score: 1
has text: Might not be a "code" issue. Can't reproduce either on FF 35, 37, opera 26, chrome 39 on osX 10.9.

http://stackoverflow.com/comment/44149409
score: 0
type: Comment
has text: Working Perfectly! Is this the best way of building a puzzle game or would you suggest something better? To better understand why did you /8 in the dragging event?
comment on: http://stackoverflow.com/a/27864604
type: AnswerComment

http://stackoverflow.com/comment/44111258
type: Comment
has text: bummer - the ability to generate tests asynchronously would be helpful in some situations. How was you suggest getting around this issue? I guess I could have some sort of check that only uses one assertion.
type: AnswerComment
comment on: http://stackoverflow.com/a/27851540
score: 1

http://stackoverflow.com/q/27808082
has title: Angularjs select with no selection
has answer: http://stackoverflow.com/a/27808140
score: 0
has comment: http://stackoverflow.com/comment/44025210
linked to: http://stackoverflow.com/q/18194255
answer count: 1
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44025423
has body: This seems like a really simple thing I'm looking for and the fact that I can't find anything on SO or anywhere else makes me think I must be missing something really obvious, but so far I'm stumped. My question is; is there any way, when using a select box set up with ng-options, to set the list to no selection (i.e. selectedIndex = -1)? I have a select box set up as a non-dropdown and I want to be able to display the list with nothing selected. I'm adding the code I use below, but I believe it's pretty standard stuff. The curSearchResults array is populated from the server. I'm not including that here since it is working fine. I've tried setting selSearchRslt to null and back to a new searchRslt() after fetching the list, but both leave a blank option at the top of the list. I'm used to it being really simple to set a select box to no selection as desired... at the controller: function searchRslt() { this.RsltId = ''; this.RsltName = ''; } $scope.curSearchRslts = []; $scope.selSearchRslt = new searchRslt(); in the markup: &lt;select class="listPanel" ng-model="selSearchRslt" ng-options="rslt as rslt.RsltName for rslt in curSearchRslts" ng-change="loadSearchRslt()" size="40" style="height: 300px; width: 480px"&gt; &lt;/select&gt; This is in response to the comments below: I read the questions you refer to and I did see the stuff in the doc about adding the option to the markup, but this doesn't give the same result as setting the selected index to -1. Instead it adds an unused option to my list. Particularly when the list isn't displayed as a dropdown, I find this solution to be very clunky in terms of the UI. I don't want that extra option. I want just the options I'm actually going to use, but with none selected. If the answer is I can't do that, fine, but adding an unused option is certainly not the same thing as setting the selectedIndex to -1. Further, I'm not looking for a way to set a default option, I'm looking for a way to have no option selected. I don't …
type: UnansweredQuestion
tagged with: select
tagged with: angularjs-ng-options
duplicate of: http://stackoverflow.com/q/18194255
type: Question
tagged with: selectedindex
has comment: http://stackoverflow.com/comment/44057747

http://stackoverflow.com/q/27930990
has comment: http://stackoverflow.com/comment/44259419
answer count: 1
has title: Hide div for 2 hour cookie javascript?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44259805
tagged with: cookies
has comment: http://stackoverflow.com/comment/44259396
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/10674611
has answer: http://stackoverflow.com/a/56769923
has body: i want hide div when the person click on it and show another div using cookies this is work for me but it take 24 hour , i wana make it just 2 hour ? Hide div 24hr cookie javascript? i want make it 2 hour not 24 hour :)
score: 0

http://stackoverflow.com/a/27982236
accepted answer of: http://stackoverflow.com/q/27863350
has body: Instead of trying to change the value of the templateUrl on the route, you should define another route. Then you can simply switch routes. To change the route/view, you need update the path. You can do this using the $location service. See AngularJS : How do I switch views from a controller function?
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27863350
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/44218238
type: AnswerComment
has text: You can't change the source that is on the server. If you can't breakpoint before the problem happens you might need to write an extension to do it for you.
type: Comment
comment on: http://stackoverflow.com/a/27909054
score: 0

http://stackoverflow.com/a/27880745
answers question: http://stackoverflow.com/q/27880672
has body: Assuming that what you are actually receiving is an array rather than that invalid JSON that you've shown there: success:function(data){ data=JSON.parse(data); // you probably shouldn't be using this line data.forEach(function (item) { console.log(item.status + ' ' + item.message); }); }
score: 0
type: Answer

http://stackoverflow.com/comment/44338120
comment on: http://stackoverflow.com/a/27922669
type: Comment
has text: @PapoucheGuinslyzinho No problem, I'm glad you got that to work. Please accepts the answer so I can get the internet points :). Thanks!
score: 0
type: AnswerComment

http://stackoverflow.com/a/27836736
downvote count: 0
has body: Ideally your database connector would allow you to specify what type of data you are returning in the row, if factor is a numeric type. For instance, PDO and mysqlnd can return native types (see How to get numeric types from MySQL using PDO?). However, you can do the following: while ($r = mysql_fetch_assoc($sth)) { $r['data'] = intval($r['data']); $rows[] = $r; } This way, your JSON encoding will have an integer.
type: Answer
answers question: http://stackoverflow.com/q/27836673
upvote count: 1
score: 1

http://stackoverflow.com/a/27915957
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44230622
answers question: http://stackoverflow.com/q/27915291
accepted answer of: http://stackoverflow.com/q/27915291
has body: If I run your code in IE11, I see: Illegal name character. Line: 1, Column 478 And characters 470-479 of the XML string are: Front &amp; Da It's failing to parse because your XML is invalid. Here: &lt;INTER&gt;Clay between Front &amp; Davis&lt;/INTER&gt; XML can't contain bare ampersands. They have to be escaped: &lt;INTER&gt;Clay between Front &amp;amp; Davis&lt;/INTER&gt; I also suspect that there are better ways to get XML into your code that don't involve concatenating the XML together one line at a time. You could store it on your site and load it using an XHR, for example. I would also advise against using document.write() in this day and age.
has comment: http://stackoverflow.com/comment/44230667
type: AcceptedAnswer

http://stackoverflow.com/comment/44317088
comment on: http://stackoverflow.com/q/27961537
has text: how did you paint it? Here it works fine: http://jsfiddle.net/jtav1dm6/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44026336
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27808542
has text: All keys are strings.
score: 0

http://stackoverflow.com/q/27809210
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/27809718
accepted answer: http://stackoverflow.com/a/27809718
type: AnsweredQuestion
has body: I have a very large amount of data to put into the DOM which is causing a rendering performance bottleneck. I'm restricted to using a pre-1.3 version of angular so there is no native bind once feature, but I could potentially use a plug-in to get that in. My question is, would there be a big performance difference in terms of initial rendering time or otherwise, between a bindonce implementation vs wrapping native javascript and/or templating engine inside angular to generate the DOM?
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: Angular bindonce vs native javascript

http://stackoverflow.com/comment/44090282
score: 0
type: QuestionComment
type: Comment
has text: It should work with "my\"annoying'password", but for testing purposes try this ugly code "my" + '"' + "annoying'password"
comment on: http://stackoverflow.com/q/27843258

http://stackoverflow.com/a/27937124
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27937106
downvote count: 0
has body: Try this console.log($("*[id$='_pan1'].oleDiv1")); Example

http://stackoverflow.com/q/27915571
has body: I am writing a javascript in the Google spreadsheets and trying to fetch a URL. When i run curl on the same URL I am able to get it working. But when i try to use UrlFetchApp from javascript I get DNS error. Below is my code sample . Am I missing something ? function upload() { Logger.log("hello, "); var headers = { 'Content-Length' : 0 }; var options = { 'method': 'post', 'useIntranet': true, 'validateHttpsCertificates': false, 'contentType': 'text/xml' }; var response = UrlFetchApp.fetch("http://localhost:8787/test/v2/feed", options); Logger.log("fetched data"); Logger.log(response); }
tagged with: google-sheets
has comment: http://stackoverflow.com/comment/44254604
tagged with: javascript
has comment: http://stackoverflow.com/comment/57213444
tagged with: google-apps-script
has title: UrlFetchApp DNS error
has comment: http://stackoverflow.com/comment/44239500
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: localhost
score: 2
has comment: http://stackoverflow.com/comment/44254259
has comment: http://stackoverflow.com/comment/44254641
upvote count: 2
tagged with: urlfetch
type: Question
has answer: http://stackoverflow.com/a/35469853
linked to: http://stackoverflow.com/q/30085768

http://stackoverflow.com/q/27911613
tagged with: algorithm
has title: Waveform.js - Algorithm for thicker lines in the waveform
tagged with: javascript
tagged with: canvas
tagged with: soundcloud
accepted answer: http://stackoverflow.com/a/30355800
has body: I'm looking for the solution that will help to teach http://waveformjs.org/ library to draw waveforms in modern Soundcloud style. Examples: I assume that this could be possible to achieve with the data (which is array of floats) that Waveform.js accepts and draws here but I'm absolute noob in such graphic algorithms. Any suggestions will be helpful. Thanks!
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/30355800
score: 2
type: AnsweredQuestion
tagged with: waveform
upvote count: 2
has comment: http://stackoverflow.com/comment/46492664
has comment: http://stackoverflow.com/comment/46493865
type: Question

http://stackoverflow.com/comment/44112752
score: 0
has text: So what basically do you want ? One time you are saying User should not redirect to Cart page and at the same time you are saying alert should come after product is added to the cart.
type: Comment
comment on: http://stackoverflow.com/a/27854232
type: AnswerComment

http://stackoverflow.com/comment/44060357
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27827216
has text: Use the switch statement, then generate a function that can be used to handle the show, hide, and remove based on which statement.

http://stackoverflow.com/q/27855965
has comment: http://stackoverflow.com/comment/44123262
has comment: http://stackoverflow.com/comment/44115187
has answer: http://stackoverflow.com/a/27857299
score: 0
has comment: http://stackoverflow.com/comment/44124566
possible better answer: http://stackoverflow.com/a/27856254
accepted answer: http://stackoverflow.com/a/27856241
has title: Select elements by Input Type and apply CSS classes based on values
has answer: http://stackoverflow.com/a/27856254
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44124994
has answer: http://stackoverflow.com/a/27856241
has body: I have a page that contains a whole bunch of input boxes of type number. These can be individually changed, or a set of them can be changed by a selector. I would like to show the user which input boxes have values greater than 0 in them by changing the class of the input box. I cannot use JQuery. It has to be done with pure Javascript. I understand I will need to use an event listener to attach a function to it? Anyway... here's a piece of html as an example: Here's some Javascript I think should go with this: function changeInputClass(element){ if(element.value > 0){ //add class 'bold-text' to this element } else { //remove class 'bold-text' from this element } } var myElements = document.getElementsByTagName('input'); for(var i=0; i<myElements.length; i++){ if(myElements[i].type == 'number') { // add event listener here to call function changeInputClass() } } Appreciate the help. Update of more realistic representation of the html: Product Description 1 Product Description 2 Product Description 3 Product Description 4 Product Description 5 Product Description 6 Created a fiddle http://jsfiddle.net/narfie/g3gbqaxz/14/
type: Question
has comment: http://stackoverflow.com/comment/44115183
has answer: http://stackoverflow.com/a/27856990
linked to: http://stackoverflow.com/q/265074
tagged with: javascript
has comment: http://stackoverflow.com/comment/44125186

http://stackoverflow.com/comment/44275220
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27937072
type: Comment
has text: SCRIPT5009: 'jQuery' is undefined

http://stackoverflow.com/a/27826151
has comment: http://stackoverflow.com/comment/44058048
has comment: http://stackoverflow.com/comment/44058116
score: 3
type: Answer
accepted answer of: http://stackoverflow.com/q/27826050
has comment: http://stackoverflow.com/comment/44058076
answers question: http://stackoverflow.com/q/27826050
has comment: http://stackoverflow.com/comment/44058097
has comment: http://stackoverflow.com/comment/44058158
upvote count: 3
has comment: http://stackoverflow.com/comment/44058137
has body: document.getElementsByClassName('name') returns an array. You need to select from that array to return an element. Ex. document.getElementsByClassName('name')[0] Assuming that your class name selector is correct, and you choose the right array index, and you're not using an old version of IE, this should work.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27848839
has body: The .off('click') function in your code removes the click event from an element. That's why the links get disabled. Adding and removing event listeners .on() .off() is complicated. It's easier to make sure that everytime you open a new popup the old popup gets closed. Adding a .popup class would be the first step. I updated your fiddle: http://jsfiddle.net/2j1obh92/ jQuery jQuery(document).ready(function(){ jQuery("a.fp").click(function(){ jQuery(".popup").hide(); jQuery(".first").fadeIn(); }); jQuery("a.sp").on('click', function(){ jQuery(".popup").hide(); jQuery(".second").fadeIn(); }); jQuery("a.tp").on('click', function(){ jQuery(".popup").hide(); jQuery(".third").fadeIn(); }); jQuery("a.ftp").on('click', function(){ jQuery(".popup").hide(); jQuery(".fourth").fadeIn(); }); // Hide the popup if the X gets clicked jQuery(".popup span").on('click', function(){ jQuery(".popup").hide(); }); }); HTML First popup | Second popup | Third popup | Fourth popup Hi, this is first popup content.X Hi, this is second popup content.X Hi, this is third popup content.X Hi, this is fourth popup content.X
score: 0
answers question: http://stackoverflow.com/q/27848475
type: Answer

http://stackoverflow.com/comment/44202951
score: 0
type: Comment
has text: I don't think you understood the question. I just have content on one side that needs to scroll. Not "slide when you scroll".
type: AnswerComment
comment on: http://stackoverflow.com/a/27877465

http://stackoverflow.com/comment/44113645
comment on: http://stackoverflow.com/a/27854714
has text: i guess you data might have some overlap on the x-axis? you can use chrome developer tools to debug to see what caused the mess up
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27895192
answer count: 1
has title: How to add zoom-in and zoom-out buttons in dc.geoChoroplethChart
has body: I wanted to add zooming effect to dc.geoChoroplethChart(). I am able to get Zoom-in and Zoom-out behavior with wheelmouse. I achieved with the help of this example. But, how to achieve this using Zoom-in and Zoom-out buttons? I tried multiple multiple ways to do this seeing d3 examples, but ended up unsuccessful and messing the code. Thank you.
tagged with: zooming
tagged with: d3.js
type: UnansweredQuestion
tagged with: geojson
type: Question
has answer: http://stackoverflow.com/a/27900546
tagged with: javascript
tagged with: dc.js
linked to: http://stackoverflow.com/q/24246125
score: 0

http://stackoverflow.com/comment/57125770
score: 2
comment on: http://stackoverflow.com/a/27808445
type: AnswerComment
has text: It has been over a year now. Where does this stand? When is it scheduled to be released?
type: Comment

web-services
type: Tag
tags question: http://stackoverflow.com/q/27874973
tags question: http://stackoverflow.com/q/27837355
tags question: http://stackoverflow.com/q/27878969
tags question: http://stackoverflow.com/q/27845166
tag name: web-services
tags question: http://stackoverflow.com/q/27929224
tags question: http://stackoverflow.com/q/27930543
tags question: http://stackoverflow.com/q/27917168
tags question: http://stackoverflow.com/q/27856319

http://stackoverflow.com/a/27871352
score: 0
answers question: http://stackoverflow.com/q/27871292
has body: Try this code: function select(data, where) { return data.filter(function (e) { for (var key in where) { if (where.hasOwnProperty(key)) { if (e.hasOwnProperty(key)) { if (e[key] != where[key]) { return false; } } else { return false } } } return true; }) }
type: Answer

http://stackoverflow.com/comment/44146051
score: 0
type: QuestionComment
has text: Sorry, I left the office and went out for dinner. :)
type: Comment
comment on: http://stackoverflow.com/q/27870123

http://stackoverflow.com/q/27819391
has title: fancytree drag and drop - get current element
score: 0
type: UnansweredQuestion
tagged with: drag
type: Question
has body: I activated drag and drop in fancytree this is how it looks like: dragDrop: function(node, data) { var level = node.getLevel(); node.parent.setExpanded(true); console.log(node); if(level &lt; 4){ data.otherNode.moveTo(node, data.hitMode); } } how can i get the current element with jquery?
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28314594
tagged with: fancytree

http://stackoverflow.com/comment/44065906
score: 0
type: AnswerComment
type: Comment
has text: Thanks! I'll experiment a bit with both approaches. Maybe I can show a spinner until at least one service is called successfully.
comment on: http://stackoverflow.com/a/27824278

http://stackoverflow.com/comment/44080163
type: Comment
comment on: http://stackoverflow.com/a/27836634
has text: & sorry for my bad english :)
score: 0
type: AnswerComment

http://stackoverflow.com/a/27847481
has comment: http://stackoverflow.com/comment/44125031
has comment: http://stackoverflow.com/comment/44099060
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44124431
answers question: http://stackoverflow.com/q/27847462
score: 0
has comment: http://stackoverflow.com/comment/44125020
accepted answer of: http://stackoverflow.com/q/27847462
has body: Try this: var x = 1; function changeImage() { if (x &gt; images.length) { return; } document.getElementById("img").src = images[x]; x++; } BTW, @tadman's suggestion is good: var images = ["S2b.jpg", "S3b.jpg", "S4b.jpg", "S5b.jpg", "S1b.jpg"]; Then change your x declaration to: var x = 0; And the condition: if (x == images.length) As @Shaiful Islam suggested, you can reset the counter by changing the return; to x = 0.
type: Answer
has comment: http://stackoverflow.com/comment/44100486
has comment: http://stackoverflow.com/comment/44153801
has comment: http://stackoverflow.com/comment/44100337

http://stackoverflow.com/comment/44105123
has text: Thank you, that was all I need to know :)
comment on: http://stackoverflow.com/a/27850150
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/44271592
type: QuestionComment
has text: If i'm understanding you properly, you want the selector to return you the html, but with all elements with 'data-spellcheck=false' removed? That's not what a selector would do. So given html: 1 2 `:not([data-spellcheck="false"])` would return you two elements: id='A' and all subbranches, and id=B. It's not going to return you just the id='A' div element, with id=C branch removed. so element.all(by.css(':not([data-spellcheck="false"])).getText() would return ["12", "1"]
comment on: http://stackoverflow.com/q/27911772
score: 0
type: Comment

http://stackoverflow.com/a/49450651
has body: The issue is related to cascaded selectors like the button in the selector ul:empty + button. It's safe to use the :empty pseudo-class in IE11 when it applies to DOM element itself https://codepen.io/egeneralov/pen/geRQXz.
has comment: http://stackoverflow.com/comment/86411623
answers question: http://stackoverflow.com/q/27947912
score: 0
has comment: http://stackoverflow.com/comment/86386968
type: Answer
has comment: http://stackoverflow.com/comment/86366136

http://stackoverflow.com/q/27836862
favorite count: 0
has answer: http://stackoverflow.com/a/27836922
accepted answer: http://stackoverflow.com/a/27836922
has comment: http://stackoverflow.com/comment/44078164
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
score: -3
possible better answer: http://stackoverflow.com/a/27836954
has comment: http://stackoverflow.com/comment/44078294
has body: I have created this function in javascript for when an ahref link is clicked $(document).ready(function() { $("#ProcessCharges").click(function() { alert("testing"); if($("#customerbilling_unitprice").val() == "") { alert("Please Enter a Unit Price"); return false; } if($("#customerbilling_resellercost").val() == "") { alert("Please Enter a Reseller Unit Price"); return false; } if($("#customerbilling_todate").val() == "") { alert("Please Enter a To Date"); return false; } if($("#customerbilling_fromdate").val() == "") { alert("Please Enter a From Date"); return false; } //work out number of days between the two dates var tDate = new Date($("#customerbilling_todate").val()); var fDate = new Date($("#customerbilling_fromdate").val()); var diff=tDate-fDate; var days_between= diff / 1000 / 60 / 60 / 24; //do the cost per month times 12 (months) var year_cost = $("#customerbilling_unitprice").val() * 12; // RESELLER // var year_cost_reseller = $("#customerbilling_resellercost").val() * 12; // RESELLER // //do the yearly cost / 365 //this will give the daily cost var daily_cost = year_cost / 365; // RESELLER // var daily_cost_reseller = year_cost_reseller / 365; // RESELLER // //check number of days alert(days_between); if(days_between == '29' or days_between == '30' or days_between == '31' or days_between == '0') { //its a FULL month var total_cost = parseFloat( $("#customerbilling_unitprice").val().toFixed(2) ); // RESELLER // var total_cost_reseller = parseFloat( $("#customerbilling_resellercost").val().toFixed(2) ); // RESELLER // } else { //now do the daily cost times cost_per_month var total_cost = daily_cost * days_between; var total_cost = parseFloat( total_cost.toFixed(2) ); // RESELLER // var total_cost_reseller = daily_cost_reseller * days_between; var total_cost_reseller = parseFloat( total_cost_reseller.toFixed(2) ); // RESELLER // } $("#customerbilling_unitprice").val(total_cost); $("#customerbilling_resellercost").val(total_cost_reseller); }); }); But when…
type: AnsweredQuestion
downvote count: 3
has comment: http://stackoverflow.com/comment/44078102
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27836954
has title: javascript .click(function() not running
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27934624
downvote count: 0
tagged with: minify
favorite count: 0
has comment: http://stackoverflow.com/comment/44266848
type: UnansweredQuestion
has title: When minifying javascript, //@ sourceUrl is removed
score: 2
tagged with: uglifyjs
answer count: 0
upvote count: 2
tagged with: google-chrome-devtools
has body: I load my javascript files dinamically, so when I load them, to see those files in DevTools, I use the sourceUrl directive like this //@ sourceURL=foo.js I now added to my project UglifyJS2 to minify my JS, but the problem is that its considering the sourceUrl directive as a comment. So now its removing that and I can't see my scripts in dev tools. Is there a way I can avoid this happening ?
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44114656
comment on: http://stackoverflow.com/a/27855641
type: AnswerComment
score: 0
has text: But the counter doesn't show up even when I remove that statement. The message should be seen for 1 second and than resume with the normal counter...
type: Comment

http://stackoverflow.com/comment/44268182
comment on: http://stackoverflow.com/q/27935495
type: QuestionComment
has text: what do you mean by enable, you want to make it writable?
score: 0
type: Comment

http://stackoverflow.com/a/27829163
score: 1
has body: Use a semi-colon, instead of a comma. avatarMenu = !avatarMenu; getMenuClick('clicked')
answers question: http://stackoverflow.com/q/27827974
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/44326381
score: 0
comment on: http://stackoverflow.com/q/27908986
type: Comment
type: QuestionComment
has text: This is a duplicate of http://stackoverflow.com/questions/27874519/ember-cli-authentication-with-node-server-and-social-logins/27966847#27966847

http://stackoverflow.com/q/27834946
upvote count: 3
tagged with: google-chrome-extension
tagged with: user-agent
downvote count: 0
answer count: 1
favorite count: 0
has title: Set user agent for HTTP request in Chrome extension
accepted answer: http://stackoverflow.com/a/27836989
linked to: http://stackoverflow.com/q/21090733
tagged with: xmlhttprequest
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/27836989
has body: I'm writing a Chrome extension in pure JavaScript and wish to change the user agent for HTTP requests to a given URL as the owner of that URL has requested that a user agent of a certain format be used. The following code works until the user agent modification line is added, at which point the Chrome inspector console give the error Refused to set unsafe header "User-Agent". var xhr = new XMLHttpRequest(); xhr.open("GET", serviceURL, true, username, password); xhr.setRequestHeader('User-Agent', 'MyExtensionName/0.0.1'); xhr.onreadystatechange = function() { // do some stuff } xhr.send(null); Why is it not possible to modify the user agent in this manner?
type: Question
tagged with: javascript
duplicate of: http://stackoverflow.com/q/21090733

http://stackoverflow.com/comment/44136288
has text: Have you tried calling UpdatePanel.Update(); to force it to update all child controls? Just as an FYI, have a look here: http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.updatemode%28v=vs.110%29.aspx You can change UpdateMode to `Always` or manually call the `Update` method on UpdatePanel control.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27866666
type: QuestionComment

http://stackoverflow.com/q/27856647
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27856972
has title: How to dynamically create a form using angularjs
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has body: I am trying to figure out how to dynamically create a form based on an array of fields returned from the server. Something like this [{ id: "title", type: "text", /* Map to Input type=text */ regex: "/^[a-zA-Z]+/" },{ id: "summary", type: "memo", /* Map to Textarea */ regex: "/^[a-zA-Z]+/" },{ id: "priority", type: "list", /* Map to Select */ options: [1,2,3,4,5] }] I cant figure out a nice way of doing this, even with ng-repeat. Once the form has about 30 fields, and 15+ different input types, it gets very ugly. Whats the 'Angular' way to do this, or should i generate the controller.js and template.html dynamically on the server?
answer count: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/27944541
accepted answer of: http://stackoverflow.com/q/27944289
has body: I created a jsfiddle Take a look. This might help you. $('a[href*=#]:not([href=#])').click(function () { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); First Second Third Fourth First Chapter Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu ante molestie dui vehicula finibus ac eget ante. Aliquam lacus mi,orci. Pellentesque nec lorem faucibus, tincidunt massa non, feugiat lacus. Pellentesque purus libero, efficitur ac finibus at, tincidunt vel ligula. Mauris consequat sit amet arcu in mollis. Quisque fermentum imperdiet justo dictum tempus. Curabitur elit tu Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu ante molestie dui vehicula finibus ac eget ante. Aliquam lacus mi,orci. Pellentesque nec lorem faucibus, tincidunt massa non, feugiat lacus. Pellentesque purus libero, efficitur ac finibus at, tincidunt vel ligula. Mauris consequat sit amet arcu in mollis. Quisque fermentum imperdiet justo dictum tempus. Curabitur elit tu Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu ante molestie dui vehicula finibus ac eget ante. Aliquam lacus mi,orci. Pellentesque nec lorem faucibus, tincidunt massa non, feugiat lacus. Pellentesque purus libero, efficitur ac finibus at, tincidunt vel ligula. Mauris consequat sit amet arcu in mollis. Quisque fermentum imperdiet justo dictum tempus. Curabitur elit tu Second Chapter Nam feugiat purus eu velit condimentum rhoncus. Proin pulvinar volutpat diam, id porta erat pharetra at. Mauris hendrerit nulla enim, et tempus urna placerat vitae. Integer ut ipsum tincidunt, sodales quam vitae, varius massa. Sed rhoncus arcu mi, in faucibus risus dictum vel. Cras id sollicitudin magna, quis tempor mi. In ultrices gravida qua…
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27944289

http://stackoverflow.com/a/27894883
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27894734
type: Answer
accepted answer of: http://stackoverflow.com/q/27894734
has body: Save the current time whenever you add a new ToDo: $scope.addTodo = function() { $scope.todos.push({'title':$scope.newTodo , date: new Date(), 'done':false}) .... }; Then if you want to show it in your views use the built in date filter in angular &lt;span&gt; &lt;/span&gt;
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/44067512
comment on: http://stackoverflow.com/q/27828233
has text: Thanks, @Steve. Which part of the code would go on the directive?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27826381
upvote count: 6
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/44058464
has comment: http://stackoverflow.com/comment/44094055
linked to: http://stackoverflow.com/q/8981064
accepted answer: http://stackoverflow.com/a/27826473
type: Question
possible better answer: http://stackoverflow.com/a/54467783
tagged with: javascript
has answer: http://stackoverflow.com/a/54467783
has body: Does Bootstrap offer anything for clearing form input fields via a button? Or do I need to roll my own through jquery? From this post jQuery Validate resetForm() doesn&#39;t reset the onFocus validation, there seems to be a resetForm() method coming from jquery but I always get a object doesn't support method when I try to access that method.
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27826473
has answer: http://stackoverflow.com/a/45752970
has title: Clearing form input fields in Bootstrap?
score: 6

http://stackoverflow.com/a/27899089
answers question: http://stackoverflow.com/q/27898769
type: Answer
has comment: http://stackoverflow.com/comment/44205969
downvote count: 0
score: 1
has body: the code in your example used UIAutomation test script from Apple. I think you should read some documents about it. Here is a tutorial of UIAutomation and a link to Apple document. http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/UsingtheAutomationInstrument/UsingtheAutomationInstrument.html
has comment: http://stackoverflow.com/comment/44205283
upvote count: 1

http://stackoverflow.com/a/27936701
type: AcceptedAnswer
downvote count: 0
has body: Modern browsers that support the HTML5 file stuff have in the &lt;input&gt; element a "files" property. That will give you a file list reference, which has a length property. As the property is already an array so you just need to access it or iterate through it. JS var input = document.getElementById('id'); console.log(input.files); for (var i = 0; i &lt; input.files.length; i++) { console.log(input.files[i]); }
type: Answer
answers question: http://stackoverflow.com/q/27936645
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/44270284
has comment: http://stackoverflow.com/comment/44270396
accepted answer of: http://stackoverflow.com/q/27936645
has comment: http://stackoverflow.com/comment/44270518

http://stackoverflow.com/comment/44141074
comment on: http://stackoverflow.com/q/27869181
has text: For debugging use the dev tool bars. All major browsers have those. You can bring it up by hitting F12. You can write to the console using `console.log(something)` this makes debugging a lot easier. Also you can put `debugger` in your code. Whenever the dev tool is active it will halt script execution and allow you to debug your code step by step.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27816085
accepted answer of: http://stackoverflow.com/q/27814405
has comment: http://stackoverflow.com/comment/44040549
score: 0
has comment: http://stackoverflow.com/comment/44039678
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44039685
type: Answer
has body: I'm using same library, the only thing different in my client side code is I have the method: 'POST' header being sent: $scope.upload = $upload.upload({ url: '/api/uploads', //upload.php script, node.js route, or servlet url // method: 'POST' or 'PUT', method: 'POST', // headers: {'header-key': 'header-value'}, // withCredentials: true, data: { type: 'profileImage' }, file: file//, // or list of files: $files for html5 only // fileName: 'doc.jpg' or ['1.jpg', '2.jpg', ...] // to modify the name of the file /* customize file formData name ('Content-Desposition'), server side file variable name. Default is 'file' */ //fileFormDataName: myFile, //or a list of names for multiple files (html5). /* customize how data is added to formData. See #40#issuecomment-28612000 for sample code */ //formDataAppender: function(formData, key, val){} }).progress(function (e) { console.log('percent: ' + parseInt(100.0 * e.loaded / e.total)); }).success(function (data, status, headers, config) { // file is uploaded successfully console.log(data); $scope.user.profileImages = data; $rootScope.$emit('message', { text: "Your profile image has been updated." }); }).error(function(data){ if ( data.error === 'UnsupportedFiletype' ) { $rootScope.$emit('message', { type: 'error', text: "Woops, we don't support that filetype." }); } }); Edit: The solution was to just properly serve a cors header: npm install cors and app.use(cors()).
has comment: http://stackoverflow.com/comment/44040464
has comment: http://stackoverflow.com/comment/44040009
has comment: http://stackoverflow.com/comment/44040056
answers question: http://stackoverflow.com/q/27814405

http://stackoverflow.com/a/27840534
score: 0
answers question: http://stackoverflow.com/q/27839057
has body: You can achieve it by changing your HTML markup to this; &lt;body id="body"&gt; &lt;/body&gt; Same code will work fine. Working Fiddle If you don't want to change HTML markup you can achieve it by getElementsByTagName as answered by @Bhojendra
type: Answer

http://stackoverflow.com/comment/65988481
comment on: http://stackoverflow.com/q/27832191
type: QuestionComment
has text: https://github.com/lukesnowden/FSVS/blob/master/js/fsvs.js#L630
score: 0
type: Comment

http://stackoverflow.com/comment/44202704
comment on: http://stackoverflow.com/q/27901038
score: 0
has text: javascript won't support lookbehind.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27877407
has body: I'm an AngularJS beginner. The issue: I have a select box, built from a JSON. When I select an option, I can display the selected item. But additionally, I would like to display additional information. My JSON looks like this [ { id : 1, name : "Notebooks", "products" : [ { id : 101, name : "Lenovo 123", "price" : 1299.9, "additionals" : [ { id : 10001, name : "4GB RAM", "price": 100 }, { id : 10002, name : "128GB SSD", "price" : 120 }, { id : 10003, name : "120GB SSD", "price" : 120 }, { id : 10004, name : "512GB SSD", "price" : 410 }, { id : 10005, name : "External HDD", "price" : 80 } ] }, { id : 102, name : "Asus 456", "price" : 1699.9, "additionals" : [ { id : 20001, name : "4GB RAM", "price": 100 }, { id : 20002, name : "256GB SSD", "price" : 140 }, { id : 20003, name : "i7 CPU", "price" : 150 }, { id : 20004, name : "512GB SSD", "price" : 440 }, { id : 20005, name : "Windows 8.1", "price" : 100 } ] }, { id : 103, name : "Macbook Pro", "price" : 1949.0, "additionals" : [ { id : 30001, name : "USB device", "price": 60 }, { id : 30002, name : "External HDD", "price" : 80 }, { id : 30003, name : "4GB RAM", "price" : 140 }, { id : 30004, name : "512GB SSD", "price" : 300 }, { id : 30005, name : "Mouse", "price" : 50 } ] } ] }, { id : 2, name : "TVs", "products" : [ { id : 501, name : "Samsung TV 1", "price": 959.9 }, { id : 502, name : "Sony TV 2", "price": 1409.9 }, { id : 503, name : "Philips TV 3", "price": 1899.9 } ] } ]; And my select box like this &lt;select id="product-selector" data-ng-model="product"&gt; &lt;option value="0"&gt;&lt;/option&gt; &lt;optgroup data-ng-repeat="s in stock" label="{{ s.name }}"&gt; &lt;option data-ng-repeat="p in s.products" value="{{ p.id }}"&gt;{{ p.name }}&lt;/option&gt; &lt;/optgroup&gt; &lt;/select&gt; Whatever I select, i wanna see more information like price, name, additionals, etc. How can I do this in AngularJS? Probably this is really easy, but I guess I am on the wrong path. I've tried multiple solutions, but none of …
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/44156430
favorite count: 0
upvote count: 1
has title: AngularJS: Get additional infos depending from the chosen option in select-box
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44156965
answer count: 0
downvote count: 0
tagged with: javascript
score: 1

http://stackoverflow.com/a/27854734
has body: For achieve this, u need first use some css reset, you can view the most famous css resets here: http://www.cssreset.com/ A CSS Reset is a short, often compressed (minified) set of CSS rules that resets the styling of all HTML elements to a consistent baseline. In case you didn't know, every browser has its own default 'user agent' stylesheet, that it uses to make unstyled websites appear more legible. Them, use the pre-fixes in properties that are not full supported: Android: -webkit- Chrome: -webkit- Firefox: -moz- Internet Explorer: -ms- iOS: -webkit- Opera: -o- Safari: -webkit- You can learn more about pre-fixes here: http://webdesign.about.com/od/css/a/css-vendor-prefixes.htm And you can also view if a property is fully supported by all the browsers here : http://caniuse.com/#
score: 0
answers question: http://stackoverflow.com/q/27854021
type: Answer

http://stackoverflow.com/q/27824086
tagged with: javascript
tagged with: jwplayer
has comment: http://stackoverflow.com/comment/44054277
has comment: http://stackoverflow.com/comment/44055196
upvote count: 1
has title: JWPlayer SWF Stopping error
favorite count: 0
type: UnansweredQuestion
downvote count: 0
has body: I am having an issue with my JWPlayer and getting the player to stop. The player is in a modal and I would like the video to stop playing once I close out of the video. I am doing that via javascript as shown here window.onload = function() { document.getElementById('close').addEventListener('click', function() { jwplayer('jwcontent').stop(); }); } I know that function is working because if I use a console.log there it does execute when I click the close button on the modal. The JWPlayer is working great other then that, it is jwplayer.version="5.7.1896". I've taken a look at the JWPlayer Javascript API but I can not get this to work. We initialize the JWPlayer like this: jwplayer("jwcontent").setup({flashplayer:"http://urlhere/jwplayer/player.swf",.....}); I am wondering if it is because they are using a flashplayer. As I said, the video and playlist works but I cannot get the stop method to work.
answer count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44063403
tagged with: flash

http://stackoverflow.com/a/27854632
type: Answer
answers question: http://stackoverflow.com/q/27853781
has body: I have tried like $('#profile_country').on('keypress',function(e1){ var cntry_key = e1.which; var cntry_key_code = e1.keyCode; if( (cntry_key_code == 0 &amp;&amp; cntry_key &gt; 0 &amp;&amp; !e1.ctrlKey) || (cntry_key == 0 &amp;&amp; cntry_key_code == 46) || (cntry_key == 8) || (e1.ctrlKey &amp;&amp; cntry_key == 120) || (e1.ctrlKey &amp;&amp; cntry_key == 118) || (e1.ctrlKey &amp;&amp; cntry_key == 86) || (e1.ctrlKey &amp;&amp; cntry_key == 88)) { $('#profile_pstate').val(''); } }); And it is working fine with Alpha-Numeric, Special characters, Space, Backspace and Delete and also control events like ctrl+A AND only works for cut(ctrl+x) and paste(ctrl+v).
score: 0

http://stackoverflow.com/q/27928695
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44301841
tagged with: ajax
has comment: http://stackoverflow.com/comment/44264961
has comment: http://stackoverflow.com/comment/44301862
type: UnansweredQuestion
answer count: 0
has title: jQuery: AJAX request fires multiple times until response is successfully using $.Deferreds
type: Question
has body: Problem! While trying to perform a set of AJAX request, most of the time at least one of the request is always getting a pending response, this is resulting in a loop of requests until it gets a succesful response. Please note that I using jQuery.when, this way I can ensure that both requests have been executed. The mentioned behaviour is resulting on: Multiple requests to the same source jQuery.always is executes as many times as requests performed The interface is crashing due to multiple updates on it's DOM. Example var request = []; request.push(getProductPrice().done( function(price) { updateProductPrice(price); } ); request.push(getProductInfo().done( function(information) { updateProductInformation(information); } ); jQuery.when.apply(undefined, request).always(function() { doSomeStuff1(); doSomeStuff2(); ... ... ... doSomeStuffN(); }); function updateProductPrice(obj) { return jQuery.get(...); } function updateProductInformation(obj) { return jQuery.get(...); } Questions? Is there any reason on why I am getting a pending response? Is this problem realted to jQuery.when trying to release the AJAX request in order to fire-up the callbacks? Facts If I do the request to the mentioned sources via synchronous, I will never get a pending response. I am just trying to avoid the use of async: false. Update #1 By pending status I meant the response given by the web browser to my request, which is nothing but the ajax call waiting for it's response. The main problem resides on how those AJAX request are being treated, I am noticing that the functions updateProdcutPrice() and updateProductInformation() are being called N times until the response from the server is succesful, this is resulting that the functions declared on the .always()'s callback for the requestes performed on updateProdcutPrice() and updateProductInformation() are also being called that many times.
tagged with: jquery-deferred

http://stackoverflow.com/q/27944816
has comment: http://stackoverflow.com/comment/44284922
has answer: http://stackoverflow.com/a/27944972
upvote count: 1
tagged with: signalr
downvote count: 1
type: Question
tagged with: c#
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/27944910
accepted answer: http://stackoverflow.com/a/27944972
has answer: http://stackoverflow.com/a/27944910
tagged with: asp.net
favorite count: 0
has title: What basic component am I missing from my signalR client?
has body: Following this tutorial: http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr I managed to implement a really, really simple signalr chat client. That is, a hub that broadcasts the message sent to it from javascript. Great, that works. But now I've tried to create a second project with the same index.html file and js (i.e. the code that sends the message), and I'm getting an undefined error. The only difference between the file when it was as the tutorial specifies and as I've done (in the 'remote' project), is that I've explicitly specified the connection.hub.url as I've been advised to from various posts. What exactly am I missing? It's obviously not enough to simply set the url to the other site hosting the signalr hub, do I need to add a proxy of some sort? Totally confused at this point. My javascript file (the javascript on the website without the hub): $(function () { var chat = $.connection.chatHub; $.connection.hub.url = "http://localhost:14113/signalr"; chat.client.broadcastMessage = function (name, message) { // Do something }; $.connection.hub.start().done(function () { $('#sendmessage').click(function () { chat.server.send($('#displayname').val(), $('#message').val()); }); }); }); It is on the first reference to the chat variable I have the undefined error. NOTE: I can confirm both sites are running, the hub is available as I can navigate to the other tab (the same index.html file in the original solution) and it functions as expected. I can also confirm the presence of my jQuery library (referenced correctly), and the jQuery signalR script (again, no 404s, all referenced correctly).
type: AnsweredQuestion

http://stackoverflow.com/a/27896932
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44194291
has body: Use regex replace, it should be like this: str.replace(/^\t+$/, '');
downvote count: 0
answers question: http://stackoverflow.com/q/27896895
accepted answer of: http://stackoverflow.com/q/27896895
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44194278
has comment: http://stackoverflow.com/comment/44194266

http://stackoverflow.com/comment/44096440
type: QuestionComment
has text: Please describe a little more background - what should this div do? Stay at the bottom of the screen until 2000px of scrolling, then...what? Stick to the page at its current position?
score: 2
type: Comment
comment on: http://stackoverflow.com/q/27846263

http://stackoverflow.com/comment/44211246
score: 0
comment on: http://stackoverflow.com/a/27906003
type: Comment
has text: @ShahidGhafoor The code in Quentin's answer doesn't. I can't think of a good reason to include jQuery, but not make use of its features.
type: AnswerComment

http://stackoverflow.com/q/27900035
has answer: http://stackoverflow.com/a/27900083
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27900083
has comment: http://stackoverflow.com/comment/44199873
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/27900078
favorite count: 0
score: 8
tagged with: angularjs
upvote count: 8
possible better answer: http://stackoverflow.com/a/27900078
has comment: http://stackoverflow.com/comment/44199698
type: AnsweredQuestion
has title: TypeError: Cannot read property 'concat' of undefined
has body: My problem is that when i run my project it gives me an error that says: TypeError: Cannot read property 'concat' of undefined. it does not display please help. app.js var Call24 = angular.module("Call24", ["ngResource", "ngRoute"]). config(function($routeProvider) { $routeProvider. when('/', { controller: ListCtrl, templateUrl: 'CycleModal.html' }). when('/edit/:editId', { controller: EditCtrl, templateUrl: 'details.html' }). otherwise({ redirectTo: '/' }); Call24.factory('cyclesFactory', function ($resource) { return $resource('/api/Cycles/:id', { id3: '@id3' }, { update: 'PUT' }); }); var ListCtrl = function ($scope, $location, data,$http) { $scope.selectTest = null; $scope.testTest = []; $scope.cycle = []; $http({ method: 'GET', url: '/api/Cycles/', data: { CycleID: 1 } }).success(function (result) { $scope.testTest = result; }); $scope.search = function() { data.query({ offset: $scope.offset, limit: $scope.limit }, function(something) { $scope.cycle = $scope.cycle.concat(something); }); }; $scope.search(); $scope.show_more = function() { $scope.offset += $scope.limit; $scope.search(); }; $scope.reset = function () { $scope.limit = 4; $scope.offset = 0; $scope.cycle = []; $scope.search(); } }; html Weeks in Cycle Cycle number Cycle Id Weeks In Cycle Cycle Number Start Date End Date {{liss.CycleID}} {{liss.WeeksInCycle}} {{liss.Cycle}} {{liss.StartDate}} {{liss.EndDate}} Ok Cancel I want to display the list from a table but it keeps giving the error i have shown above.
type: Question

http://stackoverflow.com/a/27875213
type: Answer
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: you can use jq .index() method: $('.normal-sort-table tr th.nosort').index()
accepted answer of: http://stackoverflow.com/q/27875173
answers question: http://stackoverflow.com/q/27875173
score: 1

http://stackoverflow.com/comment/44243120
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/27923102
has text: Hi, can you post the code as one piece?
type: Comment

http://stackoverflow.com/q/27849034
tagged with: arrays
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44102152
type: Question
has title: Remove duplicates from array directive
has comment: http://stackoverflow.com/comment/44102069
has body: I have a div which shoes the names. I want to remove the duplicates in my array. I have done this with filter, but i want to know how we can extend this to build a directive. &lt;div ng-controller="MainController"&gt; &lt;ul&gt; &lt;li ng-repeat="name in names | unique"&gt; {{name}} &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; Below is the filter code. angular.module('app') .controller('MainController', ['$scope', function($scope){ $scope.names = ['a','b','c','d','a','c']; }]) .filter('unique', function(){ return function(names){ var obj = {}; names.forEach(function(name){ obj[name] = null; }) return Object.keys(obj); } }) .directive('unique', function(){ return { link: function(scope, elem, attr){ } } }) How can i build a directive which removes duplicates from my array.
has comment: http://stackoverflow.com/comment/44102311
upvote count: 1
has answer: http://stackoverflow.com/a/27850958
answer count: 1
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/44102095
accepted answer: http://stackoverflow.com/a/27850958
has comment: http://stackoverflow.com/comment/44102139
linked to: http://stackoverflow.com/q/28035944
has comment: http://stackoverflow.com/comment/44102039
type: AnsweredQuestion

http://stackoverflow.com/comment/44224437
comment on: http://stackoverflow.com/q/27910775
type: Comment
type: QuestionComment
score: 0
has text: You could just have your route's `data` function call a `Session` variable for the `dataType`. Then just have your button change the `Session` value.

http://stackoverflow.com/q/27853211
score: 1
type: Question
answer count: 2
has body: I try to add coordinate to polyline but doesn't work But when i assign it by manual it's work. how to make its work by array. var lat=[13.698090113461573,13.72771754374393,13.732881766645967,13.737967711523885]; var lng=[100.75223565101624,100.74861466884613,100.69132804870605,100.56249350309372]; // HERE IT DOESN"T WORK var poly = new Array(); for (var j=0;j&lt;lat.length;j++){ var pos = new google.maps.LatLng(lat[0],lng[0]) poly.push(pos); } // HERE IT'S WORK var poly = [ new google.maps.LatLng(lat[0], lng[0]), new google.maps.LatLng(lat[1], lng[1]), new google.maps.LatLng(lat[2], lng[2]), new google.maps.LatLng(lat[3], lng[3]) ]; console.log(poly); var Path = new google.maps.Polyline({ path: poly, geodesic: true, strokeColor: '#ff004c', strokeOpacity: 1.0, strokeWeight: 5 }); Path.setMap(map);
tagged with: arrays
tagged with: javascript
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/27853306
has title: google map API can't set PolyLine from Array
favorite count: 0
upvote count: 2
possible better answer: http://stackoverflow.com/a/27853393
downvote count: 1
has answer: http://stackoverflow.com/a/27853393
accepted answer: http://stackoverflow.com/a/27853306
type: AnsweredQuestion

http://stackoverflow.com/comment/44185565
type: QuestionComment
comment on: http://stackoverflow.com/q/27892165
type: Comment
score: 1
has text: either pass `this` into function as argument in html and `$(arg).data()` or switch and use jQuery handler instead. Very simple to prove my point ..in your function `console.log(this)`

http://stackoverflow.com/comment/44227068
has text: Oh man, was it actually the operators lol :P haven't done java/javascript for a few months and I still only know the very basic so I had totally forgot that ..... Thanks alot!!!! In my html dont I need to set ` ` for it to work and therefore need a name?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27913854

http://stackoverflow.com/q/27869655
favorite count: 0
type: Question
score: -9
has title: Javascript - function declaration flavours
has answer: http://stackoverflow.com/a/27869747
has comment: http://stackoverflow.com/comment/44141766
answer count: 3
upvote count: 1
downvote count: 10
tagged with: function
has comment: http://stackoverflow.com/comment/44141895
has answer: http://stackoverflow.com/a/27869823
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44141797
has body: There are a couple of ways to declare a function in Javascript. There are 2 ways which I could not understand as to why they are used for. Please see below for the 2 declarations. var G = new function(){}; // special case: object constructor AND var C = (function(){}); // function expression with grouping operators. Answers in fiddle would be very helpful.
has answer: http://stackoverflow.com/a/27870535

http://stackoverflow.com/comment/44188940
score: 0
type: AnswerComment
has text: @AleksandrAleksandrov Yes it does. See this simplified example: http://jsfiddle.net/41obcvys/1/ It prints 2 console messages then stops. Your conditional might not be testing what you think it is.
type: Comment
comment on: http://stackoverflow.com/a/27893757

http://stackoverflow.com/q/27874880
has answer: http://stackoverflow.com/a/38144485
accepted answer: http://stackoverflow.com/a/38144485
has comment: http://stackoverflow.com/comment/44532288
has title: How to cast property in nested objects to ObjectId with loopback and mongodb?
tagged with: mongodb
has body: Let's say I have the following model definition: { "name": "Report", "idInjection": true, "trackChanges": true, "mongodb": { "collection": "report" }, "properties": { "resource" : {"type": "String"}, "date" : {"type": "Date"}, "people" : [ { // Here's where I like to have an id property. "role" : {"type": "String"}, "hours" : {"type": "Number"} } ], "name" : {"type": "String"} }, "validations": [], "relations": {}, "acls": [], "methods": [] } Now I want to have id property in each object in people array(to be accessed with like report.people[0].id) and it should be casted to ObjectId on inserts and updates. But well, loopback doesn't have an ObjectId type and the only way seems to be using relations but then how should the foreign key be? Is there any way to have the id property casted to ObjectId on inserts and updates? Update: I tried using embedsMany, but the id wasn't converted: Here's my report.json: { "name": "Report", "base": "PersistedModel", "idInjection": true, "properties": { "name": { "type": "string", "required": true } }, "validations": [], "relations": { "people" : { "type": "embedsMany", "model": "ReportPerson", "options": { "validate": true, "autoId": false } } }, "acls": [], "methods": [] } and here's my report-person.json: { "name": "ReportPerson", "base": "Model", "idInjection": true, "properties": { "hours": {"type" : "number"} }, "validations": [{ "person" : { "model": "Person", "type": "belongsTo", "foreignKey": "id" } }], "relations": {}, "acls": [], "methods": [] } When I try to insert this Report using the http API: { "name" : "report", "people" : [ { "id" : "54c7926e1d621dc65495f069", "hours" : 2 } ] } The id wouldn't be casted to ObjectId and stays as string on the database.
tagged with: casting
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/61141583
tagged with: javascript
favorite count: 0
tagged with: loopbackjs
tagged with: node.js
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/44712945
type: Question

http://stackoverflow.com/a/27832018
accepted answer of: http://stackoverflow.com/q/27831670
has comment: http://stackoverflow.com/comment/44102920
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44092604
has comment: http://stackoverflow.com/comment/44079537
type: Answer
upvote count: 4
has body: try this Sorry, small correction in order to make the animation smoother: fiddle code - live example CSS: .row-fluid { overflow:hidden; } .row-fluid div { -webkit-transition: width 0.3s ease, margin 0.3s ease, padding 0.3s ease; -moz-transition: width 0.3s ease, margin 0.3s ease, padding 0.3s ease; -o-transition: width 0.3s ease, margin 0.3s ease, padding 0.3s ease; transition: width 0.3s ease, margin 0.3s ease, padding 0.3s ease; } #col1 { background-color: #A6BFBA; } #col2 { background-color: #DE4124; } #trig { margin: 50px; } .row-fluid .col-0 + [class*="col"]{ margin-left: 0; } .offcanvas { margin-left:0; } @media all and (max-width:768px) { .col-0 { width:0; padding:0; overflow:hidden; float:left; display:none; } .offcanvas { margin-left:-25%; } } jQuery: $(document).ready(function() { $('#trig').on('click', function () { $('#col1').toggleClass('offcanvas'); $('#col2').toggleClass('col-xs-12 col-xs-9'); }); }); UPDATE: @media all and (max-width:768px) { .col-0 { width:0; padding:0; overflow:hidden; float:left; display:none; } .offcanvas { margin-left:-25%; height:0px; opacity:0; } } UPDATE #2 if you want to animate sidebar height&amp;opacity change this code too: .row-fluid div { -webkit-transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease; -moz-transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease; -o-transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease; transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease; }
has comment: http://stackoverflow.com/comment/44087031
downvote count: 0
has comment: http://stackoverflow.com/comment/44095054
answers question: http://stackoverflow.com/q/27831670
has comment: http://stackoverflow.com/comment/44094148
score: 4

http://stackoverflow.com/a/27846009
has body: Try this {{transaction.transLocale}} {{user.name}} {{transaction.transDate}} {{transaction.transTime}} {{transaction.transAmount}} {{transaction.transType}} {{transaction.directObject}} Script: app.controller('IndexController', function(){ $scope.users = userHistory; });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27845670

http://stackoverflow.com/a/27807891
has body: This has been done in other projects as well like the meteor-blog package. They setup an editor file here: https://github.com/Differential/meteor-blog/blob/master/client/views/admin/editor.coffee And then the corresponding edit functionality in here: https://github.com/Differential/meteor-blog/blob/master/client/views/admin/edit.coffee So, based on those, you should be able to see how the medium-editor plugin can be used in Meteor projects.
score: 2
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/27807762

http://stackoverflow.com/comment/44186572
type: Comment
type: QuestionComment
has text: Sure, I'll write an answer. :)
comment on: http://stackoverflow.com/q/27892657
score: 0

http://stackoverflow.com/comment/44099799
has text: @Karthik - Thought about doing this, but I wanted to know if there was a more "preferred" method of doing this.
comment on: http://stackoverflow.com/q/27847847
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27869083
has answer: http://stackoverflow.com/a/27954789
linked to: http://stackoverflow.com/q/27285074
has title: Ember CLI Live Reload Not Working
has comment: http://stackoverflow.com/comment/44140642
downvote count: 0
tagged with: javascript
has body: I've seen other similar questions here and here but neither of those worked for me. I'm on a mac and simply installed ember cli using npm and I thought it would work out of the box. Here is the server output: version: 0.1.4 Could not find watchman, falling back to NodeWatcher for file system events Livereload server on port 35729 Serving on http://0.0.0.0:4200/ Build successful - 2456ms. Slowest Trees | Total -------------------------------+---------------- EsnextFilter | 877ms TreeMerger | 380ms Concat | 375ms JSHint - Tests | 178ms EsnextFilter | 146ms ES6Concatenator | 135ms
favorite count: 0
accepted answer: http://stackoverflow.com/a/27954789
linked to: http://stackoverflow.com/q/25439380
has answer: http://stackoverflow.com/a/37865547
tagged with: ember.js
answer count: 4
tagged with: ember-cli
upvote count: 11
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27869255
tagged with: livereload
has answer: http://stackoverflow.com/a/27869255
score: 11
has answer: http://stackoverflow.com/a/38408895
has comment: http://stackoverflow.com/comment/44140782
type: Question

http://stackoverflow.com/a/27923214
downvote count: 0
type: AcceptedAnswer
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/27922692
upvote count: 1
answers question: http://stackoverflow.com/q/27922692
has body: Are you sure that your webserver setup has been configured to handle the POST verb? By default it should be setup for both GET and POST requests but it may have been changed at some point. Below are some steps to check: IIS: http://www.asp.net/web-api/overview/testing-and-debugging/troubleshooting-http-405-errors-after-publishing-web-api-applications IIS Express: Look in the applicationHost.config file in %userprofile%\documents\IISExpress\config folder. Check that the ExtensionlessUrl-Integrated-4.0 handler is configured something like this verb="GET,HEAD,POST,DEBUG,PUT,DELETE

http://stackoverflow.com/comment/44256043
has text: You made a modification to the documentHtml method that shouldn't have been done (using your own class) you should use the built-in one so that you can properly select the target elements later.
comment on: http://stackoverflow.com/q/27914450
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27918187
type: Answer
has comment: http://stackoverflow.com/comment/101311387
has comment: http://stackoverflow.com/comment/44236325
has comment: http://stackoverflow.com/comment/44235676
has comment: http://stackoverflow.com/comment/44236210
accepted answer of: http://stackoverflow.com/q/27917430
has body: Your problem is quite a simple one. JavaScript will run one statement after another (and you need this because you want all statements executed when grabbing the image) as long as you dont attach to any events. If you attach your code to an event (image.onload for example) this part of your code will wait for the event and the rest of your code will continue asynchronous. So you are right - the image isn't drawn when you try to grab this. Its bad style to solve it by a timeout (most inefficient/insecure) better solve this by wrapping your image-grabbing code in a function and run this function after your image re-size is done. It's like a callback you use to synchronize the asynchronous event. Example /* setTimeout will behave like an event */ setTimeout( function(){ $('console').append(" SetTimeout "); SynchCodeAfterTimeout(); }, 1000); AsynchCodeAfterTimeout(); function AsynchCodeAfterTimeout(){ $('console').append(" AsynchCodeAfterTimeout "); } function SynchCodeAfterTimeout(){ $('console').append(" SynchCodeAfterTimeout "); } console{ font-family: Consolas, monaco, monospace; } Example with your code render(); // Resizeimage service logic function render() { var image = new Image(); image.onload = function() { var canvas = document.getElementById('canvas'); //check the greater out of width and height if (image.height > image.width) { image.width *= 945 / image.height; image.height = 945; } else { image.height *= 945 / image.width; image.width = 945; } //draw (&resize) image to canvas var ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); canvas.width = image.width; canvas.height = image.height; ctx.drawImage(image, 0, 0, image.width, image.height); /*timeout not needed its just there so the browser renders the canvas contents so you can see them when the alert pops up*/ setTimeout(function() { alert('yey all the drawing is done (this is synchronous)'); }); }; image.src = 'https://loremflickr.com/320/240'; }
upvote count: 3
answers question: http://stackoverflow.com/q/27917430
has comment: http://stackoverflow.com/comment/44270077
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/79872668
score: 3

http://stackoverflow.com/q/27902737
has body: I want to use the accordion on my site, however I'd prefer to use it over javascript plugin rather than html markup. I would like to have two buttons which open different content, however make only one visible at a time. After reading the documentation I figured that if they have the same parent selector it would work. Could anyone take a look at this fiddle and tell me where do I go from here? http://jsfiddle.net/krasnoludojad/q7962oxp/ HTML MENU LOGIN BLOG Lorem ipsum. JS $('#btn-collapse-menu').on('click', function(){ $('#navbar-collapse-menu').collapse('toggle', { parent: "#accordion" }); }); $('#btn-collapse-login').on('click', function(){ $('#navbar-collapse-login').collapse('toggle', { parent: "#accordion" }); }); UPDATE Well I've come up with a temporary solution, which I'm not that happy about so I would still appreciate the answer to mechanics behind working this out with parent option. For now I've patched with javascript by checking if the class .in exists that comes when the field is being shown $('#btn-collapse-menu').on('click', function(){ $('#navbar-collapse-login').hasClass('in') ? $('#navbar-collapse-login').collapse('hide') : null; $('#navbar-collapse-menu').collapse('toggle'); }); $('#btn-collapse-login').on('click', function(){ $('#navbar-collapse-menu').hasClass('in') ? $('#navbar-collapse-menu').collapse('hide') : null; $('#navbar-collapse-login').collapse('toggle'); });
has answer: http://stackoverflow.com/a/27905192
answer count: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/27905192
downvote count: 0
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
score: 1
favorite count: 0
tagged with: accordion
has title: Invoke Bootstrap Accordion via JavaScript
type: Question
tagged with: twitter-bootstrap

meteor-helper
tag name: meteor-helper
tags question: http://stackoverflow.com/q/27897142
tags question: http://stackoverflow.com/q/27923733
type: Tag

http://stackoverflow.com/comment/44051589
score: 0
type: AnswerComment
has text: Are you saying the field's required status changes dynamically? Sometimes it's required, other times it's not? If so, what is the condition where the field is required?
type: Comment
comment on: http://stackoverflow.com/a/27810846

http://stackoverflow.com/comment/50735553
comment on: http://stackoverflow.com/a/28055399
has text: you can validate your answer
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27866227
downvote count: 0
has body: A less stateful / more functional solution might be something like this: function findInString(string, pattern) { return string.split('').filter(function (element) { return element.match(pattern) }) } Takes in a string to search through and regex literal, returns an array of the matched elements. So, for example: var foo = '123asfasff111f6'; findInString(foo, /\d/g) will return [ '1', '2', '3', '1', '1', '1', '6' ], which seems to be what you're looking for(?).(at least, based on the below) e.g. Regex /(1)(2)(3)/g string 123 expected result ['1','2','3'] You can pass in whatever regex literal you want and it should act on every item in the array and return it if matched. I'd go with something like this if you want to easily be able to reason about state/might have to re-use it later to match a different pattern. The question was a little fuzzy for me, so your exact needs might be slightly different -- tried to go off what your expected inputs and outputs were.
score: 1
answers question: http://stackoverflow.com/q/27865682
upvote count: 1
type: Answer

http://stackoverflow.com/q/27848702
has answer: http://stackoverflow.com/a/27849055
has comment: http://stackoverflow.com/comment/44101732
has comment: http://stackoverflow.com/comment/44101588
accepted answer: http://stackoverflow.com/a/27848942
has answer: http://stackoverflow.com/a/27849201
tagged with: javascript
has body: I am trying to run a piece of javascript after the page loads: protected void Page_LoadComplete(object sender, EventArgs e) { if (IsPostBack) { string controlName = getPostBackControlName(); if (controlName == "btnSubmit" || controlName == "ddlSalary") { Page.ClientScript.RegisterStartupScript(GetType(), "myAlertScript", "onLoadDisplay(this)", true); } } } Here is the referenced javascript: function onLoadDisplay(sender) { PerDiemClicked(sender); } function PerDiemClicked(sender) { if (document.getElementById('&lt;%= chkbxPerDiem.ClientID %&gt;').checked == true) { document.getElementById("PerDiemDisplay").style.display = 'inline'; } else { document.getElementById("PerDiemDisplay").style.display = 'none'; } } I'm getting this error: 0x800a138f - JavaScript runtime error: Unable to get property 'checked' of undefined or null reference I dont understand why the checked is coming back null because I am waiting for the page to complete postback before checking. How do I check this control and run the above code correctly? edit: here is the checkbox: &lt;asp:CheckBox ID="chkbxPerDiem" runat="server" Checked="false" onclick="PerDiemClicked(this)" /&gt;
tagged with: asp.net
favorite count: 0
linked to: http://stackoverflow.com/q/14028959
has comment: http://stackoverflow.com/comment/44101635
has comment: http://stackoverflow.com/comment/44101325
answer count: 3
has comment: http://stackoverflow.com/comment/44101465
upvote count: 2
has answer: http://stackoverflow.com/a/27848942
has comment: http://stackoverflow.com/comment/44101607
has comment: http://stackoverflow.com/comment/44101359
downvote count: 1
type: AnsweredQuestion
has title: Null reference from control after page loads
tagged with: c#
has comment: http://stackoverflow.com/comment/44101626
score: 1
has comment: http://stackoverflow.com/comment/44101492
has comment: http://stackoverflow.com/comment/44101396
possible better answer: http://stackoverflow.com/a/27849055
has comment: http://stackoverflow.com/comment/44101339
type: Question

http://stackoverflow.com/q/27941135
has comment: http://stackoverflow.com/comment/44278848
type: UnansweredQuestion
has title: concatenate multiple webm video in browser
has comment: http://stackoverflow.com/comment/44278896
answer count: 0
has comment: http://stackoverflow.com/comment/44278194
type: Question
tagged with: javascript
tagged with: html5-video
has body: I'm a noob who's trying to concatenate multiple videos. My meteor webapp download multiple videos of 2s each via http. I would like to play theese videos one after another, without the user noticing they are separate videos. Is it possible with html5 and JS?
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44038555
type: Comment
score: 0
has text: @Owumaro yes, that is probably better - instead of taking a `callback` return the promise this returns and hook on it from the outside. If you're already using Bluebird there is no point in calling `nodeify` except for exposing things to outside APIs.
comment on: http://stackoverflow.com/a/27815451
type: AnswerComment

http://stackoverflow.com/a/27905249
answers question: http://stackoverflow.com/q/27904323
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27904323
has comment: http://stackoverflow.com/comment/44211155
has comment: http://stackoverflow.com/comment/44238067
has comment: http://stackoverflow.com/comment/44209889
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44247692
has body: It looks like you modified my plugin here - http://www.pluginsbyethan.com/newsticker6.html This plugin was originally written in Flash, so the JS version falls back to the Flash version like so: }, 'newsticker.swf'); You removed the swf in the quotes, but now the JS plugin is trying to fall back to a swf file that doesn't exist: }, ''); Also, in Flash mode, the player has a wrapper id added to it. Here is some updated code that doesn't have any sort of Flash fallback, which seems to work: (function(jwplayer) { var template = function(player, config, ticker) { function setup(evt) { if (player.getRenderingMode() == "html5") { var theBody = document.getElementById(player.id); } else { var theBody = document.getElementById(player.id + "_wrapper"); } var playerWidthPX2 = player.getHeight(); var playerWidthPX = parseFloat(playerWidthPX2); var playerHeightPX2 = player.getWidth(); var playerHeightPX = parseFloat(playerHeightPX2); var ticker_top = document.createElement("div"); var ticker_top_marquee = document.createElement("marquee"); var ticker_middle = document.createElement("div"); var ticker_middle_marquee = document.createElement("marquee"); var ticker_middle_date = document.createElement("div"); // top ticker_top.setAttribute("id", "ticker_top"); ticker_top.style.background = "#e3bfa3"; ticker_top.style.height = 26 + "px"; ticker_top.style.width = "100%"; ticker_top.style.position = "absolute"; ticker_top.style.zIndex = "1"; ticker_top.style.bottom = "25px"; ticker_top.style.opacity = "1"; ticker_top.style.visibility = "hidden"; // Marquee too ticker_middle ticker_top_marquee.setAttribute("id", "ticker_top_marquee"); ticker_top_marquee.style.color = "#000000"; ticker_top_marquee.innerHTML = config.ticker1; ticker_top_marquee.setAttribute("scrollamount", "6"); ticker_top_marquee.setAttribute("direction", "left"); ticker_top_marquee.style.fontSize = "18px"; ticker_top_marquee.style.fontWeight = "600"; ticker_top_marquee.style.textTransform = "uppercase"; ticker_top_mar…
has comment: http://stackoverflow.com/comment/44285718
downvote count: 0
has comment: http://stackoverflow.com/comment/44213052

http://stackoverflow.com/comment/86334122
type: Comment
has text: @Hitesh You wouldn't want to run through all your inputs at 1 time with any single function. You should do file processing each time a file is added to the input. You could add listeners to each input & have it all point to the same function-that would be the same thing as your jQuery, but it is still processing it one at a time, per change event. The code in this answer is correct for all but IE simply because IE doesn't like `event.target` - you need something like `if (window.navigator.userAgent.indexOf("MSIE ") > 0) { var files = event.srcElement.files; var name = files[0].name; }`
comment on: http://stackoverflow.com/a/27899130
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44035068
type: AnswerComment
type: Comment
has text: Supply a description and this answer would be perfect.
score: 1
comment on: http://stackoverflow.com/a/27814078

http://stackoverflow.com/a/45162557
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27960841
score: 2
has body: Putting control like (event.keyCode == 13 || event.keyCode == 17 || event.keyCode == 74) won't fix problem. Because if barcode value has 'J' character in it, you wont be able to get barcode result truely. We try to add e.ctrlKey control extra. But this time we retrieve only one character from barcode. It seems that solving problem via js is hard. Maybe the best option is changing scanner settings.
upvote count: 2

http://stackoverflow.com/comment/44131802
type: QuestionComment
has text: Thanks. Yes Ali, my preference would be to not have this sensitive information stored/cached in browser memory (by JS) when the user closes the window. This is specifically what I need to understand. I'm aware, as the answer below by Dheeraj suggests, that form input data may be retrieved using the autocomplete feature on browsers
comment on: http://stackoverflow.com/q/27864233
score: 0
type: Comment

http://stackoverflow.com/a/27898255
type: AcceptedAnswer
downvote count: 0
has body: Have you read the section about FormData in the article that you've linked? Because that is the best solution for sending files via the XMLHttpRequest API. The advantage of this API over string concatenation is that files can be uploaded in a streamed fashion, instead of having to be entirely being buffered in memory before being sent off. Assuming that zipBinary is a Blob or File object, you can upload a file as follows: function sendData(zipBinary) { var xhr = new XMLHttpRequest(); var fd = new Formdata(); fd.append('hello.zip', zipBinary); xhr.onload = function() { // Request completed! Use xhr.status and/or xhr.responseText to // check the server's response status code and response body. }; xhr.onerror = function() { // Aw. Network error. }; xhr.open('POST', 'https://example.com/'); xhr.send(fd); } If zipBinary is not a Blob or File object, but a string of binary data, then you can convert it to a Blob with a specified MIME-type as follows: function sendData(zipBinary) { var zipBinaryBytes = new Uint8Array(zipBinary.length); for (var i = 0; i &lt; zipBinary.length; ++i) { zipBinaryBytes[i] = zipBinary.charCodeAt(i); } zipBinary = new Blob([zipBinaryBytes], { type: 'application/zip' }); // rest of code as I suggested above... (note: application/zip is the official MIME-type for zip files, not application/x-zip-compressed) If you are an expert of the HTTP protocol and really want to write the HTTP request body fully by hand, then you need to send a typed array instead of a string, because the XMLHttpRequest API will encode a regular string as UTF-8 before passing off the data to the server. This can be done using the TextEncoder API since Chrome 38+, applied to your code as follows: // Was: XHR.send(prefix + zipBinary + postfix); // New XHR.send(new TextEncoder().encode(prefix + zipBinary + postfix)); Note: You rarely need to construct the request body by hand. Unless you know what you're doing, having to manually construct the request body is usually an indicator…
type: Answer
accepted answer of: http://stackoverflow.com/q/27897836
score: 2
answers question: http://stackoverflow.com/q/27897836
upvote count: 2

http://stackoverflow.com/comment/44072131
type: Comment
has text: Are you simply accessing this file from your filesystem with your browser? you could be running into [same origin policy](https://developer.mozilla.org/en-US/docs/Same-origin_policy_for_file:_URIs). Loading html from the filesystem has very restrictive policies for how linked scripts are executed. I'd suggest setting up a local testing webserver.
comment on: http://stackoverflow.com/a/27833146
score: 1
type: AnswerComment

http://stackoverflow.com/a/27850998
has comment: http://stackoverflow.com/comment/44106290
upvote count: 10
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44106373
downvote count: 0
score: 10
accepted answer of: http://stackoverflow.com/q/27848492
answers question: http://stackoverflow.com/q/27848492
type: Answer
has body: You can't include a populated field in your query because populate is executed as a separate query after the initial query completes. One way to efficiently perform this type of query is to first look up the ids of the users of the selected country and then query for the posts from those users. // Get the _ids of the users of the selected country. User.find({country: country}, {_id: 1}, function(err, users) { // Map the user docs into an array of just the _ids var ids = users.map(function(user) { return user._id; }); // Get the posts whose _creator is in that set of ids Post.find({_creator: {$in: ids}}).populate('_creator').exec(function(err, posts) { // posts contains your answer }); });

http://stackoverflow.com/a/73006713
has comment: http://stackoverflow.com/comment/128993307
type: Answer
has comment: http://stackoverflow.com/comment/129009636
answers question: http://stackoverflow.com/q/27934238
score: 5
downvote count: 0
upvote count: 5
has body: Here is a solution the boils down to two steps: Use built-in APIs to parse a raw HTML string into an HTML Element Recursively transform an Element object (and its children) into ReactElement objects. Note: this is a good example for learning. But consider the options described in the other answers, like the html-to-react library. Characteristics of this solution: It does not use dangerouslySetInnerHTML It uses React.createElement Runnable example repository. Here is the .jsx code: // RawHtmlToReactExample.jsx import React from "react"; /** * Turn a raw string representing HTML code into an HTML 'Element' object. * * This uses the technique described by this StackOverflow answer: https://stackoverflow.com/a/35385518 * Note: this only supports HTML that describes a single top-level element. See the linked post for more options. * * @param {String} rawHtml A raw string representing HTML code * @return {Element} an HTML element */ function htmlStringToElement(rawHtml) { const template = document.createElement('template'); rawHtml = rawHtml.trim(); template.innerHTML = rawHtml; return template.content.firstChild; } /** * Turn an HTML element into a React element. * * This uses a recursive algorithm. For illustrative purposes it logs to the console. * * @param {Element} el * @return {ReactElement} (or a string in the case of text nodes?) */ function elementToReact(el) { const tagName = el.tagName?.toLowerCase(); // Note: 'React.createElement' prefers lowercase tag names for HTML elements. const descriptor = tagName ?? el.nodeName; const childNodes = Array.from(el.childNodes); if (childNodes.length > 0) { console.log(`This element ('${descriptor}') has child nodes. Let's transform them now.`); const childReactElements = childNodes.map(childNode => elementToReact(childNode)).filter(el => { // In the edge case that we found an unsupported node type, we'll just filter it out. return el !== null }); return React.createElement(tagName, null, ...childReactElements); } else { // …

http://stackoverflow.com/comment/44199144
has text: @AbhiDhadve This link will clear your doubts.. http://stackoverflow.com/questions/3966936/method-method-in-crockfords-book-javascript-the-good-parts . Also if mine answer helped you, accept it as answer.. ;)
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27897432
type: Comment

http://stackoverflow.com/comment/44175368
type: QuestionComment
type: Comment
has text: I don't find anything wrong except the same ID provided which considerably a bad practice. I don't get exactly though what is the problem you are facing.
score: 0
comment on: http://stackoverflow.com/q/27886845

http://stackoverflow.com/comment/44211570
has text: Can you avoid roundtripping the data to the client entirely, instead keep the data on the server and point the `object` at a different URL which uses an ID to look up the data and invoke the html2canvas functionality
comment on: http://stackoverflow.com/q/27905106
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44093388
has text: Btw, i dont think this is an ExternalInterface thing. I can get the whole log out of the swf fine, and then a normal console.log/error from js results in the same truncation.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27844407
type: Comment

http://stackoverflow.com/a/27887962
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27887933
has body: This is the jQuery syntax. $(window).height(); You will need to include jQuery or use the native JavaScript version: window.innerHeight; In order to use jQuery, you will need to include the jQuery library
has comment: http://stackoverflow.com/comment/44176862
has comment: http://stackoverflow.com/comment/44176893

http://stackoverflow.com/q/27902918
downvote count: 0
tagged with: javascript
tagged with: ckeditor
has body: Is it possible to change the look of Ckeditor's toolbar so it can look like Redactor's toolbar. I want to make this change because all skins that are available on Ckeditor acquire more space and give a 90's look. On the other hand; Redactor's flat toolbar looks amazing and it acquire less space which ultimately satisfy the demand of large group of young generation.
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
has title: Change the look of Ckeditor's toolbar to look like Redactor's toolbar?

http://stackoverflow.com/comment/44151711
type: Comment
comment on: http://stackoverflow.com/a/27874807
type: AnswerComment
has text: But then let's say I wanted to pause it after I clicked the play. Am I able to pause it?
score: 0

http://stackoverflow.com/comment/44454355
score: 0
type: AnswerComment
has text: About what @dandavis asked. A functions side effects can persist for longer than the function itself? Also does javascript have anyway to check when something has finished executing?
type: Comment
comment on: http://stackoverflow.com/a/27850243

http://stackoverflow.com/comment/44302471
type: QuestionComment
has text: @PSL I cleared up the formatting.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27953553

http://stackoverflow.com/a/27874200
has comment: http://stackoverflow.com/comment/44150891
upvote count: 4
score: 4
answers question: http://stackoverflow.com/q/27874174
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27874174
has comment: http://stackoverflow.com/comment/44150308
has body: You need to return the promise such that you could chain with .then: myService.slowService(myName) .then(function(result){ return myService.slowService2(result); }) .then(function(result){ myService.fastService(result); });
has comment: http://stackoverflow.com/comment/44150848
type: Answer
has comment: http://stackoverflow.com/comment/44150511

http://stackoverflow.com/comment/44298557
type: QuestionComment
comment on: http://stackoverflow.com/q/27950539
type: Comment
has text: possible duplicate of [How do I split a string, breaking at a particular character?](http://stackoverflow.com/questions/96428/how-do-i-split-a-string-breaking-at-a-particular-character)
score: 0

http://stackoverflow.com/comment/44245538
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27923906
type: Comment
has text: I will check that and see :)

http://stackoverflow.com/q/27923280
type: AnsweredQuestion
tagged with: object
has title: Get JSON-Object Name as String in JavaScript
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/27923398
type: Question
answer count: 1
tagged with: javascript
tagged with: string
has answer: http://stackoverflow.com/a/27923398
score: 0
has body: How do I get the object muxEnviroments as String? I want to analyze and compare to check what type of content I have to expect. console.log(obj) shows me the whole object. My goal is something like that: jsonObjectName = obj; if(jsonObjectName =='muxEnviroments'){do the stuff...} But how to get the Name 'muxEnviroments' as string? { "muxEnviroments": [ { "primaryTransmitterName": "sfu5", "primaryTransmitterIp": "10.7.50.1" }, { "primaryTransmitterName": "sfu1", "primaryTransmitterIp": "10.7.50.4" } ] }

http://stackoverflow.com/a/27909789
score: 3
downvote count: 0
has body: You fetch the value of the player's score and save it in the "playerScore" variable. However, you don't update that value afterwards, so when you hit the console.log() statement later it still has its original value. Change the console.log call so that it logs the result of calling .getScore() on the player. console.log(player.name + "'s current score is: " + player.getScore());
type: Answer
answers question: http://stackoverflow.com/q/27909707
upvote count: 3

http://stackoverflow.com/q/27862506
has answer: http://stackoverflow.com/a/27871873
tagged with: php
possible better answer: http://stackoverflow.com/a/27871873
type: AnsweredQuestion
has body: How do I add new PHP lib from Mixpanel Analytics to Magento. Here is the actual link to the library: https://mixpanel.com/help/reference/php Inside the github file I've downloaded there is a folder called lib, which I have renamed to Mixpanel and placed it within /lib folder in Magento - but will Magento autoload this or do I need to add a line of code such as: require_once(Mage::getBaseDir('lib') . '/Mixpanel/MixpanelBase.php'); Part II Now I need to import the data from the database for every event I have. See the DEMO: http://mpdocs.s3.amazonaws.com/import-old-signup-events-demo.php In my file I have got the following: class Mixpanel_Model_Observer extends Mage_Core_Model_Abstract { public $token; public $api_key; public $host = 'http://api.mixpanel.com/'; public function __construct($token_string,$api_key) { $this-&gt;token = Mage::getStoreConfig('mixpanel_options/settings/mixpanel_token'); $this-&gt;api_key = Mage::getStoreConfig('mixpanel_options/settings/mixpanel_api_key'); } public function track($event, $properties = array()) { $params = array( 'event' =&gt; $event, 'properties' =&gt; $properties ); if (!isset($params['properties']['token'])){ $params['properties']['token'] = $this-&gt;token; } $url = $this-&gt;host . 'import/?data=' . base64_encode(json_encode($params)) . "&amp;api_key=$this-&gt;api_key"; exec("curl '" . $url . "' &gt;/dev/null 2&gt;&amp;1 &amp;"); } } Now I am not sure how to use this code to make it work with what I already have, and can this code run for all events or will I need to create this for all individual functions (instead of birthday I want to get data for login): $metrics = new EventImporter("TOKEN_HERE","API_KEY_HERE"); foreach($users as $id=&gt;$birthdate){ $props = array(); $props['distinct_id'] = $id; //distinct_id should be your identifier $props['time'] = strtotime($birthdate); //time should be their $birthdate $event = '$signup'; //you are sending the $signup event. You could also put $born here. echo "\nSending $event…
tagged with: mixpanel
accepted answer: http://stackoverflow.com/a/27871922
score: 0
type: Question
has title: Magento Mixpanel PHP Library
tagged with: magento
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/27871922

http://stackoverflow.com/comment/44283748
type: AnswerComment
comment on: http://stackoverflow.com/a/27943920
score: 0
type: Comment
has text: just with relevant DOM.

jquery-validate
tags question: http://stackoverflow.com/q/27962824
tags question: http://stackoverflow.com/q/27841774
tags question: http://stackoverflow.com/q/27931411
type: Tag
tags question: http://stackoverflow.com/q/27830964
tag name: jquery-validate
tags question: http://stackoverflow.com/q/27807395
tags question: http://stackoverflow.com/q/27943304
tags question: http://stackoverflow.com/q/27963157
tags question: http://stackoverflow.com/q/27910618

http://stackoverflow.com/q/27813427
has comment: http://stackoverflow.com/comment/44033887
has title: Display a string on canvas for only fraction of seconds
type: Question
tagged with: canvas
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 2
has answer: http://stackoverflow.com/a/27813545
has comment: http://stackoverflow.com/comment/44034215
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44033902
favorite count: 0
has answer: http://stackoverflow.com/a/27814210
type: UnansweredQuestion
upvote count: 1
has body: I have written a code in which my word should be displayed on clicking start button for some fraction of seconds. How do i do it? function start() { block.x = 0; for (var i = 0; i &lt; boxes.length; i++) { resetbox(boxes[i]); } if (!continueAnimating) { continueAnimating = true; animate(); } } And i want to display this for lets say 5 seconds: var text=randomLetter(nu); See Demo
score: 1

http://stackoverflow.com/comment/44179834
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27888637
has text: @Alnitak i share my solution

http://stackoverflow.com/comment/44287720
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27940891
has text: @DC74 I've updated my answer another time, let me know
type: Comment

http://stackoverflow.com/comment/72299561
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27860934
has text: Yes it works now. I tried to do similar code but not put there any similar to lines 18-22. The code there takes value of cell, and reset "selected" attribute on options, and after that set this attribute to same option. Why it this for?

http://stackoverflow.com/q/27952217
tagged with: javascript
has title: Ember controller set property in action
score: 0
has answer: http://stackoverflow.com/a/27952512
accepted answer: http://stackoverflow.com/a/27952512
answer count: 1
tagged with: handlebars.js
tagged with: ember.js
has body: New to ember and this is super dumb but I've wasted my day on it. I'm creating an array of objects in my controller which i'm using to building radio buttons in my view. when the button is clicked, i want to toggle the clicked attribute on the radio input so that it will appear clicked. Very simple but Ember keeps throwing me errors. here's my code (edited some typos): IndexController = Ember.ObjectController.extend({ radioArray : function () { var a = [], i = 0; while (a.push({ index: i++, clicked: false }), i &lt;= 10); return a; }.property('radioArray'), actions : { assignClick : function (item, index) { this.toggleProperty(item.clicked); // some unrelated business logic here } } }); this hooks up to: {{#each radioArray}} &lt;label {{action "assignClick" this index}}&gt; &lt;input type="radio" {{bind-attr value=index checked=clicked}} /&gt; foo &lt;/label&gt; {{/each}} All i want is to show that the correct radio button has been clicked. But when i try and set clicked to true in my ctrl, i get "Uncaught Error: Assertion Failed: Cannot call get with false key."
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44300404
tagged with: dom
has comment: http://stackoverflow.com/comment/44299765
type: Question

http://stackoverflow.com/q/27904206
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44207509
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/16873889
tagged with: css
has body: I'm trying to understand where to add code to delay the toggle of my div by 0.5 seconds. I am a beginner with JavaScript/jQuery. function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //it is tied to this if it can help TEST This works. However, I'd like to change it so that when it changes back to display none it does not delay.
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44207536
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27904244
tagged with: delay
tagged with: jquery
favorite count: 0
has title: Add a delay to JavaScript function
has answer: http://stackoverflow.com/a/27904278
linked to: http://stackoverflow.com/q/16873889
has comment: http://stackoverflow.com/comment/44207568

http://stackoverflow.com/a/27888731
upvote count: 2
answers question: http://stackoverflow.com/q/27888719
score: 2
type: AcceptedAnswer
downvote count: 0
has body: You have the data in a string. If you want to access it like an object, then you have to convert it into one. You need to find, or write, a parser for whatever data format the data is in. It looks like it is JSON, so you can use JSON.parse(string)
type: Answer
has comment: http://stackoverflow.com/comment/44178522
has comment: http://stackoverflow.com/comment/44178495
accepted answer of: http://stackoverflow.com/q/27888719

http://stackoverflow.com/comment/44260239
comment on: http://stackoverflow.com/a/27883661
type: AnswerComment
score: 0
type: Comment
has text: Unfortunately, it doesn't change the text position - still it is left-aligned. I've tried to use cw/2 as first parameter for translate(), but it doesn't help - http://jsfiddle.net/and7ey/e1zjmfn9/1/

http://stackoverflow.com/q/27876762
score: 0
tagged with: javascript
has body: I use NoUiSliders and I want to bind it with a span object. On documentation they have this way: $('#slider1').Link('lower').to($('#slider1value')); However, what I want to do is to not show the value, but use it on a dictionary with the slider's values as keys and take the text from there. For example: var names = ["0":"zero", "1":"one",...] I don't know if it is something that you can do with wNumb from noUiSliders and I tried it by myself with this way: $( "#slider1" ) .on("slide set change", function() { var value = $( this ).val(); $( "#slider1value" ).text( names[value] ); }) It works as it is now when slider changes, but when the page loads with the predefined values, the span doesn't take the value from slider. Is there any way to add another event like initialize or load? Or is there any other way to do it?
accepted answer: http://stackoverflow.com/a/27885536
type: AnsweredQuestion
tagged with: jquery
has title: Bind NoUiSlider with a span
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/27885536
tagged with: nouislider

http://stackoverflow.com/comment/44131396
type: QuestionComment
comment on: http://stackoverflow.com/q/27863803
score: 0
has text: Only half related with the question, but 500 Error is a general error displayed when the errors are "hidden". I suggest displaying errors(I'm talking about development environment not production of course) and see exactly what the problem is. This will also help u in the future.
type: Comment

http://stackoverflow.com/comment/44304957
comment on: http://stackoverflow.com/q/27954958
score: 2
type: Comment
type: QuestionComment
has text: It should be in the url alright. http://blabla/resource/id should be the resource to delete.

http://stackoverflow.com/a/27823019
upvote count: 4
answers question: http://stackoverflow.com/q/27822868
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27822868
type: Answer
has comment: http://stackoverflow.com/comment/44051872
has body: It should work as is if you just return the $.when result: function delayDownloadAssets(sectionName) { var htmlRequest = $.ajax({ url: 'http://www.example.com/' + sectionName + '.html' }), cssRequest = $.ajax({ url: 'http://www.example.com/' + sectionName + '.css' }); //add return here return $.when(firstRequest, secondRequest).done(function (firstResponse, secondResponse) { //Insert HTML assets and CSS assets into DOM app.sections[sectionName].enabled(true); }); }
score: 4

http://stackoverflow.com/comment/44137330
has text: The usual JavaScript coding style is to reserve identifiers starting with capital letters for constructor functions. `Eve` should be `eve`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27867386

http://stackoverflow.com/comment/44270171
type: Comment
has text: so you want to select the checkbox not the row?
comment on: http://stackoverflow.com/a/27936598
type: AnswerComment
score: 0

http://stackoverflow.com/a/27928941
answers question: http://stackoverflow.com/q/27928742
has comment: http://stackoverflow.com/comment/44368469
has comment: http://stackoverflow.com/comment/44259001
has body: Can you bind the orientationchange event to trigger an end and a start, or will that cause too much of a break in the user experience. something like: $(window).on('orientationchange', function () { $('.touchspace').trigger('touchend'); $('.touchspace').trigger('touchstart'); });
has comment: http://stackoverflow.com/comment/44368690
score: 0
type: Answer

http://stackoverflow.com/comment/52561383
comment on: http://stackoverflow.com/a/32343497
score: 0
type: Comment
type: AnswerComment
has text: if i understood correctly , you want both date and time picker in one plugin and display them in input field ?

http://stackoverflow.com/comment/44185591
type: QuestionComment
type: Comment
has text: What are you trying to test? Without seeing what this is testing, there’s no way to say where that error is coming from.
comment on: http://stackoverflow.com/q/27890872
score: 0

http://stackoverflow.com/a/27933148
type: AcceptedAnswer
score: 4
type: Answer
accepted answer of: http://stackoverflow.com/q/27933066
upvote count: 4
answers question: http://stackoverflow.com/q/27933066
downvote count: 0
has body: You could use .index() and classes to simplify your code. $(document).ready(function() { $('.carImage').hide(); $('.item').click(function() { $('.carImage').hide().eq($(this).index()).show(); }) }); .item { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 3em; padding: 1em; margin: 0.5em; background-color: #36F; color: #FFF; width: 75px; float: left; } .item:hover { background-color: #F0C; } a { text-decoration: none; color: #FFF; } #selectors { overflow: auto; } A B C D

http://stackoverflow.com/comment/44220884
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27910670
has text: ah..I should have caught that, that was it. Thanks!
score: 0

http://stackoverflow.com/comment/46376996
type: QuestionComment
has text: @SQLApprentice: Yes, the facebook server. Facebook need to allow your application to make an XMLHttpRequest without triggring same-origin-policy. CORS is that mechanism.. for Facebook, not for you. If Facebook doesn't allow you via CORS you can't use CORS.
comment on: http://stackoverflow.com/q/27893286
score: 0
type: Comment

http://stackoverflow.com/comment/44268448
type: QuestionComment
has text: What do you by "*append*"? Concatenate?
comment on: http://stackoverflow.com/q/27935596
score: 0
type: Comment

jasmine
tags question: http://stackoverflow.com/q/27866147
tags question: http://stackoverflow.com/q/27859506
tags question: http://stackoverflow.com/q/27927922
tags question: http://stackoverflow.com/q/27919698
tag name: jasmine
tags question: http://stackoverflow.com/q/27853117
tags question: http://stackoverflow.com/q/27875911
tags question: http://stackoverflow.com/q/27819842
tags question: http://stackoverflow.com/q/27807914
tags question: http://stackoverflow.com/q/27813498
tags question: http://stackoverflow.com/q/27932396
tags question: http://stackoverflow.com/q/27828108
tags question: http://stackoverflow.com/q/27945474
tags question: http://stackoverflow.com/q/27947420
tags question: http://stackoverflow.com/q/27905088
tags question: http://stackoverflow.com/q/27892316
tags question: http://stackoverflow.com/q/27839842
tags question: http://stackoverflow.com/q/27863806
tags question: http://stackoverflow.com/q/27884028
tags question: http://stackoverflow.com/q/27959336
tags question: http://stackoverflow.com/q/27922925
tags question: http://stackoverflow.com/q/27807022
tags question: http://stackoverflow.com/q/27807668
tags question: http://stackoverflow.com/q/27920015
type: Tag
tags question: http://stackoverflow.com/q/27823741
tags question: http://stackoverflow.com/q/27916136
tags question: http://stackoverflow.com/q/27930601
tags question: http://stackoverflow.com/q/27816115

http://stackoverflow.com/comment/44266975
type: Comment
type: QuestionComment
has text: It should be executing, are you certain it isn't? It's more likely that it can't do what it needs to at the time it's executing.
comment on: http://stackoverflow.com/q/27934728
score: 0

http://stackoverflow.com/comment/44017861
has text: Your first split is correct. You need to loop over all the results, splitting each on `^`.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27804365

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/27810284
tags question: http://stackoverflow.com/q/27849792
type: Tag

http://stackoverflow.com/comment/67486060
has text: @Archibald - component wrapping is also a good solution. It is even cleaner because the component there doesn't need to know about any router (`route.foo` property) and you can use any property name.
comment on: http://stackoverflow.com/a/32761932
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/q/27873663
has comment: http://stackoverflow.com/comment/44149973
possible better answer: http://stackoverflow.com/a/27873756
accepted answer: http://stackoverflow.com/a/27873703
type: Question
answer count: 2
has title: What's the standard format for assignment expressions?
downvote count: 0
tagged with: jslint
tagged with: javascript
favorite count: 0
score: 8
has answer: http://stackoverflow.com/a/27873703
upvote count: 8
has answer: http://stackoverflow.com/a/27873756
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44152854
has body: I have the following function in JavaScript and when running it through JSLint, it yelled at me, as I call it. function getPos(event, element) { var x = event.clientX, y = event.clientY, currentElement = element; do { x -= currentElement.offsetLeft - currentElement.scrollLeft; y -= currentElement.offsetTop - currentElement.scrollTop; } while ((currentElement = currentElement.offsetParent)); return { x: x, y: y }; } Specifically about the inline assignment expression in the while loop. I figured the double parentheses was the standard way of saying, "I'm expecting the returned value from the assignment expression to be type-casted to a Boolean for the conditional." JSLint seems to disagree, even when I enable "assignment expressions." Then I tried adding a !! in front, and JSLint complains that it's "confusing usage." So my question is, what's the right way of formatting this? EDIT: By "this", I meant specifically the inline assignment expression. The intent of my question was to clarify what an acceptable standard for that particular line was, if one really wanted to use that, and though I do agree that thefourtheye's answer is the most correct way to write the function, it is not the answer to the question I was asking.
tagged with: standards

http://stackoverflow.com/q/27858047
type: Question
has title: How to send info as Json data to server without Post method or any form
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27858228
has body: I have been given I task to work with Json to send data to server without actually using the "form" or "Post", below are the conversations between me and my senior: Senior: send only the data to the server without submitting the form in javascript myJsonObject.Username = document.getElementById('txtUsername').value; this will be done when Save button click in such situation, we don't use form element we don't use submit button just a simple button for save onclick="saveUser()" function saveUser(){ var userInfoJson = { }; userInfoJson.Username = document.getElementById('txtUsername').value; ...and so on just play around with json Me: &lt;form name="form" method="post" onsubmit="saveUser()"&gt; will it look like this? Senior: ** don't use form tag don't use submit button Me : one more thing will it have &lt;input type="text"&gt; ? Senior: not sure what u mean u can use any kind of html, i don't mind you need to show me some coding of json and that happens in .JS file or in &lt;script type="text\javascript" tag html can be used to integrate ur user input i don't mind u use any kind of html whether beautiful or not I MEAN JSON here in this thread I wan't json... json, json, json don't bring the whole world here... talk about json json only So how one can do it without form?
has comment: http://stackoverflow.com/comment/44119137
has comment: http://stackoverflow.com/comment/44118857
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/44104806
has text: Do you mean using JQuery on my tests?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27823298
type: Comment

http://stackoverflow.com/comment/44116506
has text: I am not sure if you want someone from here to code it or need help in searching for a plugin, although in both cases you are on the wrong website since we help you fix your code not create your whole app :/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27856601
score: 1

http://stackoverflow.com/q/27862197
score: -1
type: Question
accepted answer: http://stackoverflow.com/a/27863619
tagged with: validation
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27863619
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs-ng-repeat
upvote count: 0
type: AnsweredQuestion
has body: Hello Everyone I am facing a problem regarding my save button validation. I want to validate my button if any Index is fully filled. My Save Button enable/disabled or validate properly button in case of last index. If last index is filled then the save button is working properly but in case of another index it is not working well. Here is my Plunkr Link : http://plnkr.co/edit/IlBKTAmNBtrI79Kz8thf?p=preview Here is my html file: Enter data in List {{$index + 1}} Name : Address : City : Phone : State : IncludeAll {{browser}} Save Controller var app = angular.module("myApp",[]); app.controller('detailContrller', function($scope){ $scope.stories = []; $scope.browsers = ['IE', 'Chrome', 'Firefox','Safari','Opera']; $scope.saveBtnDisabled = true; var checked; $scope.updateAll = function (index) { checked = $scope.stories[index].all; $scope.browsers.forEach(function (browser) { $scope.stories[index].browser[browser] = checked; }); }; for(var i = 0; i< 3; i++) { $scope.stories.push({Name1: "", Name2: "", Name3:"", Name4: "", Name5:"", all: "", browser:{}}); } $scope.$watch('stories', function (newVal, oldVal) { for(var i in newVal) { var count = 0, keyCount = 0, selected = newVal[i]; angular.forEach(selected, function(value, p) { if (value) { count++; } keyCount ++; }) if (count === keyCount && count >= 6) { $scope.saveBtnDisabled = false; } else if (count !== keyCount && count <= 6) { $scope.saveBtnDisabled = true; } } },true); $scope.save = function () { console.log($scope.stories); }; });
has title: How to validate Save button in ng-repeat in any Index is field.?

http://stackoverflow.com/comment/44187162
type: QuestionComment
comment on: http://stackoverflow.com/q/27892760
has text: You say: `If the direction says "go to red square", the player must do this` what if there's no red square? Why there are 3 red squares initially? Is that really a game? What are the rules? probably understanding the simple game rules one would understand the issue you're facing...
score: 0
type: Comment

http://stackoverflow.com/comment/44291441
has text: It also looks like the OP might have some other id's which are duplicated, like `question, statement, true, false, button` and `button 2`.
type: AnswerComment
comment on: http://stackoverflow.com/a/27948273
score: 0
type: Comment

http://stackoverflow.com/q/27883027
tagged with: impress.js
answer count: 0
upvote count: 3
type: Question
tagged with: javascript
downvote count: 0
favorite count: 0
has body: Say one has the following impress.js code: Foo bar This renders fine on a 1920x1080 screen, because 5 (data-scale) times 2000 (screen width with some buffer) is 10000. But: It doesn't render nice on smaller screens (because 1920 is large compared to for instance 800); and For larger screens, the slides can still overlap. How can one set the slide location, based on the viewport size? Thus something like 500vw? (tried that, but that didn't work).
type: UnansweredQuestion
has title: Screen-size dependend values for data-x in impress.js
tagged with: css
score: 3

http://stackoverflow.com/comment/44095162
score: 0
type: Comment
type: QuestionComment
has text: As Howard Renollet said, use`target="_blank"` on your link like this: `link` on your link.
comment on: http://stackoverflow.com/q/27845237

http://stackoverflow.com/a/27924999
answers question: http://stackoverflow.com/q/27924890
type: Answer
score: 0
has body: http://api.jquery.com/scrolltop/ scrollTop() gives you the height above the page, so you can use that along with element height and window height (and do some math) to find what elements have been displayed.

http://stackoverflow.com/q/27914693
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
has answer: http://stackoverflow.com/a/27915048
accepted answer: http://stackoverflow.com/a/27915048
has comment: http://stackoverflow.com/comment/44228795
has comment: http://stackoverflow.com/comment/44228601
has comment: http://stackoverflow.com/comment/44228926
downvote count: 0
has comment: http://stackoverflow.com/comment/44229065
tagged with: arduino
has body: I have a very basic web page that I'm loading with an Arduino Server. When I view the page on Safari, everything works fine and looks good when I use the inspector. But when I load it on Chrome (version 39.0.2), it wraps all of my HTML in a "pre" tag which prevents my webpage from loading (I've attached screenshots showing the Inspector output). It also moves all of my code out of the "head" tag and into the "body" tag. First, here is my HTML : CANARI JR. | Home Now when I inspect my page, I see this: And it wraps around all my HTML and actually closes the tag outside of my body and html tag! Anyone see what is going wrong here in Chrome? Edit 1 - I am using an Arduino Ethernet Shield to host and load this page from an SD card. (It works perfectly on Safari, so I'm thinking there's something in my code and not an issue with Arduino). Edit 2 - I've attached screenshot of the Google Chrome Inspector (sorry - copy and pasting replaced a lot of the characters, so I went screenshot route https://i.sstatic.net/d09k8.png Edit 3 - Added "Network" Tab from Chrome Inspector https://i.sstatic.net/zL7L1.png
has title: Why is Chrome loading my HTML in a "pre" tag?
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/44228961
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44228989
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/54651008
has answer: http://stackoverflow.com/a/54651008
tagged with: javascript
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/44228935
has comment: http://stackoverflow.com/comment/44228770
has comment: http://stackoverflow.com/comment/44228627

http://stackoverflow.com/a/27881677
answers question: http://stackoverflow.com/q/27881566
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: The problem is with this event handler at the very end of the code in the CodePen: $(this).click(function(e){ e.stopPropagation(); }); That's explicitly preventing clicks on the menu tabs from bubbling up to any other event handler. Probably the Bootstrap tab code binds its event handlers at the top of the DOM. It's not clear what the intention of that code is; it's not commented and it's not apparent from looking at the rest of the code. It may be just a gratuitous addition, in which case it's erroneous given the nature of that code.
accepted answer of: http://stackoverflow.com/q/27881566

http://stackoverflow.com/q/27857102
has comment: http://stackoverflow.com/comment/44132755
downvote count: 0
tagged with: javascript
tagged with: embedded-jetty
favorite count: 0
has body: I am using jetty 9 in embedded mode and even though i have given a threadpool of 500 the server still just handle one request at a time. What am i missing ? JAVA CODE: // here i expect all thread name log to print instantaneously but they print one by one public class Main { public static void main(String[] arg) throws Exception { ExecutorThreadPool executorThreadPool = new ExecutorThreadPool(Executors.newFixedThreadPool(500)); final Server server = new Server(executorThreadPool); final ServerConnector connector0 = new ServerConnector(server); connector0.addBean(executorThreadPool); connector0.setPort(8080); server.setHandler(new HelloHandler()); server.setConnectors(new Connector[] {connector0}); server.setDumpAfterStart(true); server.start(); server.join(); } } class HelloHandler extends AbstractHandler { public void handle(String target,Request baseRequest,HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException { try { System.out.println("Thread Name+" + Thread.currentThread().getName()); Thread.sleep(3000l); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } response.setContentType("text/html;charset=utf-8"); response.setStatus(HttpServletResponse.SC_OK); baseRequest.setHandled(true); response.getWriter().println(" Hello World "); } } POM.XML 4.0.0 Test test 0.0.1-SNAPSHOT org.eclipse.jetty jetty-server 9.2.6.v20141205 JAVASCRIPT script i fired from my browser to test" function httpGet(theUrl) { var xmlHttp = null; xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", theUrl, true ); xmlHttp.send( null ); return xmlHttp.responseText; } for(i=0;i<20;i++) {console.log(i);httpGet("http://localhost:8080");}
answer count: 0
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/100993405
type: Question
score: 3
tagged with: java
has title: Embedded Jetty 9 handle one request at a time
tagged with: jetty-9

http://stackoverflow.com/a/27952225
has body: Without parsing of the json, your string will contain quotes: "error". You can either manually parse the json or have jQuery do it automatically by specifying a data type: $.post('functions/addExam.php', { newExam: examName }, function(data){ console.log(data); if(data =='error'){ $('#notify').html(data); $('.alert').toggle(); } }, 'json'); ^^^^ here you specify the data type
upvote count: 3
answers question: http://stackoverflow.com/q/27952164
accepted answer of: http://stackoverflow.com/q/27952164
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44299666

http://stackoverflow.com/q/27845596
tagged with: javascript
tagged with: jquery
score: 0
has body: I have dynamic variable called "id_item" which returns different values depending on the words found in the URL of the document. So, for example, if the URL contains "?item=i1990", var "id_item" will be "i1990". In the same JS I have declared several variable arrays to store some specific data. Those variables are expected to be the same as the words found in the URL. For the same example, there is a variable array called i1990 with some data. var i1990 = ["valueexample1", "valueexample2", "valueexample3"]; What I need is to get first the value of "id_item" and then search for it as a variable and get its value... to arrive until "valueexample1", "valueexample2" or "valueexample3" depending of my needs (it's an array) I don't know if I've been clear, but I thank you all for your support.
has answer: http://stackoverflow.com/a/27845757
has comment: http://stackoverflow.com/comment/44095078
has title: find a return value as variable
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27845770
accepted answer: http://stackoverflow.com/a/27845757
has answer: http://stackoverflow.com/a/27845770
type: Question
answer count: 2

http://stackoverflow.com/comment/44281160
score: 0
type: QuestionComment
has text: @Alnitak—presumably the result of `<?php echo json_encode($dataArray); ?>` is (intended to be) a javascript array literal. Whether or not it produces the expected result will help.
type: Comment
comment on: http://stackoverflow.com/q/27942507

http://stackoverflow.com/comment/44086464
has text: I just tried it but it still returns true.
score: 0
comment on: http://stackoverflow.com/q/27841281
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44039493
score: 0
type: AnswerComment
has text: This is actually pretty close to what I had in mind! But the issue I run into is if I set the width to 100% so it is responsive, how can I set the hover to go across the the whole width? I know it has something to do with the "limitX=150-15" in js. I just don't know how to add the width of the actual "container" class. Here is what I tried to do: http://jsfiddle.net/663L0njt/1/
type: Comment
comment on: http://stackoverflow.com/a/27814977

http://stackoverflow.com/comment/44261126
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27900450
has text: @nashmaniac I can't comment on your latest reply yet but please post that code (that callback code) and update the initial question.

http://stackoverflow.com/q/27939515
tagged with: http://stackoverflow.com/tag/pdf
has answer: http://stackoverflow.com/a/27940023
has title: how to convert jsp page as pdf format?
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/55390151
type: UnansweredQuestion
upvote count: 1
type: Question
score: -2
downvote count: 3
has comment: http://stackoverflow.com/comment/85778243
linked to: http://stackoverflow.com/q/29386585
has body: I tried to convert jsp page to save as pdf by using itext.i downloaded itex.jars and included those in to my project.after that what i will do to get result as pdf page?
has answer: http://stackoverflow.com/a/49358568
tagged with: jsp
tagged with: javascript
linked to: http://stackoverflow.com/q/633780
has answer: http://stackoverflow.com/a/27939637

http://stackoverflow.com/q/27951536
has body: I write this code to try my idea and is working fine : var answer = prompt("Please type your gender? male / female"); var gender = answer; switch (gender) { case "female": console.log("Hello, madame!"); break; case "male": console.log("Hello, sir!"); break; default: console.log("Hello!"); } But the problem for example when someone add answer with uppercase like "MALE" or Capital Letter like "Male" so this code is not working. any idea about that to get working in any statments of words ( Lowercase / Uppercase / Capital Letter )
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27951575
has answer: http://stackoverflow.com/a/27951553
tagged with: switch-statement
type: Question
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27951553
score: 0
has answer: http://stackoverflow.com/a/27951575
has title: About Swtich Statments in JavaScript

http://stackoverflow.com/comment/44189704
has text: Yeah. Even using Fiddle that u recommended did nothing, any further tips?
comment on: http://stackoverflow.com/a/27894256
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45860059
type: Comment
type: QuestionComment
has text: Answer your question and check it as the correct answer for others to know and empty the unanswered stack.
score: 0
comment on: http://stackoverflow.com/q/27820887

http://stackoverflow.com/a/47424392
upvote count: 2
score: 2
has body: The npm-run-all package may be what you're looking for: $ npm install --save npm-run-all Then in your package.json file: "scripts": { "runA": "taskA", "runB": "taskB", "runBoth": "npm-run-all -p runA runB" } (-p runs them in parallel, use -s for sequential.)
answers question: http://stackoverflow.com/q/27808402
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/115253967

http://stackoverflow.com/comment/44280206
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27941306
has text: thats odd.. live should not change the ajax event. typo maybe?

http://stackoverflow.com/comment/44276106
type: QuestionComment
score: 1
has text: https://github.com/wGEric/phpBB-BBCode-Javascript-Parser
comment on: http://stackoverflow.com/q/27939438
type: Comment

http://stackoverflow.com/a/27949304
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: i is an integer value, not a layer. So map.hasLayer(i) and map.removeLayer(i) takes wrong type of parameter. Try to use map.hasLayer(one[i]) and map.removeLayer(one[i]) EDIT: Also map.addLayer(one[i])
accepted answer of: http://stackoverflow.com/q/27949146
type: Answer
answers question: http://stackoverflow.com/q/27949146

http://stackoverflow.com/comment/44338708
comment on: http://stackoverflow.com/a/27956725
score: 0
type: AnswerComment
has text: That's exactly what I did, though instead of linking to the proper link, it goes to domain.com/mostRecentURL. I couldn't say why it wasn't working.
type: Comment

http://stackoverflow.com/comment/44412548
type: Comment
has text: The strange thing is, if I use a manifest inside the js code, it all works perfectly. So perhaps an error in my manifest?
comment on: http://stackoverflow.com/a/27993381
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44064086
type: Comment
comment on: http://stackoverflow.com/q/27828952
has text: This is no way more general solution than using IDs, but it is definitely worse. IDs are there for programming, use them :)
score: 0
type: QuestionComment

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/27956779

http://stackoverflow.com/a/27926229
upvote count: 4
has comment: http://stackoverflow.com/comment/68232854
accepted answer of: http://stackoverflow.com/q/27925640
downvote count: 0
answers question: http://stackoverflow.com/q/27925640
has body: I Found the probleem. When you use tab while programming it sometimes doesn't tab the way it should. (tabs become spaces) Use right click -> page source and look for the characters. when you find them go to that line of code and delete all tabs there. as you can see the A characters are gone:
type: AcceptedAnswer
score: 4
type: Answer

http://stackoverflow.com/comment/44068824
has text: Hi thanks for the answer, I understand what you mean. The reason why I did that href is because I need to pass different arguments to that function search_rate depending on the item in a list that was clicked so I am not sure how I would do this with the click action on the div you suggested.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27831374

http://stackoverflow.com/a/27817905
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/27816630
has body: You can use html5 pattern.. &lt;input type="text" title="Following format: FirstName LastName" pattern="^\s*([\w]{1,20}( |,)?)+\s*,\s+([\w]{1,20} *)+$" /&gt;
score: 2

http://stackoverflow.com/comment/44163087
has text: @AlexanderO'Mara Request can give you stream of decompressed data as it is received: https://github.com/request/request#examples (2nd example).
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27880436

http://stackoverflow.com/q/27842862
possible better answer: http://stackoverflow.com/a/27842919
has title: get classname of a last element in a div
tagged with: classname
type: AnsweredQuestion
has body: I have a table like below. As you can see first element's class is "success" and second "active" and third is "success"...etc.. Now I want to do this dynamically. But I can't get last element's classname for add some condition. How can I do this in JavaScript? User Information The following table contains some personal information about users. First Name som td>First Name something td>First Name something td>First Name something
has answer: http://stackoverflow.com/a/27842919
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44089529
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44089482
has answer: http://stackoverflow.com/a/27842886
accepted answer: http://stackoverflow.com/a/27842886

http://stackoverflow.com/comment/44249560
has text: @Tomáš Zato i searched but the answer for my question don't exist .
type: QuestionComment
comment on: http://stackoverflow.com/q/27924231
score: 0
type: Comment

http://stackoverflow.com/q/27823741
accepted answer: http://stackoverflow.com/a/27823842
upvote count: 13
tagged with: karma-runner
possible better answer: http://stackoverflow.com/a/43890644
has answer: http://stackoverflow.com/a/43890644
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/44053391
has answer: http://stackoverflow.com/a/27823842
tagged with: javascript
score: 13
has title: Karma + angular-mocks TypeError: 'undefined' is not an object (evaluating 'angular.mock = {}')
has answer: http://stackoverflow.com/a/56580406
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27823813
downvote count: 0
has body: I'm trying to write unit tests using Karma + Jasmine, but running into an error with angular-mocks. When running grunt test I get the following error: PhantomJS 1.9.8 (Mac OS X) ERROR TypeError: 'undefined' is not an object (evaluating 'angular.mock = {}') at /Users/danielbogart/Documents/coding/work/AexNav/bower_components/angular-mocks/angular->mocks.js:17 Chrome 39.0.2171 (Mac OS X 10.9.4) ERROR Uncaught TypeError: Cannot set property 'mock' of undefined at /Users/danielbogart/Documents/coding/work/AexNav/bower_components/angular-mocks/angular->mocks.js:17 Gruntfile karma config: karma: { options: { frameworks: ['jasmine'], files: [ 'dom_munger.data.appjs', 'tests/spec/*.js', 'bower_components/angular-mocks/angular-mocks.js' ], logLevel: 'ERROR', reporters: ['mocha'], autoWatch: false, //watching is handled by grunt-contrib-watch singleRun: true }, all_tests: { browsers: ['PhantomJS', 'Chrome'] }, during_watch: { browsers: ['PhantomJS'] } } Thanks!
tagged with: jasmine
favorite count: 0
tagged with: angularjs
type: Question

http://stackoverflow.com/q/27879488
has answer: http://stackoverflow.com/a/27879644
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has title: PHP Ajax Autocomplete more than one field
type: UnansweredQuestion
tagged with: php
has body: The below code is working fine to autocomplete the location but how can I make when I click on the list it will fill the other 2 textboxes with latitude and longitude? PHP $pdo = connect(); $keyword = '%'.$_POST['keyword'].'%'; $sql = "SELECT * FROM locations WHERE location LIKE (:keyword) AND state='QLD' AND latitude !=0 AND longitude !=0 ORDER BY postcode ASC LIMIT 0, 10"; $query = $pdo-&gt;prepare($sql); $query-&gt;bindParam(':keyword', $keyword, PDO::PARAM_STR); $query-&gt;execute(); $list = $query-&gt;fetchAll(); foreach ($list as $rs) { $country_name = str_replace($_POST['keyword'], '&lt;b&gt;'.$_POST['keyword'].'&lt;/b&gt;', $rs['location']. ' ' .$rs['state']. ' ' .$rs['postcode']); echo '&lt;li onclick="set_item(\''.str_replace("'", "\'", $rs['location']).'\')"&gt;'.$country_name.'&lt;/li&gt;'; } HTML &lt;input type="text" id="country_id" onkeyup="autocomplet()"&gt; &lt;input type="text" id="latitude"&gt; &lt;input type="text" id="longitude"&gt; &lt;ul id="country_list_id"&gt;&lt;/ul&gt; JavaScript function autocomplet() { var min_length = 0; var keyword = $('#country_id').val(); if (keyword.length &gt;= min_length) { $.ajax({ url: 'ajax_refresh.php', type: 'POST', data: {keyword:keyword}, //data2: {keyword2:keyword2}, success:function(data){ $('#country_list_id').show(); $('#country_list_id').html(data); //$('#latitude').html(data2); } }); } else { $('#country_list_id').hide(); } } function set_item(item) { $('#country_id').val(item); $('#country_list_id').hide(); }
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27879552

http://stackoverflow.com/q/27859434
answer count: 2
has answer: http://stackoverflow.com/a/27859574
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44121498
tagged with: http://stackoverflow.com/tag/html
has body: Hey guys I'm trying to make a DIV resize to always fit 90% of my page. I have a footer (.kontakt) that I'd like to always have positioned at the bottom of the screen, so I need my DIV to scale (if it's too big the footer won't move when I scroll). I am loading external html files onto my div using jquery, and the div always resizes to fit content. Problem is, I don't want to set max-height, min-height in css but would like for the div to resize every time the browser window resized. Is there an easy solution to do that that I failed to find, and can I write a function that does that? What event handler can I use that triggers on browser window resize? I guess I could just use position:fixed on the footer(haven't actually tried if it works) but I'd prefer to have scrollbars on my div (hence overflow:auto;) than scrolling in the browser window. Thanks for the help $(document).ready(function() { $('.content').load('pages/test.html'); console.log("content loaded"); $(".kontakt").hover( function() { $(".kontakt").width("20%"); $(".kontakt").css("margin-left", "40%"); $(".kontakt").append("mobitel: 031-535-919"); $(".kontakt").append(" stacionarni tel.: 01-3664-515 "); $(".kontakt").append(" email: sustersic_miha@hotmail.com "); $(".kontakt").append(" Visoko 19 1292 Ig Slovenija"); }, function() { $(".kontakt").empty(); $(".kontakt").width("10%"); $(".kontakt").css("margin-left", "45%"); $(".kontakt").append(" Kontakt "); }); $(".menubutton").hover( function() { $(this).css("color", "#cccccc"); $(this).prev().css("color", "#cccccc"); $(this).next().css("color", "#cccccc"); }, function() { $(this).css("color", "#ffffff"); $(this).prev().css("color", "#ffffff"); $(this).next().css("color", "#ffffff"); }); }); body { margin: 0; font-family: verdana; background-image: url("images/background_test.jpg"); background-size: cover; } .topmenu { width: 90%; margin: auto; background-color: #000066; border-radius: 0px 0px 10px 10px; text-align: center; opacity: 0.7; } .menubutton { ma…
tagged with: css
type: AnsweredQuestion
has title: resizing div height so it always fits the page
possible better answer: http://stackoverflow.com/a/27861326
type: Question
has answer: http://stackoverflow.com/a/27861326
accepted answer: http://stackoverflow.com/a/27859574
score: 0

http://stackoverflow.com/comment/44229033
type: AnswerComment
has text: can you add the `go()` function in question.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27914969

http://stackoverflow.com/comment/44102406
has text: What about changing `$('.result li')` to `$('.result ul')` since you have it inside ` ` a `ul` and not an `li` ^^^
comment on: http://stackoverflow.com/q/27848972
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27909661
answers question: http://stackoverflow.com/q/27909599
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: You can do: function convertTable() { $("table tr td :input:text").each(function() { var value = this.value; $(this).parent("td").empty().text(value); }); }

http://stackoverflow.com/comment/44149898
type: QuestionComment
has text: Works fine — http://jsbin.com/newekihegi/1/ — What's the problem?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27873951

http://stackoverflow.com/comment/44055305
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27824639
has text: so many loads....Is there not a better solution that does not make so many Ajax calls?
score: 0

http://stackoverflow.com/comment/44025825
comment on: http://stackoverflow.com/q/27806402
score: 0
type: Comment
type: QuestionComment
has text: @philtune: What about `<blink>`?

http://stackoverflow.com/comment/44291072
has text: @jbutler483 The styling on the new page is fine - the problem is just that when changing to a different printer it gets confused and tells it that the area to be printed is 8.5"x11" - which is a total lie, but the Zebra believes it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27947869

http://stackoverflow.com/q/27864990
has comment: http://stackoverflow.com/comment/44195951
tagged with: javascript
tagged with: web-component
has body: Goals I've got two Web Components that are supposed to be nested: and . The is 100% width of its container, and children have to fill it in width, so for example: has width: 1500px suppose there are three children; each child will have width: 500px Partial solution I managed to get this behavior using JavaScript (to hide that from the user) like below: and the component: Problem It works perfectly in Google Chrome, but when I go to Firefox or Internet Explorer, the console shows this error: TypeError: items[i].setw is not a function First of all, why doesn't that work in other browser than Chrome, and secondly, how can I make it work with JavaScript? Successful attempt, but other perspective I tried using horizontal layout for and flex for each . Surprisingly, it worked perfectly in every browser, but I want to use a method that will not cost the developer one word per tab (I mean flex). Browse Write a mail Write an article But again, I don't want this approach because it is harder to use.
downvote count: 0
favorite count: 0
has title: Programatically adjusting width of a Polymer Web Component
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44758827
score: 2
answer count: 0
has comment: http://stackoverflow.com/comment/44197723
has comment: http://stackoverflow.com/comment/44195319
type: Question
tagged with: polymer
has comment: http://stackoverflow.com/comment/44173365

http://stackoverflow.com/comment/44285398
type: Comment
has text: @BoltClock thanks for correcting me, i shall remember the proper words to use ;)
comment on: http://stackoverflow.com/a/27925756
type: AnswerComment
score: 0

http://stackoverflow.com/a/27907309
has body: Well - somehow you have to loop. But at least JavaScript is doin the job for you: var arr = [ { id: 12, slug: '050e8e8db93ae08ed46cd57017ef9617', name: 'Test Badge' }, { id: 13, slug: '78ed09b1f2aae29ab30915ac9f167bfa', name: 'Test Badge' } ]; var arrWithValue = arr.filter(function(el){ return el.slug === value; }); arrWithValue contains only the elements of the array with the correct value. When you have to access these data very often it would be better to loop one time and save every object using the slug as key. var sortedObj = {}; for(var i = 0, len = arr.length; i &lt; len; ++i){ sortedObj[arr[i].slug] = arr[i]; } // access the object with sortedObj['someSlug']
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27907213
answers question: http://stackoverflow.com/q/27907213
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44214205

http://stackoverflow.com/a/27962596
accepted answer of: http://stackoverflow.com/q/27962496
downvote count: 0
answers question: http://stackoverflow.com/q/27962496
has comment: http://stackoverflow.com/comment/44318603
type: AcceptedAnswer
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44319173
score: 2
has comment: http://stackoverflow.com/comment/44318983
has body: It appears as though you aren't calling the check() function anywhere, something like this: &lt;script type="text/javascript"&gt; function check(){ $('#Header').load('ajax/header.html #main_header'); } $(function() { check(); }); &lt;/script&gt;

http://stackoverflow.com/comment/44176692
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27887884
has text: just remove `var` before variable declaration
score: 0

http://stackoverflow.com/comment/44177162
has text: @sbaaaang I have updated my answer. I admit it is a little hacky, but it's the only way to get the file extension with the information the client has.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27887492

http://stackoverflow.com/q/27834849
tagged with: jsf-1.2
score: 0
answer count: 1
tagged with: javascript
tagged with: ajax
has body: I've got a requirement where we need to redirect to a page for JSF 1.2 Ajax call. In our case, we need to redirect to session expired page when the ajax call get fired after the session got expired. We are implementing the session expiry check in a filter and the invocation of httpservletresponse.sendRedirect is redirecting correctly to the session expired page as expected, but the url is not getting changed which is the issue now. Any hints/soultion either at the client/server side is highly appreciated. ~Ragesh
type: UnansweredQuestion
has title: JSF 1.2 AJAX Redirect to URL
has answer: http://stackoverflow.com/a/27859766
tagged with: ajax4jsf
type: Question

http://stackoverflow.com/a/27954700
score: 0
has body: Some ways I can think of: JS document.addEventListener("selectstart", function(){return false;}); CSS pointer-events: none;
answers question: http://stackoverflow.com/q/27954633
type: Answer
has comment: http://stackoverflow.com/comment/44312858

http://stackoverflow.com/comment/44257384
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27929769
has text: the RSS is not how much memory is used, at least not in the sense described, heapUsed is closer to what you want to watch. it looks like "old pointers" is where the ram is going, so i suspect a closure is being accidentally cached, maybe by being overly generous in passing req/res object around. see some details on the term and overall at http://jayconrod.com/posts/55/a-tour-of-v8-garbage-collection

http://stackoverflow.com/a/31580589
has body: Like spamguy say: This error occur is because you write your html file path wrong. as common it's: useminPrepare: { html: ['&lt;%= yeoman.app %&gt;/index.html'], options: { dest: '&lt;%= yeoman.dist %&gt;' } } please make sure usemin can find your index.html file by your html config.
answers question: http://stackoverflow.com/q/27929650
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44170493
score: 0
type: Comment
has text: I am sorry I don't what you mean. Draw sth or illustrate it more?
type: AnswerComment
comment on: http://stackoverflow.com/a/27884363

http://stackoverflow.com/q/27892200
type: UnansweredQuestion
answer count: 0
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
has body: am using d3.layout.cloud.js from here, to create a cloud, i've edited the svg with and height, but i don't understant how to calculate the translate params .attr("transform", "translate(150,150)") for this function function draw(words) { d3.select("svg") .append("g") .attr("transform", "translate(230, 200)") .selectAll("text") .data(words) .enter().append("text") .style("font-size", function(d) { return d.size + "px"; }) .style("fill", function() { return getRundomColor(); }) .attr("text-anchor", "middle") .attr("transform", function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; }) .text(function(d) { return d.text; }); } the width of svg element is 848 and the height is 400. my question is how can i calculate the transform attr for the g element?
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/44186502
tagged with: d3.js
has title: calculate transform attribute of a g element inside an svg
upvote count: 1

http://stackoverflow.com/q/27902687
has comment: http://stackoverflow.com/comment/44204671
type: Question
has title: Escape backslash in a link
has comment: http://stackoverflow.com/comment/44205521
tagged with: jsp
tagged with: javascript
has body: First, sorry for my english. I'm trying to do the next, but I can't. I have a jsp where I retrieve the links from database for the options of a menu. I have a Java variable where I store the link and I assign it to JavaScript variable var link = '&lt;%=link%&gt;' Everything is working fine, with external links to other webpages, but when the link in database is something like this "\\ctlmnas1\PlataformaEstadisticasWeb\DWH&amp;BI\BI&amp;DWH.htm", the backslashes are escaped and the link is built incorrectly. This is how I am building the link in a window open: strHTMLderecha += "onClick='window.open(\"" + link + "\")'&gt;"; In all cases is working well, but not in the case that the link has this backslash "\". I don't know how to solve it. Could you help me, please? This is the code: &lt;% try { sql="SELECT a.id_tab AS id, a.name AS nametab, is_visible AS visible, file_name AS filename, is_only_icon AS onlyicon, node_order AS node, link AS link, int_link AS intlink FROM nptab a, nptablink b WHERE a.id_tab = b.id_tab order by node "; rs = stm.executeQuery(sql); cnx.commit(); while (rs.next()) { idTab = (String) rs.getString("id"); nameTab = rs.getString("nametab") != null ? (String) rs.getString("nametab") : ""; visible = rs.getString("visible") != null ? (String) rs.getString("visible") : ""; fileName = rs.getString("filename") != null ? (String) rs.getString("filename") : ""; onlyIcon = rs.getString("onlyicon") != null ? (String) rs.getString("onlyicon") : ""; node = rs.getInt("node"); link = rs.getString("link") != null ? (String) rs.getString("link") : ""; intLink= rs.getString("intlink") != null ? (String) rs.getString("intlink") : ""; // Si es visible se pinta if (visible != null &amp;&amp; visible.equals("1")) { %&gt; MenuIdTab = '&lt;%=idTab%&gt;'; MenuNameTab = '&lt;%=nameTab%&gt;'; MenuIconTab = '&lt;%=fileName%&gt;'; OnlyIconTab = '&lt;%=onlyIcon %&gt;'; iNode = '&lt;%=node%&gt;'; link = '&lt;%=link%&gt;'; intLink = '&lt;%=intLink%&gt;'; if(MenuIdTab == "")…
has comment: http://stackoverflow.com/comment/44205400
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/44206650

http://stackoverflow.com/a/27946696
type: Answer
has body: The getElementById function is expecting an dom element id but you added the # in front of the id. The # is required for JQuery selector but document.getElementById isn't part of JQuery. Just remove the # from the id passed to the getElementById function.
answers question: http://stackoverflow.com/q/27946516
accepted answer of: http://stackoverflow.com/q/27946516
score: 2
type: AcceptedAnswer
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/27830772
type: AcceptedAnswer
score: 0
has body: That is not possible with ng-bind-html because ng-sanitize does not compile the html. It can only be used for static content. You would need to create a directive yourself for this. Something like this: .directive('compileHtml', function($compile) { return { restrict: 'A', link: function(scope, elm, attrs) { var template = scope.$eval(attrs.compileHtml); //get the template by evaluating elm.html(template); //set the html $compile(elm.contents())(scope); //compile the contents } } }); Also remember that you have child directives with no replace, which means you will be creating invalid html, table created by ppGroup will have ppRow as child which results in invalid html and it will push the directive content out of the table and compilation will not happen properly. So you would instead need to use the option replace:true on these directives. However it will be really unsafe to compile the html dynamically though unless you know it is from a trusted source which is what $sce service used by ng-bind-html does. It sanitizes the boundhtml. Demo var pp = { ctl: {} }; pp.mod = angular.module('pp', ['ngSanitize']); pp.mod.directive({ 'ppHeader': function() { return ({}); }, 'ppGroup': function() { return ({ template: ' ', transclude: true, restrict: 'EA' }); }, 'ppRow': function() { return ({ replace: true, template: ' ', transclude: true, restrict: 'EA' }); }, 'ppLabel': function() { return ({ replace: true, template: ' ', transclude: true, restrict: 'EA' }); }, 'ppValue': function() { return ({ replace: true, template: ' ', transclude: true, restrict: 'EA' }); }, }).directive('compileHtml', function($compile) { return { restrict: 'A', link: function(scope, elm, attrs) { var template = scope.$eval(attrs.compileHtml); elm.html(template); $compile(elm.contents())(scope); } } }); pp.ctl.main = pp.mod.controller('ppMain', ['$scope', function($scope) { $scope.curPage = 'page1'; $scope.pages = { "page1": { str: "page 1", template: '\ \ \ Page: 1 \ \ \ ' }, "page2": { str: "page…
type: Answer
accepted answer of: http://stackoverflow.com/q/27830304
has comment: http://stackoverflow.com/comment/44069031
answers question: http://stackoverflow.com/q/27830304
has comment: http://stackoverflow.com/comment/44068983

http://stackoverflow.com/comment/44314505
type: AnswerComment
comment on: http://stackoverflow.com/a/27960413
type: Comment
has text: Thanks for this pointer, sounds very interesting. As you can imagine, the javascript in the above GROUP E is provided by external parties, so I don't have control over them (and they probably use the global variables $, jQuery), so I am actually looking for isolating MY OWN CODE from that external code...
score: 0

http://stackoverflow.com/comment/44119136
score: 0
has text: inside the body tag and inside the form i simply use an onclick for the function
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27857534

http://stackoverflow.com/q/27949341
has comment: http://stackoverflow.com/comment/44295201
score: 1
has answer: http://stackoverflow.com/a/27949893
type: Question
has comment: http://stackoverflow.com/comment/44295332
tagged with: c#
has comment: http://stackoverflow.com/comment/44295273
has title: Save image from given URL and print it in JavaScript
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/2429934
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27949994
has body: Here is my issue: on my webpage I'm displaying an image that been taken from a given URL (the image been display in a div).On the backhand I'm setting up the URL with all the information. Beside the fact that I'm showing the picture I want to print the page - means print the div with all the content...Now when I'm trying to print Because of the image that been take from the given URL I'm getting empty place where the image should be. In order to solve it I figure it out that I need to do something in the background to save the image from the given URL so I have this code below.... How can I send what I'm getting from function to JS Code in order to combined the missing part when I print???? If someone have other solution please help me.... The URL of the Image : https://freemobilewallpaper.files.wordpress.com/2009/10/kuala3.jpg JS Function: //============================== // // Print Map// // ============================== // function printDiv() { How Can I print what been set in the code behind?????@#!@ var test = document.getElementById("&lt;%= divRightWrapper.ClientID %&gt;"); document.body.innerHTML = test; var newWin = window.open(); newWin.document.write(test.innerHTML); newWin.print(); } Back Code: Dim img As Image = GetPicture(urll) How to send it to JS?????!@#$! Private Function GetPicture(ByVal url As String) As Image Try url = Trim(url) If Not url.ToLower().StartsWith("http://") Then url _ = "http://" &amp; url Dim web_client As New WebClient() Dim image_stream As New _ MemoryStream(web_client.DownloadData(url)) Return Image.FromStream(image_stream) Catch ex As Exception End Try Return Nothing End Function
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
tagged with: vb.net
has comment: http://stackoverflow.com/comment/44295532
downvote count: 0

http://stackoverflow.com/comment/44195981
comment on: http://stackoverflow.com/q/27897889
type: Comment
type: QuestionComment
has text: And yet, it works perfectly fine in a --> [**FIDDLE**](http://jsfiddle.net/x8ory16h/)
score: 0

http://stackoverflow.com/comment/44204551
has text: then change that in your code `get_stylesheet_directory_uri`
comment on: http://stackoverflow.com/q/27892069
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44190131
type: QuestionComment
has text: What do you mean by what it is testing? It's testing that the link in the template, see above, goes to the correct route. This works properly, however the tests are failing for this. Do you want to see any specific files? Thanks
comment on: http://stackoverflow.com/q/27890872
score: 0
type: Comment

http://stackoverflow.com/comment/44187571
comment on: http://stackoverflow.com/a/27893168
score: 0
type: AnswerComment
type: Comment
has text: Im not sure I understand what you're saying. The code gets added dynamically?

http://stackoverflow.com/q/27931951
has comment: http://stackoverflow.com/comment/44263824
type: Question
answer count: 2
tagged with: powershell
tagged with: javascript
has answer: http://stackoverflow.com/a/27932385
accepted answer: http://stackoverflow.com/a/27932385
possible better answer: http://stackoverflow.com/a/27932141
upvote count: 1
has body: I am working on a menu that calls PowerShell scripts with wscript.shell and ActiveX. I am passing three variables to wshshell.Run: scriptID, which is the name of a ps1 file, vmName, which is the name of the virtual machine the script will act on, and checkstate, which is the state of the checkbox associated with the menu item. Here is my current non-working code: WshShell = new ActiveXObject("Wscript.Shell"); WshShell.Run("powershell.exe -file " &amp; scriptID &amp; " " &amp; vmName &amp; " " &amp; checkstate, 7, true); This always produces an error stating "The system cannot find the file specified." I have tried following the syntax mentioned here and here with no luck. Both seemed promising but produce the same error I have above. I tested taking the variables out and just running: WshShell.Run("powershell.exe -file test.ps1", 7, true) which works, but WshShell.Run("powershell.exe -file " &amp; "test.ps1", 7, true) fails.
favorite count: 0
tagged with: wsh
linked to: http://stackoverflow.com/q/15351508
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27932141
has title: "System cannot find the file specified" when trying to run PowerShell script
downvote count: 0
score: 1
tagged with: activex
linked to: http://stackoverflow.com/q/27687216

http://stackoverflow.com/comment/44029772
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27810385
has text: @zerkms: oh, thanks for letting me know :) I am just starting to learn jQuery, I was just confused why the variable set up didn't work. That does look like a better approach though.

http://stackoverflow.com/q/27856540
has body: I am trying to write a method for one object that can create a new instance of a separate object. Is this possible with javascipt? function Library () { this.name = "My Library"; this.createShelf = function () { &lt;some code&gt; }; } function Shelf (shelfNumber) { this.shelfNumber = shelfNumber; } var myLib = new Library(); myLib.createShelf(); Is is possible to create a new instance of Shelf by using a method in Library?
type: Question
score: 0
answer count: 2
has title: Using an object method to instantiate a new object javascript
tagged with: object
has answer: http://stackoverflow.com/a/27856558
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27856702
tagged with: javascript

http://stackoverflow.com/q/27953720
tagged with: iteration
favorite count: 0
has title: Appending text through loop iteration
type: AnsweredQuestion
has body: Not sure why I'm having a hard time with this. I think it's getting late in the day probably but -- I'm pulling database values into an array. The current array is: [1,3]. I'm then stepping through the array and appending a prefix to the values (in this case: "&amp;Plantkey=") in order for the final string to have the format of: &amp;Plantkey=1&amp;Plantkey=3 Here's my code so far: if (array[a].ParameterName == "Plantkey") { var plantKey = array[a].ParameterValue; var plantTemp = []; plantTemp = plantKey.split(","); for (var p = 0; p &lt; plantTemp.length; p++) { var plantKeyString = ("&amp;Plantkey=" + plantTemp[p]); } } I'm only getting the last array value (&amp;Plantkey=3). With javascript, it doesn't like me instantiating the "var plantKeyString" and adding the "+=" operator. If I instantiate the array above the for loop, like so: var plantKeyString; for (var p = 0; p &lt; plantTemp.length; p++) { plantKeyString += ("&amp;Plantkey=" + plantTemp[p]); } Then I end up with a longer string, including the array values I want but it also pulls in the "undefined" value that it finds at the beginning so it looks like this: undefined&amp;Plantkey=1&amp;Plantkey=3 I could easily look for the "undefined" and remove it but I'm sure the problem is with the loop iteration, not the data, obviously. Any help would be greatly appreciated! Thanks!
type: Question
possible better answer: http://stackoverflow.com/a/27953831
has answer: http://stackoverflow.com/a/27953831
tagged with: arrays
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27953785
accepted answer: http://stackoverflow.com/a/27953785
answer count: 2
tagged with: for-loop
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/27819291
score: 2
has body: There is no closure in your code1. test returns a function object, but that [function] is not executed. In the snippet, 3 closures are used in the inner function, the returned function object is assigned to a variable, and that is executed. The advantage of returning a function object is that you can assign it to different values and execute them separately. 1 Earlier version of the question mentioned 'closure not working' // startInterval: interval 1 second, message: 'Hello' (default) var startInterval = test(null, 1000); // anotherInterval: interval 5 seconds, message: ''Hello to you too'' var anotherInterval = test('Hello to you too', 5000); // execute the function objects startInterval(); anotherInterval(); // [hithere], [time] and [result] are closed over function test(hithere, time){ hithere = hithere || 'Hello'; time = time || 1000; var result = document.querySelector('#result'); return function(){ setInterval(function(){ result.innerHTML += hithere+' '; },time || 1000); } } Greetings!
downvote count: 0
answers question: http://stackoverflow.com/q/27819108
upvote count: 2
type: Answer

http://stackoverflow.com/comment/44102591
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27849064
has text: @Sampsa It is fine tool but I can not find anything about double colon(::) syntax from your snippet. Is it from specification or draft?

http://stackoverflow.com/a/30105571
type: Answer
upvote count: 1
score: 1
downvote count: 0
has body: I had same challenge, this is how I solved: this.Then(/^I should see my user entry with proper values in the list$/, function (callback) { var verifyUser = Q.all([ usersPage.verifyUserFirstName('tony@gmail.com'), usersPage.verifyUserLastName('tony@gmail.com'), usersPage.verifyUserPhone('tony@gmail.com') ]); expect(verifyUser).to.eventually.deep.equal(['Tony', 'Bui', '8764309111').and.notify(callback); } I hope that helps!
answers question: http://stackoverflow.com/q/27865536

http://stackoverflow.com/q/27916656
tagged with: calendar
type: AnsweredQuestion
tagged with: magento
score: 1
tagged with: javascript
has title: Getting " TypeError: triggerElement is null " error in magento on product page using calendar
tagged with: prototype
type: Question
answer count: 1
downvote count: 0
favorite count: 0
has body: i am facing this error " TypeError: triggerElement is null triggerElement.onclick = function() { " when I installed a booking module on magento v-1.8.1.0. which is using a calendar for its functionality. Calendar.setup = function(params) { function param_default(name, def) { if (!params[name]) params[name] = def } param_default('dateField', null) param_default('triggerElement', null) param_default('parentElement', null) param_default('selectHandler', null) param_default('closeHandler', null) // In-Page Calendar if (params.parentElement) { var calendar = new Calendar(params.parentElement) calendar.setSelectHandler(params.selectHandler || Calendar.defaultSelectHandler) if (params.dateFormat) calendar.setDateFormat(params.dateFormat) if (params.dateField) { calendar.setDateField(params.dateField) calendar.parseDate(calendar.dateField.innerHTML || calendar.dateField.value) } calendar.show() return calendar } // Popup Calendars // // XXX There is significant optimization to be had here by creating the // calendar and storing it on the page, but then you will have issues with // multiple calendars on the same page. else { var triggerElement = $(params.triggerElement || params.dateField) triggerElement.onclick = function() { var calendar = new Calendar() calendar.setSelectHandler(params.selectHandler || Calendar.defaultSelectHandler) calendar.setCloseHandler(params.closeHandler || Calendar.defaultCloseHandler) if (params.dateFormat) calendar.setDateFormat(params.dateFormat) if (params.dateField) { calendar.setDateField(params.dateField) calendar.parseDate(calendar.dateField.innerHTML || calendar.dateField.value) } if (params.dateField) Date.parseDate(calendar.dateField.value || calendar.dateField.innerHTML, calendar.dateFormat) calendar.showAtElement(triggerElement) return calendar } } } I am getting this error on page load, can anybody please guide me in debugging this error? Thanks in advance.
has answer: http://stackoverflow.com/a/27917034
accepted answer: http://stackoverflow.com/a/27917034
upvote count: 1

http://stackoverflow.com/comment/136858009
score: 13
type: Comment
has text: @stackers reinventing the wheel is not beautiful
type: AnswerComment
comment on: http://stackoverflow.com/a/41474728

http://stackoverflow.com/q/27828750
tagged with: javascript
has comment: http://stackoverflow.com/comment/44063621
favorite count: 0
has answer: http://stackoverflow.com/a/27828872
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: web
possible better answer: http://stackoverflow.com/a/27829153
has answer: http://stackoverflow.com/a/27829153
upvote count: 2
answer count: 3
has title: Read more on Database result
has body: Hi there my code is quite simple but Id like for the design purposes to keep everything neat , at the moment Im pulling all the description which is like Some could be huge others can be quite small , anyway to make it fair I decided to make a read more button and once I click it just expand on the text like , SO somehow to make it show the first 160 characters after that ... then ReadMore link button that when you click it expands and shows the whole text Heres my script that I use for now : &lt;p&gt;&lt;?PHP echo $thismovie['description']; ?&gt;&lt;/p&gt; &lt;div style="text-align:right"&gt; So I would like to know how this is done and if possible only using javascript, thanks !
tagged with: php
accepted answer: http://stackoverflow.com/a/27828872
tagged with: mysql
has comment: http://stackoverflow.com/comment/44063712
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27828861
has comment: http://stackoverflow.com/comment/44063821
downvote count: 0

http://stackoverflow.com/comment/44091246
has text: This is useful and appreciated, but @devqon's answer solved my problem.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27842557

http://stackoverflow.com/q/27844732
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
has answer: http://stackoverflow.com/a/27881645
type: Question
has body: When a user has drawn a polygon in Google Maps using the built in Drawing Manager I save the polygon path. I want to convert this polygon path to an SVG path so that I can reproduce the shape of the polygon drawn easily, without requiring lots of additional map loads and calls to the Google Maps API. I'm sure it's just some fairly trivial mathematics but can't work out how to do it. Do I need to create a bounding box around the points and translate it to LatLng 0, 0 before scaling it down or can I do something simpler using just the LatLng coordinates of each point? I've found lots of questions asking to achieve the opposite, converting SVG to a map polygon but not this. Any pointing me in the right direction appreciated.
answer count: 2
tagged with: polygon
tagged with: google-maps
downvote count: 0
accepted answer: http://stackoverflow.com/a/27881645
tagged with: javascript
linked to: http://stackoverflow.com/q/14329691
favorite count: 0
has title: Convert a Google Maps polygon path to an SVG path
possible better answer: http://stackoverflow.com/a/27850119
tagged with: path
has answer: http://stackoverflow.com/a/27850119

http://stackoverflow.com/a/27828224
score: 3
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/27828126
has body: the new keyword is used as a piece of pseudoclassical instantiation, wherein a constructor object has properties attached to the keyword "this" but no return value is ever written. var Car = function(){ this.color = 'blue'; this.make = 'toyota'; this.model = 'camry'; } now, writing var x = new Car() will add the following lines to the interpretation: var Car = function(){ var this = {}; //added by new this.color = 'blue'; this.make = 'toyota'; this.model = 'camry'; return this; //added by new }
downvote count: 0

http://stackoverflow.com/comment/44027714
has text: `Element.getElementsByTagName('img')[0]` or `$('.post-content img')[0]`. Why use `querySelectorAll` if using jQuery?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27809348

http://stackoverflow.com/comment/44114077
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27851617
has text: Thanks it works! I wasn't aware i could use a "," at the change function, i have tried adding && also, but that didn't work.

http://stackoverflow.com/comment/44093993
has text: If message_id is autoincrement, that should work for testing if the message is shown yet. Just keep track of the highest message_id the client has received. (This is assuming you send all messages every x seconds rather than literally one message at a time)
comment on: http://stackoverflow.com/q/27844953
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44117091
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27856975
has text: A form doesn't have a value ?
score: 0

http://stackoverflow.com/comment/44388247
has text: Thank you for your help. I fixed my code as per your suggestion, using socketio and mongodb. Thanks a ton! Cheers!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27909076

http://stackoverflow.com/a/27918381
upvote count: 1
has comment: http://stackoverflow.com/comment/44234795
has comment: http://stackoverflow.com/comment/44234835
answers question: http://stackoverflow.com/q/27918100
downvote count: 0
has comment: http://stackoverflow.com/comment/44235402
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/44236138
has body: Use this code, $(document).ready(function () { $("#rOD").change(function () { if ($("#rOD input:checked").val() == "Dealer") { $("#txtDName").removeAttr("disabled"); $("#txtDName").focus(); } else { $("#txtDName").attr("disabled", "disabled"); } }); }); function fc(elem) { $(elem).focus(); } here is the result,
has comment: http://stackoverflow.com/comment/44235015

http://stackoverflow.com/comment/44303828
comment on: http://stackoverflow.com/q/27953788
type: Comment
score: 0
has text: Have you considered [Variation Swatches](http://www.woothemes.com/products/variation-swatches-and-photos/)?
type: QuestionComment

http://stackoverflow.com/a/27812627
type: Answer
has comment: http://stackoverflow.com/comment/44033329
answers question: http://stackoverflow.com/q/27812495
score: 0
has body: $("a").html(''+img+'');
has comment: http://stackoverflow.com/comment/44033037

http://stackoverflow.com/a/27845900
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27832360
has body: Update your selector so that it targets the option tags which has the data-info attribute. Try changing $this.attr("data-info") to $this.children('option:selected').attr("data-info"). function onChange() { var $this = $(this); var $e = $(this.target); $('#selectList').popover('destroy'); $("#selectList").popover({ trigger: 'manual', placement: 'right', content: $this.children('option:selected').attr("data-info") //this }).popover('show'); } JSFiddle

http://stackoverflow.com/q/27894128
type: Question
score: 0
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27894506
has answer: http://stackoverflow.com/a/27894171
has title: Uncaught SyntaxError: Unexpected identifier
has body: <?php include("config.php"); include("meniu.php"); include("meniuV.php"); echo " "; echo " "; session_start(); ?> <?php $sql="SELECT * FROM meciuri WHERE data='2015-01-10'"; $resursa=mysql_query($sql); if(!$resursa) { exit(mysql_error()); } if(mysql_num_rows($resursa)==0) { print 'Nu s-a gasit niciun rezultat! '; } echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " Uefa Champions League "; echo " 1 "; echo " X "; echo " 2 "; echo " 1x "; echo " x2 "; echo " "; echo " "; echo " "; $resursa=mysql_query($sql); while($row = mysql_fetch_array($resursa)) { $idConta1=$row['id_meci']."_1"; $idConta2=$row['id_meci']."_2"; $idConta3=$row['id_meci']."_3"; $idConta4=$row['id_meci']."_4"; $idConta5=$row['id_meci']."_5"; $meci1=$row['nume_meci']; print' ' .$row['nume_meci'] . ' ' .$row['victorie_1'] . ' ' .$row['egal_x'] . ' ' .$row['victorie_2'] .' ' .$row['victorie_egal_1x'] .' ' .$row['victorie_egal_x2'] .' '; } echo " "; echo " "; echo " "; ?> I want to select one name and one number from database and put them in a separate div, next to the table. When i try to select only the number (' .$row['egal_x'] . ') it works but if i want to add the name (' .$row['victorie_1'] . ') i don't get anything in that div and it shows me that error... Can someone tell me how i can can fix that?
type: UnansweredQuestion

http://stackoverflow.com/q/27927807
type: Question
answer count: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/27929221
score: 0
type: UnansweredQuestion
tagged with: encryption
has body: Is there a method to encrypt text and the output to be a common english/spanish text or alike, and be able to decrypt it too? I tried the Caesar encryption http://en.wikipedia.org/wiki/Caesar_cipher Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD but I'd like the output for example: Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG Ciphertext: RADIO LIBRARY MAKE TABLE TIME ON KITCHEN DAY OF
has answer: http://stackoverflow.com/a/27927929
has answer: http://stackoverflow.com/a/27931878
has title: Encrypted text like english text

http://stackoverflow.com/q/27929547
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44256195
has title: Javascript storing actual name of a string variable rather than its value in localStorage
has comment: http://stackoverflow.com/comment/44256373
has body: I want to generate a new string variable everyday and store it into the local storage as a new entry. The format of the string is "timeDataXXXX" where XXXX is a number showing number of days since midnight January 1 1970. XXXX is calculated and returned by a function numDaysSinceUTC(); Here is what I try to do var newStorageName = "timeData" + numDaysSinceUTC(); Then I feed it into the local storage chrome.storage.local.set({newStorageName : 0}, function(){}); Then when I check the contents of local storage rather than getting something corresponding to the format, I get literally "newStorageName" as the content(key), the variable name not the value of it. Which ends up overwriting. What is wrong?
tagged with: storage
has answer: http://stackoverflow.com/a/27929770
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27929672
tagged with: google-chrome
tagged with: local-storage
possible better answer: http://stackoverflow.com/a/27929770
type: Question
accepted answer: http://stackoverflow.com/a/27929672

http://stackoverflow.com/comment/44176009
comment on: http://stackoverflow.com/a/27887518
type: AnswerComment
score: 0
type: Comment
has text: Again, given that he has `data-bind` attributes on his elements, it's likely that OP is using a framework, and doing that will interfere.

http://stackoverflow.com/q/27884512
has title: How to click or select the correct javascript array
type: UnansweredQuestion
type: Question
score: 0
tagged with: arrays
answer count: 1
tagged with: javascript
has body: I am at my wits end. First let me start I am a total newb to JavaScript and am self learning. I am trying to ask these questions: Click the Shape in the Title Then display a series of shapes How can I show an array of shapes and click on the correct shape in the title? I also want to store this and give it a point for each correct shape selected. Here is my jsFiddle: http://jsfiddle.net/arevee/04y7zx0d/ var shapeName = ["Square", "Rectangle"]; // Random Shape to Select Title var shapesTitle = shapeName[Math.floor(Math.random() * shapeName.length)]; document.getElementById("IdShapeTitle").innerHTML = shapesTitle.toString(); var varSquare = document.getElementById("square"); var varRect = document.getElementById("rect"); varSquare.onclick = function () { alert("I am square"); }; varRect.onclick = function () { alert("I am rectangle"); }; document.getElementById("currentName").innerHTML = shapesTitle.toString();
has answer: http://stackoverflow.com/a/27885239

http://stackoverflow.com/a/27905959
score: 1
accepted answer of: http://stackoverflow.com/q/27904757
answers question: http://stackoverflow.com/q/27904757
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: navigator.appCodeName always returns 'Mozilla' on any browser because the property is deprecated and kept only for compatibility purposes. https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID.appCodeName A library like https://github.com/ded/bowser will solve the problem for most browser detection. This library is more exhaustive: https://github.com/bestiejs/platform.js/
downvote count: 0

http://stackoverflow.com/comment/44039550
type: Comment
comment on: http://stackoverflow.com/q/27816666
has text: I know that this is not. Just i supposed that angular can help for this issue
score: 0
type: QuestionComment

http://stackoverflow.com/a/27881545
answers question: http://stackoverflow.com/q/27879884
accepted answer of: http://stackoverflow.com/q/27879884
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You're not providing an error callback for the query, which could be used to provide insight into why your query is failing. See here. You're also calling query().find() but you defined and bound the query to primary and Parse.Query is not a function, but an object. Try primary.find({ success: function(list) { $scope.bizCategories.primary = list; }, error: function(error) { // handle error } }); Also, I don't know if chaining the function call in the way you did is valid either, but I don't use Angular JS so I can't speak to the validity of this. From my perspective, it looks like you're trying to access it as a property of all of that.
has comment: http://stackoverflow.com/comment/44308380
score: 1
upvote count: 1

http://stackoverflow.com/comment/136173627
type: Comment
comment on: http://stackoverflow.com/q/27901136
type: QuestionComment
has text: did you actually find a solution for this?
score: 0

http://stackoverflow.com/comment/44311622
has text: If you don't mind using some jQuery you can try using `$("#psubmit").trigger("click");`
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27958760

http://stackoverflow.com/q/27828154
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27828332
score: 1
linked to: http://stackoverflow.com/q/27829896
has answer: http://stackoverflow.com/a/27828314
has answer: http://stackoverflow.com/a/27828332
upvote count: 1
has body: I have a small C# code behind to refresh a webform page (form.aspx) after 15 seconds as below: lblMessage.Text = " Thank you! We will be right with you. (This page will be refreshed automatically after 15 seconds)"; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Success!", "setInterval(function(){location.href='/form.aspx';},15000);", true); Right now the page will be refreshed after 15 seconds. How do I also make the timer count down every second? i.e., 15 => 14 => 13 => ... 1 then refresh so it will be better for users, they will know what is going on with the page...
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44062457
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/27828314
downvote count: 0
has comment: http://stackoverflow.com/comment/44062634
has title: Auto refresh a page with count down time
tagged with: updatepanel
tagged with: asp.net
favorite count: 0
tagged with: timer

http://stackoverflow.com/comment/44075855
type: QuestionComment
comment on: http://stackoverflow.com/q/27835400
has text: If SPA is made with angular, you can still open direct url. Other ways of doing this are: using cookies to store/load information between tabs or local storage. But they must be in same domain/have same parent.
score: 0
type: Comment

http://stackoverflow.com/a/27813653
answers question: http://stackoverflow.com/q/27813294
has body: There should be Selector for blanket so that you can access its properties, please check your code for blanket, right now what happening there is no blanket selector that`s why its undefined. so please check selector is exist then only you can access its properties. EDIT you should never have two elements on the same page with the same ID.
type: Answer
accepted answer of: http://stackoverflow.com/q/27813294
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/44036579
has text: i am using chromium browser and the file is located in the same folder
comment on: http://stackoverflow.com/q/27814867
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27936837
answer count: 1
has comment: http://stackoverflow.com/comment/44271177
downvote count: 0
has answer: http://stackoverflow.com/a/27937072
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 1
has body: I trying to play sound on list hover or mouseenter . this list have img inside the a attribute this it html code and js function playclip() { var audio = document.getElementsByTagName("audio")[0]; audio.play(); } asdf2 asdfg1 once i put the mouse inside a it play sound. Go to image and back to a its play again how to make sound play only one time until it go out the li itself
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27937072
has title: Play sound on hover with image
upvote count: 1

http://stackoverflow.com/comment/44251148
type: Comment
has text: Can you try with this code **[JS FIDDLE](http://jsfiddle.net/fyqczaL5/)**
comment on: http://stackoverflow.com/q/27924221
score: 0
type: QuestionComment

http://stackoverflow.com/a/27830021
downvote count: 0
has comment: http://stackoverflow.com/comment/44094076
has comment: http://stackoverflow.com/comment/44095404
upvote count: 2
has comment: http://stackoverflow.com/comment/44093945
has body: In my own library I created the function getCurrentTime. It's a versatile getter and converter of date and time. This function can create dates from timestamps in microseconds. It allows you to create clocks, calendars, countdown timer, etc. months = "Jan:31;Feb:28;Mar:31;Apr:30;May:31;Jun:30;Jul:31;Aug:31;Sep:30;Oct:31;Nov:30;Dec:31"; function getCurrentTime(unixTimeStamp) { if (unixTimeStamp) { this.dateObject = new Date(unixTimeStamp); } else { this.dateObject = new Date(); } // Time this.dateObject.h = this.dateObject.getHours(); this.dateObject.m = this.dateObject.getMinutes(); if (this.dateObject.m &lt; 10) {this.dateObject.m = "0" + this.dateObject.m;} this.dateObject.s = this.dateObject.getSeconds(); if (this.dateObject.s &lt; 10) {this.dateObject.s = "0" + this.dateObject.s;} //Date this.dateObject.y = parseInt(this.dateObject.getFullYear()); this.dateObject.mo = this.dateObject.getMonth()+1; if (this.dateObject.mo &lt; 10) {this.dateObject.mo = "0" + this.dateObject.mo;} this.dateObject.d = this.dateObject.getDate(); if (this.dateObject.d &lt; 10) {this.dateObject.d = "0" + this.dateObject.d;} this.today = this.dateObject.d + "/" + this.dateObject.mo + "/" + this.dateObject.y; this.now = this.dateObject.d + "/" + this.dateObject.mo + "/" + this.dateObject.y + " " + this.dateObject.h + ":" + this.dateObject.m + ":" + this.dateObject.s; this.dateStamp = Date.parse(this.dateObject.mo+"/"+this.dateObject.d+"/"+this.dateObject.y); //these are the objects returned by getCurrentTime() next to hour, minutes, seconds, year, month and date. this.dateObject.fullDate = this.dateObject.d + " " + months.split(/;/)[this.dateObject.mo-1].split(/:/)[0] + " " + this.dateObject.y; this.dateObject.timeZoneOffset = dateObject.getTimezoneOffset(); //in minutes. this.dateObject.today = this.today; this.dateObject.now = this.now; this.dateObject.dateStamp = this.dateStamp; return this.dateObject; } timeStamp = &lt;%= ConvertToTimestamp(DateTime.UtcNow).ToString() %&gt; setInterva…
has comment: http://stackoverflow.com/comment/44093984
has comment: http://stackoverflow.com/comment/45254684
answers question: http://stackoverflow.com/q/27829896
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44102407

http://stackoverflow.com/q/27951431
score: 1
upvote count: 1
type: Question
has body: When i mouse over on row in a table, image is displayed and when mouse over on image a tooltip is shown. When i mouse over on the options in tooltip(i.e., test1,test2) , option on which mouse cursor is placed should highlight or change its background color to let user know which option from tooltip they are about to click. Please find the fiddle http://jsfiddle.net/0w9yo8x6/65/ Below is the sample javascript code: $(function() { var rowData; $(document).tooltip({ items: "img, [data-title]", content: function () { var element = $(this); if (element.is("img")) { rowdata = element.attr("data-title"); $(document).off('click', '#test'); $(document).on('click', '#test', function() { test(); }); } return $(this).prop('title'); }, show: null, close: function (event, ui) { ui.tooltip.hover( function () { $(this).stop(true).fadeTo(1000, 1); }, function () { $(this).stop(true).fadeOut(200, function () { $(this).remove(); }) }); }, position: { my: "left", at: "right" } }); }); $(function () { $('.one').attr('title', $('.myTooltipTable').remove().html()); $(document).tooltip(); });
tagged with: javascript
has answer: http://stackoverflow.com/a/27951507
answer count: 2
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27951633
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27951633
accepted answer: http://stackoverflow.com/a/27951507
tagged with: css
has title: change background color on mouse over in tooltip
type: AnsweredQuestion
favorite count: 0

http://stackoverflow.com/comment/44289350
type: AnswerComment
has text: And in your browser's console, what errors do you get?
comment on: http://stackoverflow.com/a/27946989
type: Comment
score: 0

loopbackjs
tags question: http://stackoverflow.com/q/27826083
type: Tag
tags question: http://stackoverflow.com/q/27874880
tags question: http://stackoverflow.com/q/27857033
tag name: loopbackjs

http://stackoverflow.com/q/27905822
accepted answer: http://stackoverflow.com/a/27969349
has title: How to remove qq-uploader from selected table row?
tagged with: css
type: AnsweredQuestion
tagged with: asp.net-mvc-3
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27969349
answer count: 1
tagged with: jquery
has body: I'm working on a file-upload feature in my MVC 3 application. I have it working correctly (kinda), the problem is within the onComplete function when I try to remove the qq-uploader class, it gets removed from all the checked table cells. The workflow would be as follows, user checks multiple check boxes the "upload file" btn appears in each row checked, but once one upload is complete in one row the 'qq-uploader class is removed from all cells not just the cell where the file was uploaded. The table row cell in question : @if (Model.ElementAt(index).CertName != null) { @Html.DisplayFor(m => Model.ElementAt(index).CertName) } else { } Script used in view : $(document).ready(function () { function handleCheckbox() { if ($(this).find(':checkbox').is(':checked')) { $(this).find('.file-uploader-attachment-Class').removeClass("upload-placeholder-unchecked"); createUploader($(this)); } else { $(this).find('.file-uploader-attachment-Class').addClass("upload-placeholder-unchecked"); $(this).find('.file-uploader-attachment-Class').html($('#myHTML2').html()); } } $('tr').each(handleCheckbox); $('tr').on('click', handleCheckbox); function createUploader(container) { var elements = container.find('.file-uploader-attachment-Class'); var CAL_ID = container.find(':checkbox').val() var row = $(this).parent(); Array.prototype.filter.call(elements, function (element) { var uploader = new qq.FileUploader({ element: element, sizeLimit: 2147483647, // max size action: '/CalibrationViewer/AttachmentUpload', allowedExtensions: ['xls', 'xlsx', 'pdf', 'doc', 'docx', 'csv', 'txt', 'rtf', 'zip', 'zipx', '7z'], params: { customer: CUST_NAME, calibrationId: CAL_ID }, multiple: false, debug: false, onComplete: function (id, fileName, responseJson) { alert(responseJson.msg); $('.qq-uploader').remove(); elements.closest('.file-uploader-attachment-Class').prepend(' Uploaded ') } }); }); } });

http://stackoverflow.com/q/27825459
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27829138
score: 0
has comment: http://stackoverflow.com/comment/44064443
tagged with: http://stackoverflow.com/tag/xml
has body: Zapier has a scripting language but no way to really test in real-time. So I want to use their example for my own connection/data. I have an application that uses XML for their API output, Zapier requires JSON to function. So it requires me to convert from XML to JSON using the link below. Here is the link to Zapier's scripting example to convert XML to JSON: Zapier - MadMimi XML to JSON How can I get that working in JSFiddle? The reason I want to get it into JSFiddle is so I can manipulate my XML output. My XML output looks like this: XML Output on PasteBin
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44056855
type: Question
tagged with: underscore.js
has title: Need help getting Zapier scripting example working in JSFiddle
tagged with: http://stackoverflow.com/tag/json
answer count: 1

http://stackoverflow.com/comment/44072340
type: QuestionComment
score: 0
has text: @jaydisc share your demo code
comment on: http://stackoverflow.com/q/27832927
type: Comment

http://stackoverflow.com/comment/44247140
type: Comment
comment on: http://stackoverflow.com/q/27925060
type: QuestionComment
has text: It depends on how the sorting is done and what type of data it is. For example, would it be possible to me to sort by the largest and smallest item at the same time?
score: 0

http://stackoverflow.com/a/28030250
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44445999
type: Answer
has comment: http://stackoverflow.com/comment/44445404
answers question: http://stackoverflow.com/q/27961196
has comment: http://stackoverflow.com/comment/44446950
has body: A chart will not observe filters on its own dimension, so I think you really want the brush option. filter = dc.filters.RangedFilter(filter[0], filter[1]); moveChart.filter(filter); Ranged filter doc You only need to set the filter on the chart; the chart will set the filter on the dimension.
accepted answer of: http://stackoverflow.com/q/27961196
has comment: http://stackoverflow.com/comment/44446555
upvote count: 5
score: 5

swing
tags question: http://stackoverflow.com/q/27851069
type: Tag
tag name: swing
tags question: http://stackoverflow.com/q/27823764

http://stackoverflow.com/a/27952908
has comment: http://stackoverflow.com/comment/44438373
type: Answer
has comment: http://stackoverflow.com/comment/44430635
answers question: http://stackoverflow.com/q/27952907
has body: The answer is pretty simple, it takes longer to access instance[i] in the test function than it does to access title(). To fix the test I replaced the test function with two variables: instanceOne = instances["-1"] instanceFive = instances["5"] Then the two test cases are simple: instanceOne.title() and instanceFive.title() The results are as you would expect: No inheritance chain - 762,760,656 - fastest 5 parents - 717,293,580 - 6% slower
score: 0

http://stackoverflow.com/a/39541878
score: 5
has body: In the current Webpack version ( 1.13.2 ) this CAN be done. From the documentation: To use the inline mode, either specify --inline on the command line. specify devServer: { inline: true } in your webpack.config.js
has comment: http://stackoverflow.com/comment/68221685
upvote count: 5
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27844087

http://stackoverflow.com/a/27930590
upvote count: 2
answers question: http://stackoverflow.com/q/27930502
downvote count: 1
has comment: http://stackoverflow.com/comment/44258508
has comment: http://stackoverflow.com/comment/44258422
type: Answer
has comment: http://stackoverflow.com/comment/44258688
has body: in C# a for statement expects an init-statement, a bool experssion, an increment-statement You could split this in two cases: _ref = (int) Math.Floor((double)array.Count / 2); // assuming this can go negative... if(0 &lt;= _ref) { for (int _j = 0; _j &lt; _ref; _j++) { _results1.Add(_j); } } else { for (int _j = 0; _j &gt; _ref; _j--) { _results1.Add(_j); } } if you like it shorter you may delete all curly braces...
has comment: http://stackoverflow.com/comment/44258539
score: 1
has comment: http://stackoverflow.com/comment/44258640
has comment: http://stackoverflow.com/comment/44258484
has comment: http://stackoverflow.com/comment/44258702
has comment: http://stackoverflow.com/comment/44258789

http://stackoverflow.com/comment/44041437
score: 0
type: AnswerComment
type: Comment
has text: $scope.model = { Questions:{Question:"Your Question", Options:["option1","option2"]} }
comment on: http://stackoverflow.com/a/27817389

http://stackoverflow.com/a/27813430
answers question: http://stackoverflow.com/q/27813359
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44033951
upvote count: 2
type: AcceptedAnswer
has body: Base64 images are more trivial because you just have to stick the base64 into the image source, other things like text need to be decoded. See https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding success: function (data) { var extension = fileName.split('.').pop(); if (extension == "jpg") { var image = new Image(); image.src = "data:image/jpg;base64," + data.d; var w = window.open(""); w.document.write(image.outerHTML); } else if(extension == "txt") { var w = window.open(""); w.document.write(window.atob(data.d)); } }
accepted answer of: http://stackoverflow.com/q/27813359
type: Answer

http://stackoverflow.com/a/27902984
has comment: http://stackoverflow.com/comment/44205739
has comment: http://stackoverflow.com/comment/44205650
has comment: http://stackoverflow.com/comment/44205497
has comment: http://stackoverflow.com/comment/44205981
has comment: http://stackoverflow.com/comment/44206359
answers question: http://stackoverflow.com/q/27902293
downvote count: 0
has comment: http://stackoverflow.com/comment/44205352
has body: I think that you could achieve your goal editing accept property of droppable in this way accept: function(draggable) { return $(this).find(".col-sm-4").length == 0; } in this way the function will allow the draggable elements only if there is no element with class col-sm-4 inside it
type: Answer
has comment: http://stackoverflow.com/comment/44206202
score: 1
upvote count: 1

http://stackoverflow.com/a/27892728
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27892515
answers question: http://stackoverflow.com/q/27892515
type: AcceptedAnswer
has body: Try this: @media screen and (max-width:480px) { body { font-size:0.7em; } } Also, read here

http://stackoverflow.com/comment/44096772
has text: Are you getting a *syntax error* or a different type of error? As a note for the future: when you ask a question here, put the *exact* error message, don't just say "I get an error".
score: 1
comment on: http://stackoverflow.com/q/27846389
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44208945
type: QuestionComment
has text: Try `return res.send('test')`
score: 0
comment on: http://stackoverflow.com/q/27904913
type: Comment

http://stackoverflow.com/comment/44210660
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27904397
has text: still works on the fiddle but I don't know why it won't work on my page. I've added the script source, the embedded iframe and the javascrip but it won't work. Any idea why this might be happening?
type: AnswerComment

http://stackoverflow.com/comment/44334320
type: Comment
has text: I'm wrestling with this identical issue right now - did you ever to manage to solve this? Thanks!
score: 0
comment on: http://stackoverflow.com/q/27825943
type: QuestionComment

http://stackoverflow.com/comment/44042716
comment on: http://stackoverflow.com/a/27816759
has text: Ohhh from a javascript file, well that shouldn't be to hard. Since it was possible before (in the window) that means the variable is still accessible. Then you can just call it directly. So: ` `window.yourvaraible` almost all variables are global in javascript :)
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44298562
comment on: http://stackoverflow.com/a/27951484
type: Comment
score: 0
type: AnswerComment
has text: Thank you. Didn't notice that one.

http://stackoverflow.com/comment/44288614
type: QuestionComment
comment on: http://stackoverflow.com/q/27912157
has text: No... i would look into modify the source code for your purposes if the spacing trick doesn't work out or you need better control.
score: 0
type: Comment

http://stackoverflow.com/a/45306397
score: 9
answers question: http://stackoverflow.com/q/27844407
has body: I know this is an old question but just posting in case this helps anyone who finds it. If you're like me and just wanted to make sure you're getting all the right data into a string for a simple test, you could do something like this. Maybe a little complicated but was helpful when I had a long string I needed to check was formed correctly and had the right content. You could definitely pair this with the console.group() mentioned in the accepted (canon's) answer too. function consoleLog(str, blockSize) { // blockSize is a parameter only to support the tests. if (blockSize === undefined) { blockSize = 1024; } var limit = Math.floor(str.length / blockSize); for (var k = 0; k &lt; limit+1; k++) { if (k == limit) console.log(str.substring(blockSize*k, str.length)); else console.log(str.substring(blockSize*k, blockSize*(k+1))); } } // Tests. // Should print: // aaaaa // bbbbb // c consoleLog('aaaaabbbbbc', 5); // Should print: // aaaaa // bbbbb consoleLog('aaaaabbbbb', 5);
upvote count: 9
type: Answer
has comment: http://stackoverflow.com/comment/90381547
downvote count: 0

http://stackoverflow.com/q/27912715
has comment: http://stackoverflow.com/comment/44225357
answer count: 1
has comment: http://stackoverflow.com/comment/44239403
has comment: http://stackoverflow.com/comment/44239854
accepted answer: http://stackoverflow.com/a/27933792
tagged with: google-api
has comment: http://stackoverflow.com/comment/44252958
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27933792
has comment: http://stackoverflow.com/comment/44231285
has comment: http://stackoverflow.com/comment/44239753
has comment: http://stackoverflow.com/comment/44239297
has title: GAS: Unable to use HtmlService custom dialogs in Firefox
type: Question
tagged with: google-apps-script
tagged with: google-sheets-api
has body: I am trying to create a custom dialogue in Google Apps Script as follows: function onOpen() { SpreadsheetApp.getUi() .createMenu('Custom Menu') .addItem('Show dialog', 'showDialog') .addToUi(); } function showDialog() { var html = HtmlService.createHtmlOutputFromFile('Page') .setSandboxMode(HtmlService.SandboxMode.IFRAME) .setWidth(400) .setHeight(300); SpreadsheetApp.getUi() // Or DocumentApp or FormApp. .showModalDialog(html, 'My custom dialog'); } Where Page.html is: Hello, world! &lt;input type="button" value="Close" onclick="google.script.host.close()" /&gt; In Chrome it works as expected. In Firefox 34, the dialogue shows but, when I click on the close button, it does not trigger the callback google.script.host.close(). Firebug reports the error: ReferenceError: google is not defined userCodeAppPanel (line 1)
tagged with: javascript
has comment: http://stackoverflow.com/comment/44236905
score: 0

http://stackoverflow.com/comment/44173895
type: AnswerComment
has text: V8 can step into async execution stacks for about half a year and has async stack traces - haven't used them in node yet though.
comment on: http://stackoverflow.com/a/27884014
type: Comment
score: 0

http://stackoverflow.com/comment/44053025
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27823480
has text: the window.open is on another webpage, not part of the extension. sorry if this was unclear
type: Comment

http://stackoverflow.com/comment/44228844
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27914742
has text: Don't make functions valuable global unless you want real issues in the future.
score: 0

http://stackoverflow.com/q/27913313
type: Question
has comment: http://stackoverflow.com/comment/44226190
tagged with: javascript
has title: JavaScript iterations and conditional statements
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/44226126
has body: Following snippet shows a block of code which is executed at each request. At each request, now variable changes with the current time. var now = parseInt(parseInt(Math.round(new Date())).toString().slice(0, -4)) // Real ad_time is 1421108173. But we're splicing the last second. var ad_time = 142110817; var ad_duration = 30; if (now == ad_time_10) { // do some stuff } else if (now == ad_time_10+1) { // do some other stuff } else if (now == ad_time_10+2) { // do some another stuff } else if (now == ad_time_10+3) { // do some very different stuff } else if (now == ad_time_10+4) { // do some very really different stuff } . . . . ad_time_10 and ad_duration are previously set variables. ad_time_10 is 10th second of a given time. The reason is I need to do some stuff at 10th seconds of the current time. ad_duration variable determines how many if statements will exist. For example, if ad_duration is 30 seconds, I need to check 5 requests after it. If ad_duration is 120 seconds, I will need to check 14 requests. If ad_duration is 240 I will need to check 26 requests and so on... So how can I do this job without manually checking for conditions? Thanks
has comment: http://stackoverflow.com/comment/44226015
has comment: http://stackoverflow.com/comment/44226461
has comment: http://stackoverflow.com/comment/44226074
has comment: http://stackoverflow.com/comment/44226043
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/44226053
answer count: 0

http://stackoverflow.com/comment/44277459
comment on: http://stackoverflow.com/q/27940753
type: Comment
has text: Is your prixID in the Master page and the script in the web form?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44046730
has text: Can we see the rest of the code, how are you firing grandtotal()? Also, $('#grandtotal').val(total);
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27820532

http://stackoverflow.com/q/27909560
has body: I'm a Gulp JS beginner. Currently I'm trying to compile some simple less code to CSS. My Gulp task should output a new CSS file for this but after I run the task, nothing happens. I've included the gulp-util module to try to debug the task execution but it doesn't show me any errors. Here's my Gulp file: // gulpfile.js // --- INIT var gulp = require('gulp'), util = require('gulp-util'), less = require('gulp-less'), // compiles less to CSS minify = require('gulp-minify-css'), // minifies CSS concat = require('gulp-concat'), rename = require('gulp-rename'), uglify = require('gulp-uglify'); // minifies JS // Paths variables var paths = { 'dev': { 'less': './laravel/public/assets/less/' }, 'assets': { 'css': './laravel/public/assets/css/ ', 'js': './laravel/public/assets/js/', 'vendor': './laravel/public/assets/bower_vendor/' } }; // --- TASKS // Auth CSS gulp.task('auth.css', function(){ return gulp.src(paths.dev.less + 'auth.less') .pipe(less().on('error', util.log)) .pipe(gulp.dest(paths.assets.css)) .pipe(minify({keepSpecialComments:0})) .pipe(rename({suffix: '.min'})) .pipe(gulp.dest(paths.assets.css)); }); // --- WATCH // --- DEFAULT gulp.task('default', ['auth.css']); I'm using Laravel 4. This file lives in the root directory. I have changed the paths but that doesn't seem to work either. Any ideas?
has answer: http://stackoverflow.com/a/27910081
type: Question
has title: Gulp JS doesn't output CSS file
tagged with: javascript
has answer: http://stackoverflow.com/a/27910090
score: 0
answer count: 2
tagged with: gulp
type: UnansweredQuestion

http://stackoverflow.com/comment/44122601
has text: How do i do it with jQuery then?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27860089
type: AnswerComment

http://stackoverflow.com/q/27887296
has body: I have a custom polymer element inside body element. If I add styles like width : 100px to the custom element, they are not applied. But once I add vertical layout to the body element, the rules get applied. Can somebody please explain why is this happenint, is there a workaround, or am i missing something? Thank you.
has comment: http://stackoverflow.com/comment/44219858
type: Question
score: 0
answer count: 1
has title: Styles applied to custom polymer element only inside an element with layout attribute
tagged with: javascript
has answer: http://stackoverflow.com/a/27917070
tagged with: web-component
tagged with: css
tagged with: custom-element
accepted answer: http://stackoverflow.com/a/27917070
type: AnsweredQuestion
tagged with: polymer

http://stackoverflow.com/comment/44239302
score: 0
comment on: http://stackoverflow.com/q/27920901
has text: While inspecting the page in Firefox, I see that a GET request gets sent to "`https://www.maxmind.com/geoip/v2.1/city/your.ip.here`" when you click "submit". Maybe you could query that page directly instead of the "geoip-demo" page.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44301244
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27952951
has text: This looks a lot like [this question](http://stackoverflow.com/questions/2204250/check-if-checkbox-is-checked-with-jquery)

http://stackoverflow.com/q/27829534
upvote count: 1
tagged with: marionette
answer count: 1
tagged with: events
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/44093470
has title: Prevent hover on an element when scrolling event happened
has comment: http://stackoverflow.com/comment/44066688
has body: I've built a dropdown widget using backbone/marionette that let you use keyboard to navigate up and down the dropdown list. I need to make the distinction between selected and highlighted so I am storing the boolean value in the list item model's isSelected and isHighlighted. Whenever the item is hovered, the isHighlighted is changed to true. Here is my problem, I have setup the dropdown list to have a maxItem, so when there's too many items in the dropdown, I am showing a scrollbar so people can scroll to see more list items. When I use the keyboard navigation to navigate pass that maxItem limit, I call for an animate and scrollTop a certain distance so that the highlighted stay in view. The problem is if I happen to have the mouse within the dropdown list and this scrolling happened, it will trigger a mouseenter event on the item that is at where the mouse pointer is. Then it will change the hovered element's isHighlighted to true. That means the highlighted item went back up and when I use keyboard to navigate down again, it will go down from top instead of continue from where I was before. Is there anyway I can prevent the mouseenter event when the scroll event fires? Trying to include all the relevant code, hope this helps: onKeyUp: function (event) { var key = event.which; switch (key) { case 38: // UP this.onUpArrow(); break; case 40: // DOWN this.onDownArrow(); break; default: // default method } }, onDownArrow: function () { if (!this.isDropdownOpen()) { this.openDropdown(); } else { this.dropdown.highlightNext(); this.dropdown.scroll(); } }, In the other file, I have events: { 'mouseenter': 'onMouseEnter' }, onMouseEnter: function (event) { this.triggerMethod('dropdown:option:mouseenter', { event: event, view: this, model: this.model }); }, In yet another file, I have onDropdownOptionMouseenter: function () { var data = _.last(arguments), event = data.event, view = data.view; view.highlight(); } At this point, the scrolling happened, and mouseenter trigger…
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44099287
has comment: http://stackoverflow.com/comment/44100437
type: Question
accepted answer: http://stackoverflow.com/a/27849474
tagged with: javascript
has answer: http://stackoverflow.com/a/27849474

http://stackoverflow.com/a/27858354
downvote count: 0
score: 1
has body: If you just need a single Unicode-aware regular expression, you may not want to pull in the entire XRegExp library + its Unicode plugin for just that. An alternative solution would be to use a build script that compiles the regular expression using Regenerate and the Unicode data packages. Here’s what that would look like in Node.js: var regenerate = require('regenerate'); // Latin script var Latin = require('unicode-7.0.0/scripts/Latin/code-points'); // Greek script var Greek = require('unicode-7.0.0/scripts/Greek/code-points'); var set = regenerate() // Start with an empty set. .add(Latin) // Add Latin script code points. .add(Greek) // Add Greek script code points. // Print the result. console.log(set.toString()); Run npm install regenerate unicode-7.0.0, and then run this script as follows: node generate-regular-expression.js It prints the following output: [A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D00-\u1D2A\u1D2C-\u1D77\u1D79-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2071\u207F\u2090-\u209C\u2126\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A]|\uD800[\uDD40-\uDD8C\uDDA0]|\uD834[\uDE00-\uDE45] This can be used directly as part of a regular expression literal. The main advantage of this approach is that you’ll never have to tweak the regular expression manually. Instead, you can just change the script that generates it by adding or removing some symbols, then running it again. The code of the script is much more readable and maintainable than any regular expression, IMHO. Also, the output is as compact as possible: rather than introducing a…
upvote count: 1
answers question: http://stackoverflow.com/q/27829640
type: Answer

http://stackoverflow.com/comment/44285014
type: Comment
score: 1
type: QuestionComment
has text: @enhzflep Found that netbean generated license header clog up the json output, i.e. making it not in json format. As I cannot resolve I make up another test case, see the below question http://stackoverflow.com/questions/27902181/php-script-json-encode-mysql-request-cannot-pass-through-to-getjson
comment on: http://stackoverflow.com/q/27884103

formfield
type: Tag
tag name: formfield
tags question: http://stackoverflow.com/q/27821884

http://stackoverflow.com/q/27839486
has comment: http://stackoverflow.com/comment/44084059
linked to: http://stackoverflow.com/q/27888617
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44088320
has comment: http://stackoverflow.com/comment/44083407
downvote count: 2
possible better answer: http://stackoverflow.com/a/27850271
type: Question
has comment: http://stackoverflow.com/comment/44083704
tagged with: autocomplete
has title: how to create autocomplete from google.maps.places.autocomplete in ExtJS
tagged with: javascript
score: -1
has body: Please correct me if I'm wrong... I write a code with no errors, in before edit this post. but after i read a comment about how to create a Minimal, Complete, and Verifiable example. I'm very confuse, because my minimal script before didn't work, i cann't include complete code, because my complex code, and I don't have verifiable example. I just need to know how to create autocomplete from google.maps.places to autocomplete my textfield in EXTJS. Thanks before..
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/28553214
tagged with: extjs
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27850271
favorite count: 0
has answer: http://stackoverflow.com/a/28553214

http://stackoverflow.com/comment/44073855
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27834090
has text: Yes, `func1` resolves to `window.func1` after the IIFE has completed.
score: 0

http://stackoverflow.com/comment/44157489
score: 0
type: AnswerComment
type: Comment
has text: My problem is, that if I use this function in jsfiddle from the link of the thread, I receive the error: XMLHttpRequest cannot load https://www.digitec.ch/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access.
comment on: http://stackoverflow.com/a/27877952

http://stackoverflow.com/comment/44068610
has text: Yes, *(1,1)* has two matching rows, both with a value of *0.1* so *0.1 + 0.1 = 0.2*?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27830677

http://stackoverflow.com/q/27868915
tagged with: javascript
tagged with: eval
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44141481
has comment: http://stackoverflow.com/comment/44140748
has body: I am trying to get a Javascript speex library to run within a CSP protected environment. It runs great without CSP and I already fixed most "eval" problems. However - this one is giving me a headache: this.interpolate = Function("buffer", toCompile); See: https://github.com/grantgalitz/XAudioJS/blob/master/resampler.js I tried something like this.interpolate = function buffer () { return toCompile }; but that didn't work. Though I understand the .. well, basics of "Function" versus "function", I can't find working fix. Any help is appreciated. Michaela
has comment: http://stackoverflow.com/comment/44140607
answer count: 0
score: 1
upvote count: 1
type: Question
has title: Rework Function (capital F)
has comment: http://stackoverflow.com/comment/44140870
tagged with: content-security-policy
tagged with: function

http://stackoverflow.com/comment/44758827
score: 0
comment on: http://stackoverflow.com/q/27864990
type: Comment
type: QuestionComment
has text: You could use CSS to `flex: 1 1` all `cpanel-tab` in your `cpanel-tabs` element definition. This would get rid of the need to `flex` in the html.

http://stackoverflow.com/comment/44256438
type: QuestionComment
has text: yea, I misunderstood the question - sorry about that... Comment deleted
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27928718

http://stackoverflow.com/comment/44235544
comment on: http://stackoverflow.com/a/27918189
score: 0
type: Comment
has text: @FossArduino You had `$scope.timeCheck=result;` outside of the function, and it didn't update. result should not be a function. You need to do `result = true` or `result = false` instead of returning true/false.
type: AnswerComment

http://stackoverflow.com/comment/44239500
type: QuestionComment
has text: The GET method also throws error? Your sending a POST with XML but with no payload.
comment on: http://stackoverflow.com/q/27915571
score: 0
type: Comment

grunt-contrib-copy
type: Tag
tag name: grunt-contrib-copy
tags question: http://stackoverflow.com/q/27874238

http://stackoverflow.com/comment/44265960
comment on: http://stackoverflow.com/a/27933223
score: 0
has text: Thank you for the answer. It looks simple and definitely better way to do. Unfortunately, I am not able to change the object to array.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27939403
downvote count: 0
has comment: http://stackoverflow.com/comment/44307704
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27939242
type: AcceptedAnswer
has body: Printing option is a built in browser option so you can't restrict it by any kind of plugins or scripts.
has comment: http://stackoverflow.com/comment/44276742
answers question: http://stackoverflow.com/q/27939242
type: Answer
score: 2

http://stackoverflow.com/comment/44020714
has text: because it's in the script tags which then client side is javascript! You also don't see your jQuery stuff right?
score: 0
comment on: http://stackoverflow.com/q/27805859
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44323993
comment on: http://stackoverflow.com/a/27952375
type: Comment
score: 0
type: AnswerComment
has text: can you try the same thing in chrome private browsing?

http://stackoverflow.com/a/27924793
has body: p is a block level element, so any element after it will be below it. and as you have defined 100px width for a tag, 1) you can do this, #containerText{ display:inline-block; } and define some width to it. 2) Or simply put .square { float:left; } This will float to the left and a tag will just come beside it.
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27924687

http://stackoverflow.com/a/27904826
accepted answer of: http://stackoverflow.com/q/27903959
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has body: For the elements selection, check for the Document.getElementsByClassName documentation. That's a pure javascript solution but if you need to do it in older browsers, try with jQuery's class selector. After you get the list of elements with that class, you can use a traditional for, a native foreach function or jQuery's foreach (again, considering older browsers). To get the HTML value of an element, use the innerHTML attribute. For the Date comparison, get the day/month values with a split over the slash character. and compare its fields manually with the day and month fields in a new Date object. Finally, to change an element's style, use the style attribute. There can be other solutions to this problem but I think this is a common one.
upvote count: 1
answers question: http://stackoverflow.com/q/27903959

http://stackoverflow.com/comment/44028795
score: 0
type: Comment
has text: if `matrix[row][column].data('partOfPath')` is undefined, it will return true because `(undefined != true)` is true.
comment on: http://stackoverflow.com/a/27809949
type: AnswerComment

http://stackoverflow.com/q/27953857
has title: run angular compile only when a certian section of a page has changed
type: Question
has answer: http://stackoverflow.com/a/27985638
has answer: http://stackoverflow.com/a/27967237
tagged with: javascript
has comment: http://stackoverflow.com/comment/44324139
upvote count: 2
answer count: 2
has body: So I am working on a application that has many many sections that are loaded via jquery ajax, some when it starts and some in response to other sections, and some are even nested. What I wan't to be able to do is say "Oh, the content in mainContainer changed?" Well, go compile the code in that section. The reason is that I would like to be able to put ui-sref's into parts of the code we don't otherwise want to mess with yet. I came up with a solution but it isn't working the way I thought, I added a $watch to a custom directive but it fires a bazillion times. Here is the code. Hopefully some one can explain how to get it to run once only when the content in X &lt;div&gt; is changed via one of the many ajax calls that happen, that way I don't need to immediately turn all of the old code into angular and can link to new code that is using angular. app.directive('ngMainContainer', function ($compile, $timeout) { console.log("main container directive"); return function (scope, elem, attrs) { scope.$watch(function () { return elem; }, function (val) { console.log("Something changed. " + val); $timeout(function () { $compile(val)(scope); }, 0); }); }; }); again, I thought putting a watch on the element passed into the directive was the answer however this runs even when I move the mouse and click on the page somewhere outside of the container that was loaded via jquery ajax.
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44332996
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44302914
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
downvote count: 0

http://stackoverflow.com/q/27861267
has comment: http://stackoverflow.com/comment/44195807
linked to: http://stackoverflow.com/q/12534085
possible better answer: http://stackoverflow.com/a/27874578
has answer: http://stackoverflow.com/a/27874578
type: Question
tagged with: javascript
has title: Hover effect on google map fusion table
accepted answer: http://stackoverflow.com/a/27900668
has body: I'm working on a project that involved the creation of a map with the google map API. It's a map of France and its regions. I created a fusion table that you can see here. I implemented this map on my test site but I have an issue, I would like to create an hover effect on the regions and for that I need to store the pylygons in a variable to use this : google.maps.event.addListener(country, 'mouseover', function() { this.setOptions({fillOpacity: 1}); }); google.maps.event.addListener(country, 'mouseout', function() { this.setOptions({fillOpacity: 0.3}); }); As suggested in this sample code by the google API documentation here you can do that but I don't understand how to implement my fusion table in this code. As I understand var query = 'SELECT name, kml_4326 FROM ' + '1foc3xO9DyfSIF6ofvN0kp2bxSfSeKog5FbdWdQ'; where kml_4326 is the name of the fusion table and 1foc3xO9DyfSIF6ofvN0kp2bxSfSeKog5FbdWdQ is my table fusion ID but what I don't understand is this : url.push('&key=AIzaSyAm9yWCV7JPCTHCJut8whOjARd7pwROFDQ'); also finally var geometries = rows[i][1]['geometries']; where ['geometries'] is the colomn containing the coordinates of each region, in my case it's 'geometry'. Here is my current code : Edit 12/01/2014 : I added the mouseover event on the layer but it still doesn't work If anyone has insights regarding this matter I'll really apreciate any help :)
score: 0
answer count: 2
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44130684
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27900668

http://stackoverflow.com/comment/44092805
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27842640
has text: @TheRiddler is the `getNearestUrl` function also async?

http://stackoverflow.com/comment/44761443
score: 0
has text: the best way I think would be to use angular-ui datepicker directive. http://angular-ui.github.io/bootstrap/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27900112

http://stackoverflow.com/q/27960982
has title: QUnit - how to compare two complex objects
type: UnansweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27975500
has comment: http://stackoverflow.com/comment/44325136
score: 1
has body: I am unit testing some serialisation and deserialisation logic in a fairly complex JavaScript application, using QUnit, but I'm having trouble getting my tests to pass. The two checks that look as though they should do the right thing are deepEqual or propEqual, however, neither appears to do exactly what I want: If I use deepEqual and the two objects do not match, the assertion fails and it shows me a diff indicating the problems. However if there is no difference I just get a failure message showing the first parameter handed to the equality check as the "Expected" value without the second parameter or any indication of what the difference is. I think this is possibly because they aren't the same object, but I'm not sure. If I use propEqual I just get a message saying RangeError: Maximum call stack size exceeded at String.match (native) and the test fails. Is it possible to perform this type of check with QUnit? If so, what am I doing wrong?
has comment: http://stackoverflow.com/comment/44326313
has comment: http://stackoverflow.com/comment/44321150
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44324563
has comment: http://stackoverflow.com/comment/44321128
tagged with: qunit

http://stackoverflow.com/q/27908661
tagged with: http
type: Question
score: 3
has body: The problem, is that the the POST query fails on IE11, in all the other browsers it's seems working. Lets describe the problem step by step: XHR request from application to REST API. Preflight OPTIONS request (request parameters are following) Accept: */* Origin: https://app.example.com Access-Control-Request-Method: POST Access-Control-Request-Headers content-type, accept : Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko Host: api.example.com Content-Length: 0 Connection: Keep-Alive Cache-Control: no-cache preflight request response parameters are: X-Powered-By: Sugar Access-Control-Allow-Origin: https://app.example.com Vary: Origin Access-Control-Allow-Credentia true ls: Access-Control-Allow-Methods: GET,POST,DELETE,OPTIONS Access-Control-Allow-Headers: X-Requested-With,X-HTTP-Method-Override,Content-Type,Accept set-cookie: sugar.sid=s%Pb9OoTTPUkVw%2F2vUPoFMNG LMXACSkQevo; Path=/; Expires=Thu, 15 Jan 2015 18:27:07 GMT; HttpOnly; Secure Date: Mon, 12 Jan 2015 18:27:07 GMT Connection: close The real HTTP request after preflight request parameters: Accept: application/json Content-Type: application/json Referer: https://app.example.com/ Accept-Language: en-US Origin: https://app.example.com Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko Host: api.example.com Content-Length: 9 Connection: Keep-Alive Cache-Control: no-cache Cookie: sugar.sid=s%3A-%2FGF1YoFmRfmBsxK4vLBoGjY5NT0QoYvf5s; Last response parameters: Content-Type: application/json; charset=utf-8 Content-Length: 72 Vary: Accept-Encoding Date: Mon, 12 Jan 2015 18:27:07 GMT Connection: close Basically the response end with the IE error: Origin: https://app.example.com not found in Access-Control-Allow-Origin header. Does the first request needs also the Access-**-Origin header, which seems to be missing. Also followed the CORS flow chart for debugging problem, but I could not spot it http://www.html5…
tagged with: javascript
has title: Strange issue with CORS preflight request fails on IE 11
upvote count: 3
tagged with: cors
has answer: http://stackoverflow.com/a/39457830
has comment: http://stackoverflow.com/comment/44217068
accepted answer: http://stackoverflow.com/a/39457830
has comment: http://stackoverflow.com/comment/44218462
answer count: 1
favorite count: 0
tagged with: xmlhttprequest
tagged with: node.js
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/27928466
has answer: http://stackoverflow.com/a/27929436
accepted answer: http://stackoverflow.com/a/27929436
type: Question
has comment: http://stackoverflow.com/comment/44254130
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44254249
has body: It's probably a basic question. Usually I set values from my directives. I never got values from my directives. This is a simple directive named snapshot. Basically this use your camera to take a picture, mark a X and then a json will be generated. I will cut the code to not let ppl confuse...: angular .module('snapshot', []) .directive('snapshot', function () { return { restrict: 'E', scope: { width: "=", height: "=" }, template: 'html template here', controller: function ($scope, $element) { $scope.data = { x : null, y: null, image: null } $scope.mark = function(event) { $scope.data.x = event.clientX; $scope.data.y = event.clientY; } $scope.takeSnapshot = function() { var context = canvas.getContext("2d"); context.drawImage(video, 0, 0, $scope.width, $scope.height); $scope.gotIt = true; $scope.cameraOn = false; $scope.setMarker = true; $scope.data.image = canvas.toDataURL("image/jpeg"); } } } }); So, I need to read outside the directive my $scope.data basically and I've no clue how to do it. Let me try to create a hypothetic html for this... My data of my directive is : {{snapshop.data}} got my idea ? So, can someone help me with this thing ? tyvm !!!
tagged with: angularjs
type: AnsweredQuestion
has title: Angular - Directive generate data, I need to grab the generated json resul
has comment: http://stackoverflow.com/comment/44255228
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/44275259
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27912649
has text: I'm going to mark this one as the correct answer. I needed some pointers of where to look and this one gives a pretty good idea of where to start. I'm going to write my solution up a little more as well.

http://stackoverflow.com/q/27961996
has body: what i need i need to remove space between html elements. twig code {% spaceless %} &lt;head&gt; {% block title %} &lt;title&gt;times&lt;/title&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt; &lt;meta name="description" content="" /&gt; &lt;meta name="keywords" content="" /&gt; {% endblock %} &lt;meta property="fb:admins" content="10timesevents" /&gt; &lt;meta property="fb:app_id" content="432858816746099" /&gt; {% block css %} &lt;noscript&gt; &lt;link rel="stylesheet" href="http://im.gifbt.com/css/skel-noscript.css" /&gt; &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9.css" type="text/css" &gt; {% if DeviceDetcet() =='computer' %} &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9-desktop.css" type="text/css /&gt; {% elseif DeviceDetcet() =='tablet' %} &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9-1000px.css" type="text/css /&gt; {% elseif DeviceDetcet() =='phone' %} &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9-mobile.css" type="text/css /&gt; {%endif%} &lt;/noscript&gt; {% endblock %} {% block scripts %} &lt;link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600' rel='stylesheet' type='text/css' /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; {# &lt;script src="http://im.gifbt.com/js/jquery.poptrox-2.2.js"&gt;&lt;/script&gt;#} &lt;script src="http://im.gifbt.com/js/skel.min.js"&gt;&lt;/script&gt; {% if DeviceDetcet()=='phone'%} &lt;script src="http://im.gifbt.com/js/skelnew-panels.min.js"&gt;&lt;/script&gt; {%endif%} &lt;script src="http://im.gifbt.com/js/common.10.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; {% endblock %} &lt;!--[if lte IE 8]&gt;&lt;script src="http://im.gifbt.com/js/html5shiv.js"&gt;&lt;/script&gt;&lt;link rel="stylesheet" href="http://im.gifbt.com/css/ie8.css" /&gt;&lt;![endif]--&gt…
has comment: http://stackoverflow.com/comment/44317360
has title: Spaceless is not working for removing whole html data spaces
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27958340
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28014958
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27962352
has comment: http://stackoverflow.com/comment/44317730
answer count: 2
downvote count: 2
tagged with: symfony
tagged with: twig
upvote count: 2
score: 0

http://stackoverflow.com/q/27882877
has comment: http://stackoverflow.com/comment/44167710
type: Question
tagged with: polymer
answer count: 2
has comment: http://stackoverflow.com/comment/44168469
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44167925
favorite count: 0
has comment: http://stackoverflow.com/comment/44167750
has comment: http://stackoverflow.com/comment/44168517
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27882933
upvote count: 1
has title: Appending elements to a DIV from a JSON array in Polymer
has answer: http://stackoverflow.com/a/30082274
has body: I'm struggling right now with inserting a set of divs into a core-header-panel inside a paper-shadow in Polymer. I am getting a set of values from a JSON array and I need to create a div with HTML content (eventually checkboxes) for each of the values. Here's the relevant snippet of code: Variable // this is all just an example of what I eventually want to insert MakeCircuitCreated // end of example of insert and JQuery: function addHeaders(){ $.getJSON('http://myURL/getDataHeaders', function(data) { var headerArray = []; $.each(data, function(key, val) { $('#graphHeaderList').append(" "); console.log(val); headerArray.push(val) }); console.log(headerArray); }); } window.onload = addHeaders; //grabs the header values when the page is loaded My JSON: { "headers": [ "MakeSpawnFish", "MakeEndGame", "MakeModeChange", "MakeConnectComponent", "MakeCircuitCreated", "MakeStartGame", "MakeSnapshot", "MakeResetBoard", "MakeAddComponent", "MakeCaptureFish", "MakeRemoveComponent", "MakeDisconnectComponent" ] }
score: 1

http://stackoverflow.com/a/27859620
type: Answer
has body: You can use the 'monitorEvents' function from within the Developer tools API. https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/Console/Console.html
answers question: http://stackoverflow.com/q/27858306
score: 0

http://stackoverflow.com/a/27875257
accepted answer of: http://stackoverflow.com/q/27875224
has comment: http://stackoverflow.com/comment/44153103
answers question: http://stackoverflow.com/q/27875224
score: 2
has body: Now my problem is that the function Subs.Lsr.Dom($ce) is called BEFORE my SingleMeasure() That's because you are calling it right here: Subs.Lsr.Dom($ce) SingleMeasure(Subs.Lsr, "markLSRPosts", Subs.Lsr.Dom($ce)); You might pass it as an anonymous function: SingleMeasure(Subs.Lsr, "markLSRPosts", function() { Subs.Lsr.Dom($ce); }); The callback will be invoked by your SingleMeasure function at a later stage.
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2

three.js
tags question: http://stackoverflow.com/q/27853253
tags question: http://stackoverflow.com/q/27816153
tag name: three.js
tags question: http://stackoverflow.com/q/27960974
tags question: http://stackoverflow.com/q/27878307
tags question: http://stackoverflow.com/q/27810112
tags question: http://stackoverflow.com/q/27910910
tags question: http://stackoverflow.com/q/27864029
tags question: http://stackoverflow.com/q/27942560
tags question: http://stackoverflow.com/q/27867123
tags question: http://stackoverflow.com/q/27957645
tags question: http://stackoverflow.com/q/27827554
tags question: http://stackoverflow.com/q/27809913
tags question: http://stackoverflow.com/q/27828434
tags question: http://stackoverflow.com/q/27813404
tags question: http://stackoverflow.com/q/27883385
type: Tag
tags question: http://stackoverflow.com/q/27936840
tags question: http://stackoverflow.com/q/27900286
tags question: http://stackoverflow.com/q/27807968
tags question: http://stackoverflow.com/q/27907424
tags question: http://stackoverflow.com/q/27917252
tags question: http://stackoverflow.com/q/27862620
tags question: http://stackoverflow.com/q/27923388
tags question: http://stackoverflow.com/q/27852094
tags question: http://stackoverflow.com/q/27878587
tags question: http://stackoverflow.com/q/27920101
tags question: http://stackoverflow.com/q/27949790
tags question: http://stackoverflow.com/q/27827675
tags question: http://stackoverflow.com/q/27860318
tags question: http://stackoverflow.com/q/27933990
tags question: http://stackoverflow.com/q/27858182
tags question: http://stackoverflow.com/q/27890490
tags question: http://stackoverflow.com/q/27830448
tags question: http://stackoverflow.com/q/27945108
tags question: http://stackoverflow.com/q/27841474
tags question: http://stackoverflow.com/q/27876497
tags question: http://stackoverflow.com/q/27834498
tags question: http://stackoverflow.com/q/27886237

http://stackoverflow.com/q/27903924
answer count: 0
tagged with: google-chrome
type: Question
tagged with: event-loop
downvote count: 0
tagged with: javascript
tagged with: events
has title: Processing order of events "mousedown, mouseup,click" & timeout in chrome
favorite count: 0
upvote count: 2
has body: after studying several pages about event-loop, message queue, javascript stack etc. I tried the following: Click Me! I noticed that the timeouts set by mousedown event will be processed right after the mousedown block (DOM bubbling), but the timeouts for mouseup get processed after mouseup and click block. Assumption? Does chrome remember the DOM propagation path, so that mouseup and click gets processed earlier in task/ message queue of the event loop in the main thread? Thanks, Daniel
type: UnansweredQuestion
score: 2

http://stackoverflow.com/comment/44293550
type: Comment
has text: Hi @itd. There will be thousands of complex objects. I'd like to process them one by one and discard. I think making a single big object will cause memory leak.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27936759

http://stackoverflow.com/q/27880534
type: Question
has comment: http://stackoverflow.com/comment/44162809
tagged with: javascript
has comment: http://stackoverflow.com/comment/44162873
tagged with: progress-bar
has comment: http://stackoverflow.com/comment/44162762
has answer: http://stackoverflow.com/a/27880848
score: 3
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44162681
has comment: http://stackoverflow.com/comment/44162988
upvote count: 3
has title: "Progress dots" in D3, Wolfram style
has body: Wolfram (math-related site) has following progress bar (or should I say progress dots): You can see it in action here. How would this be implemented in D3? I wrote this codepen in D3, with some different idea: Maybe it can serve as a starting point.

http://stackoverflow.com/comment/109056195
type: AnswerComment
score: 0
type: Comment
has text: I know. I am looking for a way around to add this effect using some other way.
comment on: http://stackoverflow.com/a/61272443

http://stackoverflow.com/comment/44102324
score: 0
has text: Well, it's definitely a contributing factor. What about my first comment?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27848972

http://stackoverflow.com/q/27814405
type: Question
score: 1
has body: i am creating simple file upload module in Angular js(v1.3.4). I am using Nodejs server side. I am using https://github.com/danialfarid/angular-file-upload library. It looks pretty straight forward but i am stuck at the basic step. index.html &lt;div ng-controller="FileUploadController"&gt; &lt;input type="file" ng-file-select="onFileSelect($files)" multiple&gt; &lt;/div&gt; controller.js $scope.onFileSelect = function($files) { for (var i = 0; i &lt; $files.length; i++) { var file = $files[i]; $scope.upload = $upload.upload({ url: 'http://localhost:8080/file-transfer/123/upload', // headers: {'Content-Type': undefined}, // withCredentials: true, // transformRequest: angular.identity, file: file }).progress(function(evt) { console.log('percent: ' + parseInt(100.0 * evt.loaded / evt.total)); }).success(function(data, status, headers, config) { // file is uploaded successfully console.log(data); }); } On Server side, I am using multer for multipart . client is sending the request to server but not sending the file data. app.all('/file-transfer/:id/upload', function (req, res) { res.header('Access-Control-Allow-Credentials', true); res.header('Access-Control-Allow-Origin', req.headers.origin); res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept'); console.log(req.body); // prints - {} console.log(req.files); // prints - {} }); Request Header - Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding gzip, deflate Accept-Language en-US,en;q=0.5 Access-Control-Request-Me... POST Cache-Control no-cache Connection keep-alive Host localhost:8080 Origin http://localhost Pragma no-cache User-Agent Mozilla/5.0 (Windows NT 6.2; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0 I used the same code as in example of repository.Maybe i am missing something. Note - Server codes working fine when i use simple html 5 form without angular or…
has comment: http://stackoverflow.com/comment/44035916
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44035924
tagged with: javascript
tagged with: file-upload
linked to: http://stackoverflow.com/q/8685678
has comment: http://stackoverflow.com/comment/44035667
favorite count: 0
tagged with: angularjs
has title: Unable to send file data to nodejs server from client side
tagged with: node.js
has answer: http://stackoverflow.com/a/27816085
accepted answer: http://stackoverflow.com/a/27816085
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/48582397
score: 2
has text: Its window.location.href not $window.location.href
type: AnswerComment
comment on: http://stackoverflow.com/a/27941966
type: Comment

http://stackoverflow.com/a/27843737
has comment: http://stackoverflow.com/comment/44091251
answers question: http://stackoverflow.com/q/27843575
has body: You can call this method directly from the prototype like : String.prototype.concat("hlw","Stackover"); there is no method String.concat, but it could happen if a 'String' variable is defined var String = ""; String.concat("hlw","Stackover") But: This seem to be true with all Standard built-in objects in Firefox, like Array.indexOf (easier to know what's happen when we know the current environment of your assumption) BTW these methods seem to not be the same : String.concat.length // 2 String.prototype.concat.length // 1 And the String.concat method is not depending on String.prototype.concat : String.prototype.concat = null; String.concat("foo","bar") // foobar
score: 0
type: Answer

http://stackoverflow.com/comment/44069189
type: Comment
comment on: http://stackoverflow.com/a/27831638
type: AnswerComment
score: 0
has text: The thing is that it is changing 01700 to 960 for some reason. same as 01744 to 996.

http://stackoverflow.com/comment/93134160
type: Comment
has text: @SeanKendle Is it always a compulsion to use Server side coding for recaptcha verification. Can I know on the client side if the Recaptcha response is a success ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29820236

http://stackoverflow.com/comment/44156317
has text: You can test this using Run Code Snippet..
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27876132

http://stackoverflow.com/comment/44044078
comment on: http://stackoverflow.com/a/27818754
score: 0
has text: Please specify your intentions and which variables you want in the array (where in your code)
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27803809
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
has body: I have a search box that users can type in. When the user keys up, the search is performed. There are checks to see the length of text in the search box. // THE SEARCH STRING IS BEING POPULATED $SEARCH.SearchString.keyup($SEARCH.utilities.doSearch); When someone uses ctrl+v to paste text, this works perfect. When someone uses the menu to paste, like in the image below, the search is not performed. I am not sure of what to call this menu so it's difficult to search for an answer. What event should I have JavaScript listen for when this menu is present and the user selects "Paste"?
favorite count: 0
has comment: http://stackoverflow.com/comment/44016721
has answer: http://stackoverflow.com/a/27804144
accepted answer: http://stackoverflow.com/a/27804144
has answer: http://stackoverflow.com/a/27803929
type: AnsweredQuestion
has title: Which event is being triggered from a menu paste?
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/27803929
type: Question

http://stackoverflow.com/a/27979633
type: AcceptedAnswer
type: Answer
has body: If I understood you correctly, you want to have the data just after the component/directive/controller is loaded. In that case - use resolve in controller, it will inject the result of your ajax request into controller and by the time controller is loaded you'll have all the data. Router app.config(function ($routeProvider) { $routeProvider .when('/', { templateUrl: "app.html", controller: "AppCtrl" resolve: { statResponse: function () { return $http.get('app/shared/homeStatistics.json'); } } } ) }); Controller app.controller('AppCtrl', ['$scope', 'statResponse', function($scope, statResponse) { if(statResponse &amp;&amp; statResponse.status === 200) { $scope.itemSold = statResponse.data.itemSold; $scope.themeAndTemplate = statResponse.data.themeAndTemplate; $scope.members = statResponse.data.members; } }]); Another way is to use ng-cloak on the element. It will hide the element until all variables are resolved. &lt;div class="number" ng-cloak data-animation="true" data-animation-type="number" data-final-number="{{itemSold}}"&gt;&lt;/div&gt; Hope that helps.
accepted answer of: http://stackoverflow.com/q/27861842
score: 0
answers question: http://stackoverflow.com/q/27861842

http://stackoverflow.com/q/27882043
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have the following table: 39,96 I want to put a number at amountinput and separately at the inputs above.(amount_110, amount_111, amount_112 etc.amount` will be a static word, the numbers will change ) Like : I set amountinput to the number 30, amount_110 will get 19.98, amount_111 will get 10.02 Another one: I set amountinput number 18, amount_110 will get 18, amount_111 will get 0 <- or nothing Does anyone know how? Update : $("#clickMe").click( function() { runforest(); }); function runforest() { var IDs = []; $("input[name*=\"remain_\"]").each(function() { IDs.push([this.name.split(/_(.+)?/)[1], $(this).val()]); }); var tempo = $("#inputsum").val(); var alloena; alloena=0; for (var i = 0; i < IDs.length; i++) { CallFunction(IDs[i][0], IDs[i][1], tempo, alloena); var newone = IDs[i][1]; alloena = alloena+Number(newone); } } function CallFunction(id, value, tempo,alloena) { if (alloena<tempo ){ console.log("ID: " + id + ", value: " + value + ", new: " + tempo + " alloena : " + alloena + " emfanizi : " + value); } } the output is : ID: 7, value: 22.14, new: 100 alloena : 0 emfanizi : 22.14 ID: 10, value: 11.69, new: 100 alloena : 22.14 emfanizi : 11.69 ID: 16, value: 22.14, new: 100 alloena : 33.83 emfanizi : 22.14 ID: 21, value: 22.14, new: 100 alloena : 55.97 emfanizi : 22.14 ID: 23, value: 22.14, new: 100 alloena : 78.11 emfanizi : 22.14 my problem is at last line .. is add 22.14 but I want to see the remain of the 100-78.11=... update solution function runforest() { var IDs = []; $("input[name*=\"remain_\"]").each(function() { IDs.push([this.name.split(/_(.+)?/)[1], $(this).val()]); }); var tempo = Number($("#inputsum").val()); for (var i = 0; i < IDs.length; i++) { if (Number(IDs[i][1])<tempo ){ console.log("ID: " + IDs[i][0] + ", value: " + IDs[i][1] + ", new: " + tempo + " emfanizi : " + IDs[i][1]); tempo = Number(tempo) - Number(IDs[i][1]); } else if (Number(IDs[i][1])<tempo || tempo >0){ console.log("ID: " + IDs[i][0] + ", value: " + IDs[i][1] + ", new: …
has title: JavaScript separately the number equal to the corresponding columns
has comment: http://stackoverflow.com/comment/44181413
favorite count: 0
has comment: http://stackoverflow.com/comment/44181319
type: UnansweredQuestion
score: -4
has answer: http://stackoverflow.com/a/27882305
has comment: http://stackoverflow.com/comment/44166009
has comment: http://stackoverflow.com/comment/44181819
type: Question
tagged with: html-table
downvote count: 4

http://stackoverflow.com/a/27848942
has comment: http://stackoverflow.com/comment/44101899
has comment: http://stackoverflow.com/comment/44102016
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27848702
has body: Your script likely executed before chkbxPerDiem was added to the DOM. Perform your script in the window load event: window.addEventListener("load", function() { onLoadDisplay(this); }); Try this: Page.ClientScript.RegisterStartupScript(GetType(), "myAlertScript", @" window.addEventListener('load', function() { onLoadDisplay(this); });", true); See this answer
has comment: http://stackoverflow.com/comment/44102135
answers question: http://stackoverflow.com/q/27848702
has comment: http://stackoverflow.com/comment/44102114
upvote count: 2
has comment: http://stackoverflow.com/comment/44102234
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44102286

http://stackoverflow.com/a/27908991
score: 4
has comment: http://stackoverflow.com/comment/44219542
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44374583
downvote count: 1
has comment: http://stackoverflow.com/comment/44217375
has comment: http://stackoverflow.com/comment/44381910
upvote count: 5
has comment: http://stackoverflow.com/comment/44220747
type: Answer
has body: You can use indexOf if you have an array of values. To get an array of values, you can use [].map.call(x, function(option) { return option.value; }); Therefore, you can use [].map.call(x, function(option) { return option.value; }).indexOf("a"); In ECMAScript 6, you can simplify it to [].map.call(x, option => option.value).indexOf("a"); var x = document.getElementById("sid"); alert([].map.call(x, function(option) { return option.value; }).indexOf("a")); a b
has comment: http://stackoverflow.com/comment/44219030
has comment: http://stackoverflow.com/comment/44310011
accepted answer of: http://stackoverflow.com/q/27908930
has comment: http://stackoverflow.com/comment/44219371
has comment: http://stackoverflow.com/comment/44219386
has comment: http://stackoverflow.com/comment/44217425
has comment: http://stackoverflow.com/comment/44391776
answers question: http://stackoverflow.com/q/27908930

http://stackoverflow.com/comment/44175014
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27887028
score: 1
has text: Wait until the function is executed, maybe?

http://stackoverflow.com/comment/44285053
comment on: http://stackoverflow.com/q/27905761
score: 0
type: Comment
type: QuestionComment
has text: It's fairly standard, posted it

http://stackoverflow.com/q/27946594
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27946687
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44288172
has body: How to change this to addEventListener? Toggle the checked state of the following checked box: Sample check box so far i have tried this but nothing happens. var chkbox = document.getElementById('myCheckbox'); chkbox.addEventListener ('click',function() { if ( chkbox.checked ) { alert('checked'); } },false);
possible better answer: http://stackoverflow.com/a/27946733
accepted answer: http://stackoverflow.com/a/27946687
has answer: http://stackoverflow.com/a/27946733
type: AnsweredQuestion
has title: How to change this to addEventListener?

highcharts
tags question: http://stackoverflow.com/q/27875410
tags question: http://stackoverflow.com/q/27936744
tags question: http://stackoverflow.com/q/27902898
tags question: http://stackoverflow.com/q/27847395
tags question: http://stackoverflow.com/q/27884373
tags question: http://stackoverflow.com/q/27838100
tags question: http://stackoverflow.com/q/27842278
tags question: http://stackoverflow.com/q/27857966
tags question: http://stackoverflow.com/q/27892344
tags question: http://stackoverflow.com/q/27809958
tags question: http://stackoverflow.com/q/27846991
tags question: http://stackoverflow.com/q/27922534
tags question: http://stackoverflow.com/q/27959844
tags question: http://stackoverflow.com/q/27895619
tags question: http://stackoverflow.com/q/27838875
tags question: http://stackoverflow.com/q/27809224
tags question: http://stackoverflow.com/q/27821005
tags question: http://stackoverflow.com/q/27935779
tags question: http://stackoverflow.com/q/27823770
tags question: http://stackoverflow.com/q/27844786
tags question: http://stackoverflow.com/q/27888006
tags question: http://stackoverflow.com/q/27807279
tags question: http://stackoverflow.com/q/27893248
tags question: http://stackoverflow.com/q/27831199
tags question: http://stackoverflow.com/q/27935170
tags question: http://stackoverflow.com/q/27948209
tags question: http://stackoverflow.com/q/27810279
tags question: http://stackoverflow.com/q/27844126
tags question: http://stackoverflow.com/q/27825760
tags question: http://stackoverflow.com/q/27912738
tags question: http://stackoverflow.com/q/27847054
tags question: http://stackoverflow.com/q/27952605
tags question: http://stackoverflow.com/q/27909392
tags question: http://stackoverflow.com/q/27845961
tags question: http://stackoverflow.com/q/27830846
tags question: http://stackoverflow.com/q/27957552
tags question: http://stackoverflow.com/q/27857297
tags question: http://stackoverflow.com/q/27888681
tags question: http://stackoverflow.com/q/27819039
tags question: http://stackoverflow.com/q/27928187
tags question: http://stackoverflow.com/q/27870786
tags question: http://stackoverflow.com/q/27931869
tags question: http://stackoverflow.com/q/27835768
tags question: http://stackoverflow.com/q/27817698
tags question: http://stackoverflow.com/q/27846402
tags question: http://stackoverflow.com/q/27830758
tags question: http://stackoverflow.com/q/27828753
tags question: http://stackoverflow.com/q/27899009
tags question: http://stackoverflow.com/q/27810292
tags question: http://stackoverflow.com/q/27937994
tags question: http://stackoverflow.com/q/27822401
tags question: http://stackoverflow.com/q/27841297
tags question: http://stackoverflow.com/q/27896707
type: Tag
tags question: http://stackoverflow.com/q/27859582
tag name: highcharts
tags question: http://stackoverflow.com/q/27815071
tags question: http://stackoverflow.com/q/27869714
tags question: http://stackoverflow.com/q/27936575
tags question: http://stackoverflow.com/q/27956108
tags question: http://stackoverflow.com/q/27899599

http://stackoverflow.com/q/27857000
has title: Make facebook icon reverse color when hover
has answer: http://stackoverflow.com/a/27857086
has answer: http://stackoverflow.com/a/27857242
tagged with: css
has answer: http://stackoverflow.com/a/27857110
has answer: http://stackoverflow.com/a/27857127
accepted answer: http://stackoverflow.com/a/27857127
has comment: http://stackoverflow.com/comment/44117162
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I wanted to make a simple effect that can change Facebook icon image when hover.But instant my code did not return the effect I want. When I hover the image, it returns nothing. Here is my code. Can anyone teach me how to do? I accept answer in HTML, CSS or jquery. HTML Contact Us We would love to here from you.So,just leave a email. CSS #facebook-logo{ background:url('facebook-logo.png') no-repeat 0 0; } #facebook-logo:hover{ background:url('facebook-logo-negative.png') no-repeat 0 -100px; }
type: Question
has comment: http://stackoverflow.com/comment/44117144
tagged with: javascript
tagged with: jquery
answer count: 6
has answer: http://stackoverflow.com/a/27857322
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44117160
favorite count: 0
has answer: http://stackoverflow.com/a/27857166
possible better answer: http://stackoverflow.com/a/27857086

http://stackoverflow.com/comment/44189156
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27893675
has text: Sorry about the syntax errors. I fixed them.

http://stackoverflow.com/comment/44144829
comment on: http://stackoverflow.com/q/27871019
type: Comment
has text: ["Google Translate API is available as a paid service. See the Pricing and FAQ pages for details."](https://cloud.google.com/translate/docs) Although if that's the case, I'm not sure how it works at all.
score: 0
type: QuestionComment

http://stackoverflow.com/q/27956067
has title: Javascript multiple confirm leave navigation box pop ups before closing browser
answer count: 0
has body: A few years ago, I was Rick Roll'd badly. I was sent to a website where the classic "Never Gonna Give You Up" by Rick Astley music video was playing. When I went to exit the webpage, a confirm dialog box popped with the the first line of the lyrics to the song. I pressed OK, but then another box popped with the second line of the lyrics. This looped until I went through the entire song (many dialog boxes had popped up) and it then finally let me close the webpage. How would I go about implemented something like this in my code for a webpage? I have searched all over the internet and have came across multiple threads about using "onbeforeunload" or similar methods within HTML and Javascript, but all of the answers that pertained to this only allowed the developer to customize the message shown when the user tries to leave the site. I understand completely how to do that, but that is not what I am looking for. I have seen a few people give answers to my question on other threads but the answers don't actually work. Many people say that it is impossible to do this, but then I question how websites like that Rick Roll website did such a thing then? Thanks!
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44306909
tagged with: window.onunload
tagged with: jquery
has comment: http://stackoverflow.com/comment/44306964
tagged with: onbeforeunload
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27857702
score: 0
answers question: http://stackoverflow.com/q/27856874
has body: try like this: Secure Login <?php include('header.php'); ?> Member Login <?php echo ' ' ?>
type: Answer

http://stackoverflow.com/comment/44249142
type: QuestionComment
comment on: http://stackoverflow.com/q/27925970
has text: I used a separate tab in the page to show it when I click on a link
score: 0
type: Comment

http://stackoverflow.com/comment/44276274
type: Comment
has text: you can use localStorage, if all your sites are in the same domain
comment on: http://stackoverflow.com/q/27939805
score: 1
type: QuestionComment

http://stackoverflow.com/q/27931103
tagged with: koa
has body: Using koa.js, I want to make an API which runs a generator function that runs a long time in the background, but sends a token back to the user immediately. The user can then use that token to retrieve status of their job later. 'use strict'; var generateToken = function(){ //... }; var processData = function *(data, token) { //... var a = yield analysis(data); console.log(a) // a is undefined }; app.post('/process_data', validate, function *(next) { var token = generateToken(); var that = this; setTimeout(function() { for (var i of processData(that.request.body, token)){ continue; } }); this.body = "this should return immediately " + token; return next; }); Running it within the setTimeout, variable 'a' is not saved. How do I construct this so that processData runs exactly like a normal yield?
type: UnansweredQuestion
tagged with: node.js
tagged with: generator
has comment: http://stackoverflow.com/comment/44259714
type: Question
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/27931525
tagged with: javascript
has answer: http://stackoverflow.com/a/27932375
score: 0
answer count: 2
has title: ES6 Koa.js run generator function to completion and return asynchronously

http://stackoverflow.com/a/27846669
has comment: http://stackoverflow.com/comment/46009155
answers question: http://stackoverflow.com/q/27846377
has comment: http://stackoverflow.com/comment/44156442
upvote count: 2
has body: you have to write And you have to use And also you have to map your servlet page into web.xml file like CheckLogin /CheckLogin
type: AcceptedAnswer
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44098248
accepted answer of: http://stackoverflow.com/q/27846377
score: 1

http://stackoverflow.com/comment/44223836
comment on: http://stackoverflow.com/q/27911985
has text: There should be no need to use the event target, using `this` in the handler function should suffice.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44129512
type: QuestionComment
has text: Here is a stupid simple jquery off-canvas menu http://codepen.io/scottb/pen/javhr
score: 0
comment on: http://stackoverflow.com/q/27863635
type: Comment

http://stackoverflow.com/comment/44144770
type: AnswerComment
comment on: http://stackoverflow.com/a/27871049
score: 0
type: Comment
has text: You can use this code for all the application, you just add a link with delete class and this is all.

http://stackoverflow.com/q/27931736
has title: Calculating difference in times in 24 hour time format in Javascript
has comment: http://stackoverflow.com/comment/44339759
has comment: http://stackoverflow.com/comment/44339911
type: Question
type: AnsweredQuestion
score: -1
linked to: http://stackoverflow.com/q/10804042
answer count: 1
has answer: http://stackoverflow.com/a/27974103
tagged with: javascript
favorite count: 0
has body: How do i go about calculating the duration between two times in HHMM format by Javascript. The input format will always be HHMM The input time will always be for the same day. Thank you for your inputs. ------------------- lame attemp -------------------- &lt;html&gt; &lt;div&gt; STA:&lt;input type="text" id="STA" onClick="timed();"&gt; ATA: &lt;input type="text" id="ATA"onClick="timed();"&gt; DIFF: &lt;input type="text" id="DIFF" onClick="timed();"&gt; &lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;/html&gt; &lt;script&gt; function timed(){ var x=0; var y=0; var o=0; var l=0; var a=0; var b=0; o=document.getElementById("STA").value; l=document.getElementById("ATA").value; a=o/100; b=l/100; x=a.split('.'); y=b.split('.'); document.getElementById("DIFF").value=x[0]-y[0]+":"+x[1]-y[1]; } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/44339638
has comment: http://stackoverflow.com/comment/44261269
accepted answer: http://stackoverflow.com/a/27974103
upvote count: 2
has comment: http://stackoverflow.com/comment/44260971
has comment: http://stackoverflow.com/comment/44261073
downvote count: 3

http://stackoverflow.com/a/27898801
score: 0
answers question: http://stackoverflow.com/q/27898440
has body: From what i gather you want to redirect two different views for same url. You might want to use ui-router for this purpose. It is an advanced library for angular routing providing a whole lots of features over angular's default ng-route service. You can try something like this: $stateProvider.state('saveOrEdit', { url:'/fundingRequirements/:id', templateUrl: ['$stateParams', function ($stateParams) { var id = $stateParamas.id if (id) { return //Template URL for edit state } else { return //Template URL for save state; } ] }) P.S: I'm not sure but this should also work for ng-route also.
type: Answer
has comment: http://stackoverflow.com/comment/44197722
has comment: http://stackoverflow.com/comment/44197699
has comment: http://stackoverflow.com/comment/44208172
has comment: http://stackoverflow.com/comment/44197964

http://stackoverflow.com/comment/44281213
score: 0
type: Comment
has text: I think this doesn't work if there is a `div` with offset inside another `div` with offset : we should sum all the offsets, don't we?
type: AnswerComment
comment on: http://stackoverflow.com/a/27939392

http://stackoverflow.com/comment/44246526
type: AnswerComment
has text: You are right, the thing is at first the observableArray is empty so that property don't exists. The alternative works just fine.
comment on: http://stackoverflow.com/a/27912123
type: Comment
score: 0

http://stackoverflow.com/comment/44130031
type: QuestionComment
comment on: http://stackoverflow.com/q/27863839
score: 0
has text: @DanielA.White the title mean, how can i improve this code to work like I want. There is an issue.
type: Comment

http://stackoverflow.com/q/27947577
has comment: http://stackoverflow.com/comment/44290143
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44291091
score: 0
has body: Excuse the vague question title. Not entirely sure on how to word this. Basically my issue stems from a bit of jquery in which when setting the data attr in the html the img tag shows some odd behavior as shown below. &lt;img src="images/gallery/ &lt;img src="/images/gallery/bob.png" class="thumbnail&amp;quot; data="1"&gt; " class="popupImage"&gt; From what I am seeing is the class "popupImage" is not replacing the class "thumbnail" however the img tag nested in the outer img tag should be a seperate entity all together, my mind is baffled, and have been at this for hours and probably just need a new pair of eyes to look over it. Any help would be greatly appreciated This is the full html code and jQuery code for the gallery. If I can provide anymore information who needs it please ask and I shall try and give some more where possible. HTML &lt;?php $data = $db-&gt;query("SELECT * FROM `gallery_items` ORDER BY id ASC"); //display query results ?&gt; &lt;br /&gt;&lt;br /&gt; &lt;?php foreach($data as $item) { echo "&lt;a data='".$item['id']."' class='noStyle'&gt; &lt;img src='/images/gallery/".$item['image']."' class='thumbnail' data='".$item['id']."'&gt; &lt;/a&gt;"; } if(count($data) &lt; 1){ echo "&lt;p style='text-align: center;'&gt;&lt;br /&gt;&lt;br /&gt;No results found&lt;/p&gt;"; } ?&gt; &lt;div class="image"&gt; &lt;button class="prev" data="unset"&gt;&amp;lt;&lt;/button&gt; &lt;img src='' class="popupImage"&gt; &lt;button class="next" data="unset"&gt;&amp;gt;&lt;/button&gt; &lt;/div&gt; jQuery $(".noStyle").click(function(){ loadPopup($(this).attr("data")); }); offFocus(); function loadPopup(id){ imgSrc = "/images/gallery/"+$("a[data='"+id+"']").html(); $("div.background").fadeIn(400, function(){ $(".popupImage").attr("src", imgSrc); $(".image").fadeIn(500); reFocus(); setPrevNext($("button[data='"+id+"']")); }); $(window).resize(function(){ reFocus(); }); function reFocus(){ $(".image").css({"left": (($(window).width()/2) - ($(".image").width()/2))+"px", …
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44290168
answer count: 0
type: UnansweredQuestion
has title: img tag being added onto an already open img tag
has comment: http://stackoverflow.com/comment/44292262
has comment: http://stackoverflow.com/comment/44290109
type: Question
has comment: http://stackoverflow.com/comment/44290902

http://stackoverflow.com/comment/44019348
has text: Sorry if I state the obvious, but you do know that the spans will appear over the top of each other due to the CSS? This is working
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27805018

http://stackoverflow.com/a/27928054
has comment: http://stackoverflow.com/comment/44253435
score: 0
type: Answer
has body: If you are trying to hide the second sibling, this will work. Just replace the css class names (subNav, slider) with whatever they actually are. Also, instead of left:100px do whatever you wanted to do here to the second div. div.subNav:hover + div.slider { left: 100px; } The plus sign (+) is a "adjacent sibling selector" in css.
answers question: http://stackoverflow.com/q/27927965

http://stackoverflow.com/a/27935244
upvote count: 3
score: 3
has body: You can view this as a kind of partitioning problem, where you want to partition an array into the longest chunks that match some criteria. We'll try to write this in a way which is as "readable" as possible. We want to be able to write: // "Partition array of sentences into sub-arrays with combined length &lt; 300." var sentenceSubArrays = partition(sentences, combinedLengthLessThan300); This assumes that you have pre-segmented your text into a sentences array. It will return an array of arrays, which we turn into an array of combined sentences at the bottom. We'll define combinedLengthLessThan300 as // "Is combined length of strings in array less than 300?" function combinedLengthLessThan300(array) { return combinedLength(array) &lt;= 300; } where combinedLength is just // "Compute combined length of array as sum of length of each element." function combinedLength(array) { return sum(array.map(function(elt) { return elt.length; })); } using a sum function defined as function add(a, b) { return a+b; } function sum(array) { return array.reduce(add); } If you prefer, you could also write combinedLength as function combinedLength(array) { return array.join('').length; } Now, the fun part is writing the partition routine itself. // "Partition an array into sub-arrays which satisfy some criterion." function partition(array, fn) { array = [array]; // start off with big sub-array for (var i=0; i &lt; array.length; i++) { // for each sub-array while (array[i].length &gt; 1 &amp;&amp; // if sub-array has 2 or more elts !fn(array[i])) { // and criteria fails if (!array[i+1]) array.push([]); // create a new sub-array if necessary array[i+1].unshift(array[i].pop()); // move offending elt to next sub-array } } return array; } How does this work? As indicated in the comments, the basic approach is to start off with a single sub-array with all the original elements in it. Then, we loop over each sub-array, and see if it satisfies the criteria. If it doesn't, we move its last elem…
downvote count: 0
answers question: http://stackoverflow.com/q/27934616
type: Answer

http://stackoverflow.com/comment/44054099
type: QuestionComment
comment on: http://stackoverflow.com/q/27823901
score: 0
has text: Not sure if datepicker supports multiple date highlighting since its set with defaultDate to begin with. I know fullcalendar... http://fullcalendar.io/ does
type: Comment

http://stackoverflow.com/q/27911547
answer count: 1
has title: D3 .transition() not working on circle element onmouseover
tagged with: transition
tagged with: javascript
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44223687
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to accomplish something fairly simple. I want a line chart with invisible datapoints. When the mouse cursor touches the line these invisible data points should become visible. I'd like these circles to appear smoothly and thus I have been trying to add a transition to the lines mouseover method. Additionally if the user hovers over one specific data point a tooltip should appear stating the data points value (e.g. date and value of given metric). Ideally I'd like these circles to start out with radius 0 and when the line is touched the radius should grow to a certain value in a given time datapoints.transition().duration(500).attr("r", 5); When the circle is hovered I want its radius to increase a little more (e.g. in the circles onmouseover method). d3.select(this).transition().duration(500).attr("r", 7); Which did not work. It is possible however to just set d3.select(this).attr("r", 7); the new radius in the circles onmouseover method but as I said before I want it to be a smooth transition and I have seen way fancier plots out there. As I couldn't get this to work I tried the next best thing and so I ended up using no transitions at all and I was able to get my chart to look like this jsFiddle. Unfortunately a very choppy experience... I hope that I am missing something very obvious and that somebody can help me out with this.
has answer: http://stackoverflow.com/a/27912244
tagged with: d3.js
score: 0

http://stackoverflow.com/a/27823006
answers question: http://stackoverflow.com/q/27822532
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44091699
has body: Something like this? could be styled better but you get the idea...you will have to use js I think if you want the heading moved up seperate from the second table td table{display:none;} tr td:nth-child(4){background-color:gray;} td:hover table{position:absolute;left:200px;background-color:yellow;display:block;} Name Surname Job Hobbies John McJohnson Dentist Hover Me Number Hobby Comment 1 Lego I like to play Lego John McJohnson Dentist Hover Me Number Hobby Comment 1 Lego I like to play Lego /th
accepted answer of: http://stackoverflow.com/q/27822532

http://stackoverflow.com/comment/44253118
comment on: http://stackoverflow.com/q/27928041
type: Comment
type: QuestionComment
has text: add `dataType: 'json'` to your ajax request?
score: 1

http://stackoverflow.com/q/27872656
tagged with: c#
has body: Currently, I have a working code that selects and transfers gridview row data in a textbox. Here's the code protected void grdRP_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = grdLocation.SelectedRow; hdnSearchedLoc.Value = grdLocation.Rows[grdLocation.SelectedIndex].Cells[1].Text; txtSearchedLoc.Text = HttpUtility.HtmlDecode(row.Cells[2].Text); } It works well functionality and performance (speed) wise when it is local. I have seen the difference in speed when I upload it to the web server. it takes 5 seconds and more before it transfer the row data to textbox. Now, I am thinking of alternative way to make it faster by using javascript since it is on client-side. I have seen a sample code but it is only on selection method but the transfer of row data is still the same speed. Here's the code javascript function setMouseOverColor(element) { oldgridSelectedColor = element.style.backgroundColor; element.style.backgroundColor='#C0C0C0'; element.style.cursor='hand'; //element.style.textDecoration='underline'; } function setMouseOutColor(element) { element.style.backgroundColor=oldgridSelectedColor; element.style.textDecoration='none'; } aspx.cs protected void grdRP_RowDataBound(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Style["display"] = "none"; if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "javascript:setMouseOverColor(this);"; e.Row.Attributes["onmouseout"] = "javascript:setMouseOutColor(this);"; e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink (this.grdRP, "Select$" + e.Row.RowIndex); } } is there other javascript way of doing that?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44189741
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44148868
type: UnansweredQuestion
has title: ASP.NET - Select and Display Gridview Row Data in Textbox using Javascript
answer count: 0
type: Question

http://stackoverflow.com/comment/44108520
has text: http://stackoverflow.com/a/14296176/33822
comment on: http://stackoverflow.com/q/27852263
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27957068
has body: I think this will do what you're attempting, using the newer DriveApp API since, as rchang pointed out, the DocsList API is deprecated and set to be decommissioned in April. function collectOrphans(findOrphaned) { var folder = DriveApp.getFoldersByName('Orphaned').next(); var files = DriveApp.getFiles(); var orphanCount = 0; while(files.hasNext()){ var file = files.next(); if(!file.getParents().hasNext()){ folder.addFile(file); orphanCount++; } } Logger.log('Moved ' + orphanCount + ' orphans successfully.'); }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27952300

http://stackoverflow.com/comment/44226374
type: QuestionComment
score: 2
has text: OK, so what's not working?
comment on: http://stackoverflow.com/q/27913552
type: Comment

http://stackoverflow.com/a/27837012
has comment: http://stackoverflow.com/comment/44097908
has comment: http://stackoverflow.com/comment/44098093
has comment: http://stackoverflow.com/comment/44097636
has comment: http://stackoverflow.com/comment/44097645
answers question: http://stackoverflow.com/q/27836815
score: 0
has body: First of all your syntax is completely wrong, you should not add bootstrap to project explicitly , instead run meteor add mizzao:bootstrap-3 and delete them from head. Instead of script tags in footer create footer.js and in it make if(Meteor.isClient){ Template.footer.helpers({ year: function(){ return new Date().getFullYear(); } } And if you want everything to be under each other, wrap {{renderPage}} into some div which will hold place for it until template is loaded. Also, do you have Home template? Because that's what you are calling in iron-router
has comment: http://stackoverflow.com/comment/44097679
has comment: http://stackoverflow.com/comment/44111390
type: Answer
has comment: http://stackoverflow.com/comment/44097803

http://stackoverflow.com/comment/44177860
type: Comment
type: QuestionComment
has text: @FaridNouriNeshat Ok, tnx for finding that... I retracted my close vote... now let us close it against the correct dupe...
comment on: http://stackoverflow.com/q/27887884
score: 0

http://stackoverflow.com/comment/44132052
type: QuestionComment
comment on: http://stackoverflow.com/q/27864387
has text: Did any of the answers work for you?
score: 0
type: Comment

http://stackoverflow.com/a/27863948
upvote count: 1
has body: :nth-child(even){background-color: #ffd800;} or :nth-child(odd)
type: Answer
answers question: http://stackoverflow.com/q/27863830
downvote count: 0
score: 1

http://stackoverflow.com/a/27826967
has body: Don't use magic numbers like 0, 30, 11. It will complicate the code. Pass selected date of calendar to your function Set date to 1 to the passed variable (set month to 1 for previous year) Add day -1 to new date. Set passed date to new date. Use same approach for next month or year selection. Use date functions to change the date rather than setting numbers of month ir year. This will handle leap year and different month days
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27826737
answers question: http://stackoverflow.com/q/27826737
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/q/27832121
accepted answer: http://stackoverflow.com/a/27832149
has body: Is there a way to ignore certain transitionend events based on css property? For example in the following code, the height transition ends much sooner than the left transition. Is there a way to ignore the height transition to get the last transitionend event? html: &lt;div id="testButton"&gt;&lt;/div&gt; &lt;div id="wrapper" class="wrapper"&gt; &lt;div id="menu" class="menu"&gt; &lt;div id="menu-sets" class="menu-sets"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; css: #testButton { position: absolute; top: 0; left: 200px; width: 100px; height: 100px; background-color: #00ff00; } .menu-sets { position: absolute; visibility: hidden; overflow: hidden; top: 0; left: -50px; z-index: 100; width: 100px; height: 100px; background-color: #ff0000; transition: left 3.3s ease-out, height 0.2s ease-out; } .show-menu-1 .menu-sets { visibility: visible; left: 0px; height: 200px; } js: $(document).ready(function () { $("#testButton").click( function () { $('#wrapper').addClass('show-menu-1'); // show menu } ); $('#menu-sets').one('transitionend', function() { alert("event done"); }); }); jsfiddle example: http://jsfiddle.net/rotaercz/zysxsc41/2/
upvote count: 1
type: AnsweredQuestion
has title: Is there a way to ignore certain transitionend events based on css property?
score: 1
type: Question
has answer: http://stackoverflow.com/a/27832149
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: css

http://stackoverflow.com/q/27925499
score: 0
has comment: http://stackoverflow.com/comment/44249645
tagged with: toggle
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44323948
has title: jQuery drop down menu in plain javascript
has comment: http://stackoverflow.com/comment/44247980
has comment: http://stackoverflow.com/comment/44248366
answer count: 1
has comment: http://stackoverflow.com/comment/44248494
has comment: http://stackoverflow.com/comment/44248135
has body: I am looking for some help to change my jquery navigation menu into plain javascript. I have read lots of questions on converting jquery to javascript but I can't get my head around the changes. Basically the jquery toggles the classes so the drop down menu shows and hides, Here is my jquery $(document).ready(function() { $('.three-lines-menu').on('click', function(e){ e.preventDefault(); $('.js-menu').toggleClass('js-menu-responsive'); }); }); Here is where I am at with my plain javascript document.addEventListener("DOMContentLoaded", function(event) { var menu = document.getElementByClassName('js-menu'), toggleClass = function (el, cl) { hasClass(el, cl) ? removeClass(el, cl) : addClass(el, cl); toggleClass(menu, 'js-menu-responsive'); }; }; This is just my attempt from reading articles but I can't get it to work, any advice or a push in the right direction would be great. *Note - I don't need support for ie 6,7,8 Here is my js fiddle
has answer: http://stackoverflow.com/a/36555078
type: UnansweredQuestion

http://stackoverflow.com/comment/45098158
type: Comment
score: 0
type: AnswerComment
has text: Lost or applied to the wrong input element? I'm looking at your plnkr and can't quite see how to reproduce the problem.
comment on: http://stackoverflow.com/a/28377084

http://stackoverflow.com/a/27927380
has body: You were close. You need to pass the component class it self (not a string), and then because the tag syntax takes a variable already, you get rid of the {}s. Also don't forget to return the node from render. var Container = React.createClass({ render: function() { return &lt;this.props.implComponent /&gt; } }); React.render( &lt;Container implComponent={SomePredefinedVariable} /&gt;, document.getElementById('content') ); If you want to pass a basic dom component, you'd use a string This makes sense if you think about the transform result var Container = React.createClass({displayName: "Container", render: function() { return React.createElement(this.props.implComponent, null) } }); ReactDOM.render( React.createElement(Container, {implComponent: SomePredefinedVariable}), document.getElementById('content') ); ReactDOM.render( React.createElement(Container, {implComponent: "div"}), document.getElementById('content') );
type: Answer
answers question: http://stackoverflow.com/q/27926690
accepted answer of: http://stackoverflow.com/q/27926690
upvote count: 18
type: AcceptedAnswer
downvote count: 0
score: 18

http://stackoverflow.com/q/27832476
has title: get a value from $promise returned by Item.query()
type: Question
has comment: http://stackoverflow.com/comment/44070733
tagged with: mean-stack
downvote count: 0
tagged with: mongoose
tagged with: javascript
favorite count: 0
has body: Hello I am trying to query my Mongoose DB for items using $scope.inventory = Item.query(); which works. Problem is I need to separate them based on a values on the front end of my app. console.log($scope.inventory); returns [$promise: Promise, $resolved: false] which from the console I can drill into and find the values but I cant find a way of accessing them in my code.
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44070859

http://stackoverflow.com/a/27904548
has body: I'm not sure if an tag is supposed to be inside an , that's one thing. Your HTML looks like you're using bootstrap, so why don't you just use bootstraps dropdown-class? If you really want to use a you probably need to use JavaScript, to listen to a change-Event and then scroll to the part you want. The other thing is this: Your link for, say Egypt, looks like this: Egypt while your according content looks something like this: Egypt But for your link to work, you actually need something with the id specified in the href attribute, so you should change your code to this: Egypt
answers question: http://stackoverflow.com/q/27904225
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/27823291
upvote count: 4
has body: As others have noted, ajaxSuccess and ajaxComplete are non-native events added by jQuery. If for some reason you wanted interop between jQuery and vanilla js, you could dispatch the events yourself (with the caveat that browser support for CustomEvent is limited): var event = new CustomEvent("ajaxComplete"); document.dispatchEvent(event);
downvote count: 0
answers question: http://stackoverflow.com/q/27823187
score: 4
type: Answer

http://stackoverflow.com/comment/44298260
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27950957
has text: this doesnt seem to work now nothing is clickable and i cant zoom now maybe i did something wrong

linechart
tag name: linechart
tags question: http://stackoverflow.com/q/27860689
tags question: http://stackoverflow.com/q/27849643
type: Tag

http://stackoverflow.com/q/27885255
answer count: 1
downvote count: 0
tagged with: javascript
has body: I'm trying to use the spread method to accumulate promised results that I've read in this thread with Q.js. It works in another block of code but not in the following app.get example. I want to chain queries using Sequelize and mongoose and pass all the returned data to the spread method. Here's my attempt: var db = require('./db/managedb'); // Sequelize var mongo_models = require('./db/mongo_model')(mongoose); var WB = mongo_models.Webdata, Est = mongo_models.Estimate; app.get('/p/:tagId', function(req, res){ var filename = req.param("tagId"); var mysql = db.db.query('CALL procedure()').then(function(rows) { console.log(rows); }); // Sequelize var nosql = WB.find().exec(function(err,k){ console.log(k); }) // Mongoose var nosql2 = Est.find().exec(function(err,la){ console.log(la); }) // Mongoose Q.try(function(){ return mysql }).then(function(mysqls){ return [ mysqls,nosql] }).then(function(mysqls,nosqls){ return [mysqls,nosqls,nosql2] }).spread(function(mysqls,nosqls,nosql2s){ res.render(filename+'.html', {my:mysqls,wb:nosqls,est:nosql2s}) }).catch(function(error){ console.log('fail') }) }) I'm just getting a blank page with Cannot GET /p/5 and there's no "fail" shown in the console.log. Here's my original code that works, but it's suffering from callback hell. app.get('/p/:tagId', function(req, res){ var filename = req.param("tagId"); db.db.query('CALL procedure()').then(function(rows) { WB.find().exec(function(err,wb){ Est.find().exec(function(err,est){ res.render(filename+'.html', {my:rows,wb:wb,est:est}) }) }) }).catch(function (error) { console.log('own: database error'); }) })
tagged with: callback
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/27886392
accepted answer: http://stackoverflow.com/a/27886392
tagged with: node.js
type: AnsweredQuestion
score: 1
tagged with: database
linked to: http://stackoverflow.com/q/18849312
type: Question
has title: chaining database queries using promise in node.js
upvote count: 1

http://stackoverflow.com/comment/44156965
comment on: http://stackoverflow.com/q/27877407
has text: Thanks, how could I not find this? It's really easy, I just reformatted the JSON and adapted the code from the doc now it's like this: http://jsfiddle.net/kxx5a2ez/19/
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44295529
comment on: http://stackoverflow.com/a/27949227
type: Comment
has text: If you are using `image` that way, then what is the point of defining the method on `Array` class?
type: AnswerComment
score: 0

http://stackoverflow.com/a/27840231
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27819039
accepted answer of: http://stackoverflow.com/q/27819039
has comment: http://stackoverflow.com/comment/44238255
has body: This is a simple example which only uses css and html. It is very limited but functions (fixed width tool tips etc). You could easily make it more flexible, it is just to show it is possible. ... 15/5 info 16/5/2015 info 2 17/5 fixed width 18/5 .period{ float:left; position:relative; display:inline-block; ... } .tool-tip{ height:35px; line-height: 25px; position: absolute; ... } Main thing to be aware of is that each section is an inline box, then the tool tip is located relative to it.
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44287651

http://stackoverflow.com/a/27895538
downvote count: 0
has comment: http://stackoverflow.com/comment/44220367
has body: Rather then setting the bottomBar fixed at bottom right. Set bottomWindow at the bottom right: Update: By adding a little javascript you can make it work as you want: putDivBottom('.bottomWindow'); $(".titleBar").click(function(e) { width1 = $(this).parent().width(); right1 = $(this).css("right"); console.log(width1); $(this).find('.windowSize').toggleClass("hidden"); $(this).next('.contentSection').toggleClass('hidden'); setButtomDiv($(this).parent(),width1); console.log($(this).parent().width()); }); function putDivBottom(elementClass,width1){ for(i=0;i&lt;$(elementClass).length;i++){ $(elementClass+":eq("+i+")").css({"right":(i)*260}); } } function setButtomDiv(this1, width1){ index1 = $(".bottomWindow").index(this1); if (width1==240){ rightAdd = $(this1).width()-240; } else{ rightAdd = 240 - width1; } for(i=index1+1;i&lt;$(".bottomWindow").length;i++){ value1=$(".bottomWindow:eq("+i+")"); right1 = parseInt(value1.css("right")); value1.css({"right":rightAdd+right1+"px"}); } } Working Demo
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44196680
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/27895228
score: 2
has comment: http://stackoverflow.com/comment/44192715
answers question: http://stackoverflow.com/q/27895228

http://stackoverflow.com/q/27841959
favorite count: 0
tagged with: joomla
has title: passing php variables to javascript in joomla
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27883653
downvote count: 0
accepted answer: http://stackoverflow.com/a/27883653
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: I am trying to make a module for joomla that makes a map using the google maps API. The map itself works fine if the data is hardcoded in the javascript file, but I want to be able to use it easily on multiple sites, so setting all the options from the joomla backend would be preferable. I've been trying to do this with a JSON call, but it returns an error 500 when the page loads. My dev site is: http://dev.xander.dk.web1.symatic.dk/ The relevant code is as follows: mod_google_maps.php (making the variables and connecting them to the fields in mod_google_maps.xml) &lt;?php /** * Hello World! Module Entry Point * * @package Joomla.Tutorials * @subpackage Modules * @link http://docs.joomla.org/J3.x:Creating_a_simple_module/Developing_a_Basic_Module * @license GNU/GPL, see LICENSE.php * mod_helloworld is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. */ // no direct access defined('_JEXEC') or die; // Include the syndicate functions only once require_once( dirname(__FILE__) . '/helper.php' ); $mapCenterLat = $params-&gt;get('mapCenterLat', '55.395239'); $mapCenterLng = $params-&gt;get('mapCenterLng', '10.380180'); $zoom = $params-&gt;get('zoom', '18'); $mapDisableUi = $params-&gt;get('mapDisableUi', false); $markerLat = $params-&gt;get('markerLat', '55.395239'); $markerLng = $params-&gt;get('markerLng', '10.380180'); $markerTitle = $params-&gt;get('markerTitle', 'symatic'); helper.php &lt;?php function getMapOptionsAjax(){ $data = array('mapCenterLat' =&gt; $mapCenterLat, 'mapCenterLng' =&gt; $mapCenterLng, 'zoom' =&gt; $zoom, 'mapDisableUi' =&gt; $mapDisableUi, 'markerLat' =&gt; $markerLat, 'markerLng' =&gt; $markerLng, 'markerTitle' =&gt; $markerTitle ); echo json_encode($data); }; ?&gt; maps.js (only the relevant JSON call) jQuery.get('index.php?option=com_ajax&amp…
tagged with: javascript
upvote count: 1
answer count: 1

http://stackoverflow.com/a/27904714
has body: In browsers which support ES5 (IE >= 9), you can simply use .bind(this) to get context. beforeSend: (function() { $('#project-wrapper').addClass('activated'); $(this).prepend('loading...'); }).bind(this),
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44209662
type: Answer
has comment: http://stackoverflow.com/comment/44246131
answers question: http://stackoverflow.com/q/27904647
has comment: http://stackoverflow.com/comment/44209352
has comment: http://stackoverflow.com/comment/44242864
has comment: http://stackoverflow.com/comment/44209879
has comment: http://stackoverflow.com/comment/44245537

http://stackoverflow.com/comment/44173283
has text: Watch the new code http://jsfiddle.net/g4kzo4fo/2/ Still not working there are more problems
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27886051
type: Comment

http://stackoverflow.com/comment/44186559
type: Comment
comment on: http://stackoverflow.com/a/27883658
score: 0
type: AnswerComment
has text: Doesn't this still loop though all middleware for each action? You will process the normal middlware loader once and hit your `middlewareProcessor`, but then you async-loop though all 3. The normal processor will also stop excecution if a previous one halts:https://github.com/evantahler/actionhero/blob/master/initializers/actionProcessor.js#L131-L146 (and uses async, just like you are)

http://stackoverflow.com/q/27841387
score: 0
has comment: http://stackoverflow.com/comment/44086441
answer count: 2
has answer: http://stackoverflow.com/a/27843983
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27841420
has comment: http://stackoverflow.com/comment/44086364
has title: Ajax Jquery Passing variable to PHP file
accepted answer: http://stackoverflow.com/a/27843983
has comment: http://stackoverflow.com/comment/44090221
has answer: http://stackoverflow.com/a/27841420
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44086982
tagged with: jquery
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/44087187
has comment: http://stackoverflow.com/comment/44087365
tagged with: php
has comment: http://stackoverflow.com/comment/44091154
has body: Hey Im having an issue in accessing the variable from JQuery Ajax. I ve tried everything. I even added cdn script tag to both files. but I keep getting this error of undefined index Notice: Undefined index: head in C:\xampp\htdocs\Project\View.php on line 20 Anyone has any idea wats wrong with the syntax. I have attached both my files below. SearchProjects.php <?php session_start(); $No="Not Assigned"; require("DB.php"); $query="SELECT `ID`, `Assigned_By`, `name`, `path`, `heading`,`Assigned_to`, `Completed`, `Date`, `Due_Date`, `Price` FROM `assign` where `Assigned_to`='Not Assigned' order by Date Desc"; $result=mysqli_query($PDB,$query); if ($result->num_rows > 0) { echo " " ." " . " " . " ID " . " Assigned_By " . " Name " . " Path " . " Heading " . " Assigned_To " . " Completed " . " Due_Date " . " Submission_Date " . " Price " . " "; while($row = $result->fetch_assoc()) { echo " " . " ".$row["ID"]." " . " ".$row["Assigned_By"]." " . " ".$row['name']." " . " ".$row['path']." " . " ".$row['heading']." " . " ".$row['Assigned_to']." " . " ".$row['Completed']." " . " ".$row['Date']." " . " ".$row['Due_Date']." " . " ".$row['Price']." " . " Show More! " . " "; } echo " "; } else { echo "0 results"; } ?> View.php TODO supply a title <?php session_start(); if(isset($_POST['head'])){ echo $_POST['head']; } $filename="CV.docx"; // $filename=$_SESSION['filename']; //echo $filename." "; require("DB.php"); $query="SELECT `heading` FROM `assign` where `name`='$filename'"; $result=mysqli_query($PDB,$query); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $heading=$row['heading']; $_SESSION['heading']=$heading; } } else { echo "0 results"; } $dir = "Assigns/"; if (is_dir($dir)){ if ($dh = opendir($dir)){ while (($file = readdir($dh)) !== false){ if(!($file=="." || $file=="..")){ $f=explode(".",$file); if(strcmp($f[0],$heading)){ if(!file_exists("Assigns/$file")) { die("File not found"); } else{ $my_file = "Assigns/$file"; $handle = fopen($my_file, 'r'); $dat…
has comment: http://stackoverflow.com/comment/44091188

http://stackoverflow.com/comment/44320539
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27950003
has text: Do you have any working example or a fiddle where it can be seen?
score: 0

http://stackoverflow.com/a/27911637
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27911283
downvote count: 0
has body: You can use following options (and not only these) regarding to your possibilities and knowledge: SharePoint JavaScript object model (JavaScript CSOM) JavaScript REST calls SPServices library Your own jQuery calls of old fashion web service (ASMX) - sample

http://stackoverflow.com/comment/44207647
type: AnswerComment
comment on: http://stackoverflow.com/a/27903021
type: Comment
has text: No, you need the echo here as well. Use the syntax from my answer. isFavorite should return true if it is a favorite and false otherwise.
score: 0

http://stackoverflow.com/comment/44314644
has text: Check the theme headers (commented out template name at the top of the .php page) The name is what you see in the dropdown on the backend
score: 0
comment on: http://stackoverflow.com/q/27960484
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44080536
has text: i deleted my answer, this one is the most accurate
comment on: http://stackoverflow.com/a/27838239
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45039136
score: 0
type: Comment
type: QuestionComment
has text: Yes, sharing the site will help. What about the order of the scripts? Shouldn't be jsscripts also included after isotope? I would change the array in register to array('jquery','isotope')
comment on: http://stackoverflow.com/q/27845510

http://stackoverflow.com/comment/44189132
comment on: http://stackoverflow.com/q/27893946
score: 0
type: Comment
type: QuestionComment
has text: Try it out in your browser's console. For me, it's the former (leading zeros) in Chrome on Windows 8.1. i.e.: `(new Date(2015, 1, 9)).toDateString()` => "Mon Feb 09 2015".

http://stackoverflow.com/comment/44274409
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27938104
has text: any other way for `checkin_info[index - 1].day` ? because if I `if (index === 0) return;` will affect some other code. if i take away `Cannot read property 'day' of undefined`
type: AnswerComment

http://stackoverflow.com/q/27883399
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44168673
tagged with: java
has comment: http://stackoverflow.com/comment/44168708
has comment: http://stackoverflow.com/comment/44168656
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44168686
has body: The creating and setting values works but whenever i try to do the Triangle.add() or say t.add() to add it to the list (which works when not done through javascript) it doesnt work. heres the javascript code to eval public String code = "" + "" + "var v = vector;" + "v.x = 0;" + "v.y = 0;" + "v.z = 0;" + "var v1 = vector;" + "v1.x = 100;" + "v1.y = 100;" + "v1.z = 100;" + "var v2 = vector;" + "v2.x = 200;" + "v2.y = 200;" + "v2.z = 200;" + "" + "var t = triangle;" + "t.a = v;" + "t.b = v1;" + "t.c = v2;" + "t.add();" + "print('hey');" + "print(t.b.x);" + "t.add();" + ""; and heres the java code which evals it public void run() { try { ScriptEngine engine = new ScriptEngineManager().getEngineByName ("rhino"); engine.put("vector", new Vector3f()); engine.put("triangle", new Triangle(0,0,0,0,0,0,0,0,0,TextureHandler.getHeldTexture(),false)); engine.eval(code); } catch (Exception e) { e.printStackTrace(); } }
score: 0
has comment: http://stackoverflow.com/comment/44168649
tagged with: eval
has comment: http://stackoverflow.com/comment/44168696
has title: Java eval javascript wont run public method
has comment: http://stackoverflow.com/comment/44168524
has comment: http://stackoverflow.com/comment/44168665
answer count: 0

http://stackoverflow.com/q/27895987
tagged with: jstl
has body: I want to use javascript value in jstl function on jsp page which call function in managedbean. anyone help. Javascript code: alert(document.getElementById('data').value); '${mapBean.testfunc(document.getElementById('data').value)}'; managedbean: public void testfunc(String a) { System.out.println("my function test is printed"+a); }
tagged with: jsp
tagged with: javascript
score: -1
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: managed-bean
has title: How to pass javascript variable in jstl function to managed bean?
upvote count: 0
tagged with: java
type: Question
has answer: http://stackoverflow.com/a/27896114

http://stackoverflow.com/comment/44176578
score: 0
type: Comment
type: QuestionComment
has text: I am getting the ciphertext from encrypt method above as byte[]Base64 and used that one in JS.Salt and Iv also retrieved from the class above and stored as private members of class. Salt is a string and retrieve byte[] out of it.Also Iv is retrieved as byte[] from cipher parameters getIv method.
comment on: http://stackoverflow.com/q/27876420

http://stackoverflow.com/comment/44133528
score: 4
comment on: http://stackoverflow.com/q/27865494
has text: Have you tried reading the spec?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27812234
has body: I just need the following: subtotal = sum(product1,product2) total = sum(subtotal,vat) from code $('input').keyup(function(){ var v = this.value, el = $(this); if(!isNaN(v)){ var ov = el.siblings('.valid').val(); el.siblings().last().val(v*ov); $(this).removeClass('nope').trigger('totalChange'); } else { $(this).addClass('nope'); } }); $(document).on('totalChange', function(){ var val1 = parseFloat($('#vat_zero_re').val(), 10); var val2 = parseFloat($('#ve_subtotal').val(), 10); $('#total').val(val1+val2); }); source code : http://jsfiddle.net/4c0epamc/
has comment: http://stackoverflow.com/comment/44032092
has title: Sub total and total auto compute
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27812317
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44032135
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 1
has answer: http://stackoverflow.com/a/27812317
has comment: http://stackoverflow.com/comment/44032037
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44032088
score: 1

http://stackoverflow.com/comment/44319843
comment on: http://stackoverflow.com/q/27963277
type: Comment
type: QuestionComment
score: 1
has text: *"lost in HTML code"* - Bonus points to you for using this expression on a question about maps.

http://stackoverflow.com/q/27896953
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27902091
favorite count: 0
has body: I am following some tutorial to pass a JSON text file from server to display the data after some javascript processing on a html file. As a test, try to display a LI of one column, but cannot get any output in the browser. Your help is appreciated. I tried two approaches. Approach 1 xmlhttp: Apparently, the browser complain about the html format: Uncaught SyntaxError: Unexpected string (15:08:42:080 | error, javascript) at testJSON3.html:12 Is my xmlhttp call format correct? Thank you for your help in advance. Here's JSON text myTutorial.txt: [ { "active":"1", "courseCode":"208.01.00", "courseName":"course name 1", "eventDesc":"2015 class of course name 1" }, { "active":"1", "courseCode":"208.01.00", "courseName":"course name21", "eventDesc":"2015 class of course name " } ] And processed by the below html to process the xmlhttp access to the file on server localhost directory phpTWLLT Approach 2 getJSON(): This one is interesting. If the server side is static array ($DEBUG = true:), javascript is able to process and get browser display. But fail when generate the text from mysql ($DEBUG = false). I am scratching my head to get the $DEBUG=false work? Apparently, both cases generated a valid JSON text. If $DEBUG is set true, output from localhost/phpTWLLT/json_encode_array.php [{"active":"0","first_name":"Darian","last_name":"Brown","age":"28","email":"darianbr@example.com"},{"active":"1","first_name":"John","last_name":"Doe","age":"47","email":"john_doe@example.com"}] the list displayed in browser. 0 1 If $DEBUG is set false, output from localhost/phpTWLLT/json_encode_array.php [{"active":"1"},{"active":"1"}] The browser display is blank. html file: PHP script: json_encoded_array.php <?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* set out document type to text/javascript instead of text/html */ $DEBUG = true; if ($DEBUG) { head…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44194868
tagged with: xmlhttprequest
tagged with: php
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: mysql
upvote count: 1
type: Question
has title: Javascript cannot process JSON text file
tagged with: javascript
has comment: http://stackoverflow.com/comment/44195182
has comment: http://stackoverflow.com/comment/44194252

http://stackoverflow.com/q/27926746
tagged with: wordpress
upvote count: 1
has comment: http://stackoverflow.com/comment/44260858
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44251745
has body: I am building a Wordpress plugin to manipulate a custom table in the Wordpress database from an Options Settings page. So far, I'm able to query the database and build an HTML table with the results. ob_start(); // query the database and get the records // $games contains the records $htm .= ' '; // header $htm .= ' '; foreach ( $cols as $col ) { $htm .= ' '.$col.' '; } $htm .= ' '; // body $htm .= ' '; foreach ($games as $game){ foreach ($game as $val) { $htm .= ' '.$val.' '; } $htm .= ' '; } $htm .= ' '; echo $htm; $output = ob_get_contents(); ob_end_clean(); echo $output; So far so good. Now I want to make the first column in the table a button that fires a javascript function. $htm .= ' '; foreach ($games as $game){ foreach ($game as $val) { if ($game->ID == $val){ $htm .= ' '.$val.' '; } else { $htm .= ' '.$val.' '; } } $htm .= ' '; } Here is the function in my admin.js file: function myFunction() { document.getElementById("tboxOut").value = jsgame.ID; } In my main plugins page, I have enqueue'd the script file. wp_enqueue_script('pl_script',plugins_url( 'js/admin.js', __FILE__ )); When I open the page in a browser and click a button in column 1, the function fires and I can debug it in the browser. Now, I need to pass the data in $game to this function and populate a bunch of input boxes, but have had no luck. Here is what I've tried: $aryGame = (array)$game; $htm .= wp_localize_script( 'pl_script', 'jsgame',$aryGame ); $htm .= ' '.$val.' '; But in the browser debuger, I get an error: Uncaught ReferenceError: jsgame is not defined Obviously, I'm missing some understanding on how to pass data from PHP to the javascript. Any ideas?
has comment: http://stackoverflow.com/comment/44263732
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44262919
type: UnansweredQuestion
tagged with: php
has title: How to pass data to javascript on a WordPress Admin page?
has answer: http://stackoverflow.com/a/57470333
score: 1

http://stackoverflow.com/comment/44136080
type: Comment
score: 0
has text: Why is it a problem if there's a third argument on the callback that you don't care to use? Just ignore it. Just because it's there doesn't mean you have to do anything with it.
type: QuestionComment
comment on: http://stackoverflow.com/q/27866490

http://stackoverflow.com/comment/44187772
type: QuestionComment
comment on: http://stackoverflow.com/q/27893241
has text: Do ***what***? No, it doesn't make sense. Step back, and think: Assume you know *nothing* about the situation, is the question really sufficient to explain what you want? (Hint: No, not remotely. Use the "edit" link to add a **lot** more detail.)
score: 0
type: Comment

http://stackoverflow.com/comment/44330043
type: Comment
type: QuestionComment
has text: Example: #myId{ width:300px; height:100px; } .myClass{ height:500px; width:200px; } Matched & Replaced String: #myId{ .size(300px 100px); } .myClass{ .size(200px 500px); }
comment on: http://stackoverflow.com/q/27953605
score: 0

http://stackoverflow.com/q/27822406
has body: I need to break this text and grab objects in a separated form. object { child { } } object { } I am no regex expert, but after attempting, the best pattern I got to was something like so: (.)*{(.|\n)*}/ig But when applying it to the above text, it'll match it all, I can see why, but I don't know what else I could do to actually make it break the results into separate sections. Edit: To be more clear, in the text I provided, I'd like to have matched groups, from 'object {' to the closing '}', while including everything inside of it. And to visualize it: Matched group #1: object { child { } } Matched group #2: object { } *Just to clarify, 'object' and 'child' are only examples, and I want the pattern to match any names, with an option to have a child with an identical name as it's parent
tagged with: javascript
has answer: http://stackoverflow.com/a/27822541
accepted answer: http://stackoverflow.com/a/27822541
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44050698
has answer: http://stackoverflow.com/a/27822879
has title: Match a specific syntax with regex
has comment: http://stackoverflow.com/comment/44050647
has comment: http://stackoverflow.com/comment/44051945
tagged with: regex
has comment: http://stackoverflow.com/comment/44050669
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27822879
type: Question

http://stackoverflow.com/a/27884014
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44206112
has body: I am just using console.log(code); it works fine. I haven't got the definitive answer, but my assumption is it has something to do with the promises being delayed, so console.log it is. *Update and answer. The code turned out to be node 0.11.x which uses a different syntax with promises. I have submitted a pull-request on the module githubg pagewith instructions on how to use nvm to upgrade to the unstable version of node to use this code. npm install -g nvm nvm install v0.11.14 I was then able to debug the code as I pleased.
has comment: http://stackoverflow.com/comment/44173895
downvote count: 0
has comment: http://stackoverflow.com/comment/44171507
answers question: http://stackoverflow.com/q/27883531
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27883531

http://stackoverflow.com/comment/44104086
comment on: http://stackoverflow.com/q/27849805
type: Comment
type: QuestionComment
score: 0
has text: I just updated the question with the `browserify` info. Sorry about that.

http://stackoverflow.com/comment/44043753
type: AnswerComment
has text: @Bharadwaj — See point three, and the paragraph following it.
type: Comment
comment on: http://stackoverflow.com/a/27818983
score: 1

http://stackoverflow.com/a/27846433
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27846179
downvote count: 0
has comment: http://stackoverflow.com/comment/44096937
has body: I'm sure someone could improve on this but it should work: document.getElementById('combo').onchange = function() { // first reset all to hidden document.getElementById('text1').style.display = 'none'; document.getElementById('text2').style.display = 'none'; document.getElementById('text3').style.display = 'none'; // then switch case to show the required boxes switch(this.selectedIndex){ case 0: document.getElementById('text1').style.display = 'inline'; break; case 1: document.getElementById('text1').style.display = 'inline'; document.getElementById('text2').style.display = 'inline'; break; case 2: document.getElementById('text1').style.display = 'inline'; document.getElementById('text2').style.display = 'inline'; document.getElementById('text3').style.display = 'inline'; break; default: break; } }

http://stackoverflow.com/comment/44262104
score: 1
comment on: http://stackoverflow.com/q/27932127
type: Comment
type: QuestionComment
has text: @Walt - that's a problem then as the pattern in the class names could be fundamental to answering the question the way it is written.

http://stackoverflow.com/q/27836768
tagged with: python
answer count: 0
has title: When using JQuery for AJAX, why is my python file not returning an alert upon success
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44078642
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44341189
score: 0
has comment: http://stackoverflow.com/comment/44100100
has comment: http://stackoverflow.com/comment/44341235
tagged with: jquery
has comment: http://stackoverflow.com/comment/44341212
has body: I have done my best to follow all the different Python/JQuery/AJAX threads, but I am fairly new to programming and could use some more help specific to my problem. I am using Google App Engine, WebApp2 framework and Twitter Bootstrap for formatting to create a customer entry form. The HTML template I have created functions as expected, but I am currently trying to connect the HTML frontend to the high replication datastore backend and am experiencing difficulties. I would like to use asynchronous methodologies to save my form once it has been populated. When the user presses the save button, it currently triggers the following creates.js function createCustomer() { var clientNumber = document.getElementById("clientNumber").value; var clientCreateDate = document.getElementById("clientCreateDate").value; var clientName = document.getElementById("clientName").value; var clientAddress1 = document.getElementById("clientAddress1").value; var clientAddress2 = document.getElementById("clientAddress2").value; var clientState = document.getElementById("clientState").value; var clientZip = document.getElementById("clientZip").value; var clientPhone = document.getElementById("clientPhone").value; var clientFax = document.getElementById("clientFax").value; var clientWebsite = document.getElementById("clientWebsite").value; var clientEmail = document.getElementById("clientEmail").value; var clientNotes = document.getElementById("clientNotes").value; var clientFinancing = document.getElementById("clientFinancing").value; var clientStatus = document.getElementById("clientStatus").value; $.ajax({ url: "/json/customerDBBridge.py", type: "post", data: {'clientNumber':clientNumber, 'clientCreateDate':clientCreateDate, 'clientName':clientName, 'clientAddress1':clientAddress1, 'clientAddress2':clientAddress2, 'clientState':clientState, 'clientZip':clientZip, 'clientPhone':clientPhone, 'clientFax':clientFax, 'clientWebsite':clientWebsite, 'clientEmail':clientEmail, 'clientNotes':clientNot…
tagged with: ajax
tagged with: google-app-engine
has comment: http://stackoverflow.com/comment/44078036

apache
tag name: apache
tags question: http://stackoverflow.com/q/27864925
tags question: http://stackoverflow.com/q/27833500
type: Tag

http://stackoverflow.com/comment/44213559
has text: @ArjunMehta: To further muddy the waters, if you plan on using ncurses, you'll need to use ncurses functions to set terminal attributes, because ncurses does *not* interpret console control codes, so I expect that `\x1b[32m` will produce 7 output characters (just a guess, I didn't try the experiment). Getting rid of control codes is annoyingly difficult; there are a number of SO questions about that subject, mostly about cleaning up console output captured in a typescript file.
comment on: http://stackoverflow.com/a/27893208
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27834008
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27834090
tagged with: function
has comment: http://stackoverflow.com/comment/44073373
favorite count: 0
tagged with: scope
has body: What's the difference between this: (function() { function func1(){ console.log(1); }; func1.prototype.func2 = function(){ console.log(2); }; window.func1 = new func1(); })(); and this: function func1(){ console.log(1); }; func1.prototype.func2 = function(){ console.log(2); }; I know the first example will only create a copy of the internal function func1 and put it in the window scope, but the second example is already in the window scope. Are there any performance or advantages on using the first example?
accepted answer: http://stackoverflow.com/a/27834090
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/27839528
has title: Javascript function scope difference
has answer: http://stackoverflow.com/a/27839528
tagged with: javascript

http://stackoverflow.com/q/27869944
answer count: 1
accepted answer: http://stackoverflow.com/a/27896832
downvote count: 0
linked to: http://stackoverflow.com/q/9514698
favorite count: 0
has title: Programmatically opening a new tab within a callback
has body: I am looking to open a new tab, programmatically, in the callback of a save operation. Not very different from http://jsfiddle.net/5Lwwmbq8/1/ var atag = document.createElement('a'); atag.setAttribute('href', 'https://yahoo.com'); atag.setAttribute('target', '_blank'); atag.setAttribute('id','clickdamnit'); $('#onlydiv').append(atag); setTimeout(function() { atag.click(); }, 3000); If I don't put it within a callback everything works fine. But within the confines of the callback, it is blocked by a pop up blocker. Is there a way around this? I have tried substituting the anchor tag by window.open - same result.
type: AnsweredQuestion
tagged with: popup
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27896832
type: Question
tagged with: javascript
tagged with: jquery-events
has comment: http://stackoverflow.com/comment/44142402

http://stackoverflow.com/comment/44114657
has text: http://stackoverflow.com/questions/14643836/dynamic-class-in-angular-js
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27855665
score: 0

http://stackoverflow.com/a/27856085
type: Answer
has body: Try it like that way. Its working fine. Replace your code with this code: html += '&lt;div style="background: url(http://graph.facebook.com/' +photo+ '/picture?type=normal); background-size: cover;"&gt;';
answers question: http://stackoverflow.com/q/27854471
score: 0

http://stackoverflow.com/a/27870477
score: 1
has comment: http://stackoverflow.com/comment/44252094
has body: Looks like your code doesn't like this kind of links: Commentaires It's because of this piece of code: scrollItems = menuItems.map(function(){ var item = $($(this).attr("href")); The code is ok but if href="#", var item = $("#") --> error, js dies. Replace it for something like this (you'll have to figure out the correct anchor): Commentaires ...and it should work. Or modify the mentioned code bearing in mind the detail I mentioned. Hope it helps.
has comment: http://stackoverflow.com/comment/44258728
has comment: http://stackoverflow.com/comment/44258574
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27869258
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44253406
accepted answer of: http://stackoverflow.com/q/27869258

http://stackoverflow.com/comment/44179591
type: Comment
type: QuestionComment
score: 1
has text: it wraps all the plugin code and insulates it (closure) as well as provides context for `$` so plugin won't break on page where other libraries use `$`
comment on: http://stackoverflow.com/q/27888769

http://stackoverflow.com/comment/44154477
type: QuestionComment
comment on: http://stackoverflow.com/q/27876475
has text: Just iterate through [`HTMLTableElement.tBodies`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement.tBodies) collection and when you've found the wanted element, you'll have an index too.
score: 0
type: Comment

http://stackoverflow.com/q/27856721
tagged with: http://stackoverflow.com/tag/json
score: -1
type: Question
has title: printing json array containing svg elements in php
has answer: http://stackoverflow.com/a/27857007
tagged with: arrays
tagged with: javascript
answer count: 1
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has body: I've been having some difficulties getting a json string constructed in javascript and posted to a php page to print properly. I used a form to post the data and access it using: $json = $_POST['printMatter']; The json string looks like this: [{"type":"page","value":"page3"},{"type":"row","value":"newrow13"},{"type":"rowTitle","value":"Demographics"},{"type":"chartTitle","value":"Percentage of respondents by sex"},{"type":"chartSVG","value":"<g transform="translate(168.33333333333334,75)" class="arc"> 1 (N:15; 88.2%) </g><g transform="translate(168.33333333333334,75)" class="arc"> 2 (N:2; 11.8%) </g> 1 2 "},{"type":"chartTitle","value":"Percentage of respondents by age"},{"type":"chartSVG","value":"<g transform="translate(168.33333333333334,75)" class="arc"> 2 (N:17; 100.0%) </g> 2 "},{"type":"chartTitle","value":"Percentage of respondents by education"},{"type":"chartSVG","value":"<g transform="translate(168.33333333333334,75)" class="arc"> 2 (N:10; 58.8%) </g><g transform="translate(168.33333333333334,75)" class="arc"> 3 (N:3; 17.6%) </g><g transform="translate(168.33333333333334,75)" class="arc"> 1 (N:2; 11.8%) </g><g transform="translate(168.33333333333334,75)" class="arc"> 5 (N:1; 5.9%) </g><g transform="translate(168.33333333333334,75)" class="arc"> 6 (N:1; 5.9%) </g> 2 3 1 5 6 "},{"type":"row","value":"newrow23"}] I'm able to see this by creating some javascript from within the php file as such: $blurb = " "; echo $blurb; However, when I try to simply echo $json as follows: echo $json; The result is that I get bits of $json showing up on the page but other bits - mainly the SVG code in the json string ends up as html code that doesn't appear as text (i.e. I can see it in my console/inspector). When I try to use echo json_decode($json) I just get 'Array' If I then do: echo " "; echo print_r(json_decode($json)); echo " "; Then I get something that looks like this: Array ( [0] => stdClass Object ( [type] => page [value] => page3 ) [1] => stdClass Object ( [type]…
type: UnansweredQuestion
tagged with: php
upvote count: 0

contact-form-7
tags question: http://stackoverflow.com/q/27840448
type: Tag
tag name: contact-form-7
tags question: http://stackoverflow.com/q/27894223

http://stackoverflow.com/a/27890157
answers question: http://stackoverflow.com/q/27888681
has body: You are looking for the negativeColor and negativeFillColor options. Here's a link to the official example. And your code updated: $(function() { $('#chart-container').highcharts({ title: { text: '', x: -20 //center }, subtitle: { text: '', x: -20 }, exporting: { enabled: false }, xAxis: { categories: ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'Aug', 'Septemper', 'Oktober', 'November', 'December'], labels: { enabled: false }, }, yAxis: { gridLineWidth: 0, minorGridLineWidth: 0, title: { text: '' }, labels: { enabled: false }, plotLines: [{ color: 'orange', width: 2, value: 0, }] }, tooltip: { valueSuffix: 'Kr.' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, credits: { enabled: false }, series: [{ showInLegend: false, name: 'Tokyo', data: [0.0, 6.9, 9.5, -14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], color: 'purple', negativeColor: 'red' }] }); });
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44232975
score: 0
has text: view folder is in sitecore folder a what?
comment on: http://stackoverflow.com/q/27917255
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44097458
comment on: http://stackoverflow.com/q/27844208
score: 0
type: Comment
type: QuestionComment
has text: I believe I have resolved I run the command npm npm install -g I found a mistake in the first run Error: ENOENT, stat 'C:\Users\Marc\AppData\Roaming\npm' it was enough to create the folder specified in the ritch and relaunch npm npm install -g it all seems ok though it happens sometimes happens that comes out this error message C:\node>node debug web.js < debugger listening on port 5858 connecting... ok break in timers.js:77 75 } 76 77 function listOnTimeout() { 78 var msecs = this.msecs; 79 var list = this;

http://stackoverflow.com/comment/44230055
comment on: http://stackoverflow.com/a/27915271
type: AnswerComment
has text: when I use your code. in console error is .on is not function.
score: 0
type: Comment

http://stackoverflow.com/comment/44092267
comment on: http://stackoverflow.com/q/27835687
type: Comment
type: QuestionComment
score: 0
has text: http://stackoverflow.com/questions/23772801/basic-javascript-promise-implementation-attempt/

http://stackoverflow.com/q/27837315
has title: How to generate the content of an href link by the return value of a javascript function?
has comment: http://stackoverflow.com/comment/44079059
downvote count: 0
tagged with: hyperlink
has comment: http://stackoverflow.com/comment/44079529
tagged with: javascript
has body: I have a javascript function: function foo() { return "/a/b/SomeApi"; } then I have a href link in my web page. I want this link to point to the value returned by my javascript function, so that when the user clicks the link, it's as if the user had clicked a link with url /a/b/SomeApi. I tried following: Click But the result of this is the browser would open a new window showing the literal value /a/b/SomeApi instead of sending a request to the server. Any suggestions? Thanks.
type: AnsweredQuestion
score: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27837380
possible better answer: http://stackoverflow.com/a/27837377
has answer: http://stackoverflow.com/a/27837377
favorite count: 0
type: Question
upvote count: 2
answer count: 2
accepted answer: http://stackoverflow.com/a/27837380

http://stackoverflow.com/comment/44163873
type: AnswerComment
type: Comment
has text: the problem is it's working fine but the captcha doesn't change letters or numbers it changes dirctions or letters colors .. so instead of bold letters , schlagt letters and so
comment on: http://stackoverflow.com/a/27881003
score: 0

http://stackoverflow.com/q/27904647
has comment: http://stackoverflow.com/comment/44208792
answer count: 5
has comment: http://stackoverflow.com/comment/44209818
possible better answer: http://stackoverflow.com/a/27904670
has answer: http://stackoverflow.com/a/27905101
type: AnsweredQuestion
type: Question
has title: Targeting the specific link that the user clicks
has answer: http://stackoverflow.com/a/27904662
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27904841
has comment: http://stackoverflow.com/comment/44242928
score: 0
has answer: http://stackoverflow.com/a/27904714
has answer: http://stackoverflow.com/a/27904670
has body: I have a page full of different links that each have a class of .post-link. In the following function, I'd like the line $(this).html('loading...'); to target the specific .post-link div that is clicked. How would I go about achieving this? I feel I should create some sort of variable but I'm a bit lost. Any help would be appreciated. $('.post-link').click(function(e) { e.preventDefault(); var post_id = $(this).attr('rel'); var ajaxURL = site.ajaxurl; function projectShow() { $.ajax({ type: 'POST', cache: false, url: ajaxURL, data: {'action': 'load-content', post_id: post_id }, beforeSend: function() { $('#project-wrapper').addClass('activated'); $(this).html('loading...'); <--line in question }, success: function(response) { $('#project-container').html(response); $('.post-container').addClass('fadeInUp'); $('.close-button').addClass('fadeOutDown'); $('#project-wrapper .entry-title').shuffleLetters(); return false; } }); } Edit Here is how my HTML is set up: Using Alexander's solution, the "loading..." text shows up like this: loading... Is there a way to make it show like this? loading... Of course given that I wrap the text in span tags? Update $('.post-link').click(function(e) { e.preventDefault(); var post_id = $(this).attr('rel'), ajaxURL = site.ajaxurl; function projectShow() { $.ajax({ type: 'POST', cache: false, url: ajaxURL, data: {'action': 'load-content', post_id: post_id }, beforeSend: function() { $('#project-wrapper').addClass('activated'); $('loading...').insertBefore($(e.currentTarget).find('img')); }, success: function(response) { $('.loading').remove(); $('#project-container').html(response); $('.post-container').addClass('fadeInUp'); $('.close-button').addClass('fadeOutDown'); $('#project-wrapper .entry-title').shuffleLetters(); return false; } }); } if ($(window).scrollTop() != 0) { projectShow(); $('html, body').animate({ scrollTop : 0 },100); } else { projectShow(); } });
accepted answer: http://stackoverflow.com/a/27904662

http://stackoverflow.com/comment/44065969
comment on: http://stackoverflow.com/q/27829809
has text: I know the approach is different, as behind the scenes I'm using an mvc framework on top of angular, but the problem isn't in the angular implementation part, it's 99.5% working, funny that I can't mutate the array content property
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27806339
has title: AngularJS - concatenating dynamic content on AngularStrap $alert (?)
has body: hello guys I have an Angular Strap alert where I want to put some dynamic content. Look, this is the html I have so far: &lt;div ng-repeat="lineItem in lineItems"&gt; &lt;div class="panel panel-primary" ng-repeat="lineLeague in lineItem"&gt; &lt;div class="panel-heading"&gt; &lt;h3 class="panel-title"&gt;&lt;/h3&gt; &lt;/div&gt; as you can see there is a class named panel-title which is the same parameter that I want to show on my alert, I thought that only placing was enough, but once the alert shows up, the result is Sorry, no lines for at this moment :( and this is my code: var noLinesAlert = $alert({ title: 'Sorry, no lines for at this moment :(', container: '.no-lines-alert', type: 'danger', dismissable: false, show: false }) so what are your suggestions ?
score: 0
has comment: http://stackoverflow.com/comment/44026816
has comment: http://stackoverflow.com/comment/44024779
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: angular-strap
tagged with: javascript

http://stackoverflow.com/a/27933412
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27903611
has body: I'm not sure if this applies here, but in Android infowindows are NOT a live view. From what you've said it sounds like the infowindow is stuck showing loading. Perhaps you can refresh your infowindow by opening/closing it or setting content again.

http://stackoverflow.com/comment/44245999
score: 0
type: Comment
has text: ↑↑↑ wouldn't it be better then `Request.CreateErrorResponse(HttpStatusCode.NoContent)`?
comment on: http://stackoverflow.com/a/27924375
type: AnswerComment

memory
tags question: http://stackoverflow.com/q/27944219
tag name: memory
tags question: http://stackoverflow.com/q/27921854
tags question: http://stackoverflow.com/q/27864233
type: Tag
tags question: http://stackoverflow.com/q/27945889
tags question: http://stackoverflow.com/q/27897938

http://stackoverflow.com/comment/44185502
comment on: http://stackoverflow.com/q/27889930
score: 0
type: QuestionComment
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68608/discussion-between-nathan-wallace-and-user3739453).

http://stackoverflow.com/a/27958840
has comment: http://stackoverflow.com/comment/134830363
has comment: http://stackoverflow.com/comment/134824732
upvote count: 6
has comment: http://stackoverflow.com/comment/134819544
has comment: http://stackoverflow.com/comment/134829875
has body: You need to use anchors ^ and $ on both sides of your regex and make first part + or digit) optional. You can use this regex: ^([+\d].*)?\d$ RegEx Demo
answers question: http://stackoverflow.com/q/27958827
has comment: http://stackoverflow.com/comment/44311749
type: Answer
score: 6
downvote count: 0

http://stackoverflow.com/comment/44102687
score: 1
type: Comment
comment on: http://stackoverflow.com/q/27849355
type: QuestionComment
has text: This makes no sense, do you have multiple forms with the `.jot` class, and just want to target the `closest` form to the button? If so, it's just `$(this.form).serialize()` ?

http://stackoverflow.com/q/27889334
upvote count: 0
has answer: http://stackoverflow.com/a/27890470
has comment: http://stackoverflow.com/comment/44179699
has title: Error using javascript to show div
has comment: http://stackoverflow.com/comment/44179595
linked to: http://stackoverflow.com/q/14028959
type: Question
has body: Using asp.net in VS 2013. I have the following code. Information Contact Harris Redknapp Email harris@nefsa.co.uk Telephone 0800 888888 Address 1 Bali Court Middlesbrough TS21 5TT <asp:Image ID="informationImg" ImageUrl="~/images/HomeInformation.gif" runat="server" /> INFORMATION Information Contact Harris Redknapp Email harris@nefsa.co.uk Telephone 0800 888888 Address 1 Bali Court Middlesbrough TS21 5TT This is so when a particular the dic HPInformation or HPContact is moused over a div is shown on the page. The javascript for HP information works fine but the HP contact doesn't and I cant see why. Can anyone help?
duplicate of: http://stackoverflow.com/q/14028959
linked to: http://stackoverflow.com/q/4498482
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44179760
answer count: 1
downvote count: 1
tagged with: asp.net
favorite count: 0
duplicate of: http://stackoverflow.com/q/4498482
type: UnansweredQuestion

http://stackoverflow.com/q/27818307
tagged with: javascript
tagged with: angularjs-scope
has title: performed a small experiment with $watch in a directive
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27818571
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27818571
has body: Tryed to compare the difference between different $watch argument passing: Code: angular.module('app', []) .controller( 'someCtrl', [ '$scope', function ( $scope ) { $scope.someVar = 'a'; }]) .directive( 'dirName', [ function() { var directive = {}; directive.restrict = 'AE'; var link = function ( scope, element, attrs ) { console.log('link!'); scope.$watch( 'someVar', function() { console.log('var-string!'); }); scope.$watch( scope.someVar, function () { console.log ('var with scope!'); } ); scope.$watch( function () { return scope.someVar; }, function () { console.log('function returns the var!'); } ); } directive.compile = function ( scope, element, attr ) { console.log('compile!'); return link; } return directive; }]); Html: {{someVar}} b! Onload/parse we have: compile! link! (this parts is quite clear for understanding) var-string! var with scope! function returns the var On click: var-string! function returns the var! Can someone explain the difference between different setting types? What is preferred/faster/different cases/etc?
type: AnsweredQuestion
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/q/27841206
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44086068
has body: I have the ability for a user to post some text into a message feed. They are able to type whatever they want. The backend server detects that there are links and other linkable elements (like tagging someone else), then saves these links into a database. When a user is served up the full list of messages, they get shown what the user has posted, and anything that was meant to be a link is turned into a link For example someone typed www.foobar.com so the post will show www.footbar.com This works great, however what if someone types HTML in themselves. First off it will mess with formatting, and secondly it allows users to post their own HTML which can be dangerous for obvious reasons. I need a way of not turning the text that comes back from the API into HTML unless it was HTML that I intended. However I don't want to STOP someone trying to post HTML, just stop it turning into HTML Twitter does it correctly. If I post this to twitter www.footbar.com It will show me exactly what you see there, but the www.foobar.com will be highlighted and clickable. Although it may not be relevant, I am using a ASP.NET Web API backend and Knockout.JS for the front end UPDATE I am using the following code to show the text (knockout JS observables)
has answer: http://stackoverflow.com/a/27844333
has title: Stop text being made HTML unless needed
has comment: http://stackoverflow.com/comment/44086168
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44086162
tagged with: knockout.js
accepted answer: http://stackoverflow.com/a/27844333
type: Question
has comment: http://stackoverflow.com/comment/44086375
linked to: http://stackoverflow.com/q/23403468
has comment: http://stackoverflow.com/comment/44086664
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44086105

http://stackoverflow.com/comment/44109746
has text: @Barmar result is an object. loop through it and assign every of its result.a and result.b into item array.
comment on: http://stackoverflow.com/q/27852830
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27857329
has answer: http://stackoverflow.com/a/27859023
tagged with: javascript
score: 0
answer count: 1
tagged with: backbone.js
has body: The extra wrapping element generated by Backbone/Marionette views causes problems (with jQuery Mobile), so I need to unwrap it. After unwrapping, the layout is good, but events are no longer fired (see demo). How to unwrap the extra element while maintaining events? Demo It uses the Marionette.BossView plugin but the idea is the same without.
type: UnansweredQuestion
tagged with: marionette
linked to: http://stackoverflow.com/q/14656068
has title: How to unwrap the extra HTML element generaed by View while maintaining events?
type: Question

http://stackoverflow.com/comment/44273961
score: 0
has text: And show us some code in a *working* jsFiddle.
type: QuestionComment
comment on: http://stackoverflow.com/q/27938629
type: Comment

http://stackoverflow.com/comment/44135012
type: Comment
comment on: http://stackoverflow.com/a/27866217
score: 0
type: AnswerComment
has text: Could you explain what you have done and why please?

http://stackoverflow.com/q/27815644
tagged with: css
accepted answer: http://stackoverflow.com/a/27816450
has body: I'm making a webapp where you can place elements on a grid, move them around and rotate them. I've run into a problem regarding the rotation of the elements, if the width is an odd number and the height is even and vice versa. When rotating around the centre of the element, the new coordinates for the element will end off being in halves. The rotation happens when im adding a class to the element using jQuery, and the actual rotation is made by CSS. I need to get the element to line up with the grid after a "faulty" rotation. How can i achieve this?
favorite count: 0
has comment: http://stackoverflow.com/comment/44037801
has comment: http://stackoverflow.com/comment/44037655
has comment: http://stackoverflow.com/comment/44038779
has answer: http://stackoverflow.com/a/27816450
has comment: http://stackoverflow.com/comment/44037604
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44038885
type: Question
tagged with: rotation
score: 5
upvote count: 6
has comment: http://stackoverflow.com/comment/44037844
tagged with: javascript
tagged with: jquery
answer count: 1
downvote count: 1
has title: Rotate rectangular element 90 degrees on a grid
has comment: http://stackoverflow.com/comment/44038633

http://stackoverflow.com/comment/44209585
has text: I tried changing the same, but It stops at after printing "Invoking Restful API". I checked in the browser, still that works to confirm if server side is perfect. :(
type: Comment
comment on: http://stackoverflow.com/a/27903815
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44217688
has text: @Teemu : The code is here mate. [http://jsfiddle.net/9a3k74kd/](http://jsfiddle.net/9a3k74kd/)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27908666
score: 0

http://stackoverflow.com/q/27879708
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27881384
has title: Angular best practice to display constantly changing areas of a page
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27881384
has body: So I am a bit lost, and I'm pretty new to Angular, if someone can just let me know the best overall architecture method to accomplish something: I have a page with 2 big vertical areas. The first is a list of document names in a box. When you click on one of them, in the right area, a few tabs appear. One of them displays the document, embedded in a ViewerJS container, and then another has metadata related to that document. So anytime I change which document I'm clicking on in the left-hand column, I want the whole right hand side to refresh. I am unclear on exactly what I need to do here. I know the left hand side will issue a $http request, and then when it gets back the info from the server, it needs to load it into the right hand side somehow. I know in jQuery I would just create one big DIV on the right side, and when I wanted to replace it, I'd empty it in the DOM, and then stick the new HTML into it. I'm just unclear in Angular what is the correct approach to doing this? I am hopefully explaining myself well here in English.
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/44155297
type: AnswerComment
has text: Could you please describe in more detail how this is done? Where do I find the update-jdt.py file? What do I have to change in dev/build.xml and where do I have to put the jar file with the jdt fix?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27876880

http://stackoverflow.com/a/27904215
type: AcceptedAnswer
downvote count: 0
has body: The number is increasing because you are decrementing it every time. ({ 'marginTop' : "-=25%" }); That code should instead be: ({ 'marginTop' : "-25%" });
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27904047
accepted answer of: http://stackoverflow.com/q/27904047
score: 2

http://stackoverflow.com/a/27850581
upvote count: 5
has comment: http://stackoverflow.com/comment/44106492
has comment: http://stackoverflow.com/comment/44105773
score: 5
has comment: http://stackoverflow.com/comment/44105725
downvote count: 0
has comment: http://stackoverflow.com/comment/44107059
has comment: http://stackoverflow.com/comment/44106865
has comment: http://stackoverflow.com/comment/44106280
type: Answer
has comment: http://stackoverflow.com/comment/44106455
has comment: http://stackoverflow.com/comment/44107204
answers question: http://stackoverflow.com/q/27849882
has body: Is it possible to declare a "prototype member" using type script? No the language doesn't allow this at the moment. Workaround When the compiler is unhappy ... assert: class A { private member: string; } (&lt;any&gt;A.prototype).member = "value"; // suppressed why type script is designed this way Simply because it is non-idiomatic to have non functions on prototype. (1) the assignment this.member = "value" statement would not have to be executed every time a new instance is created, and (2) instance memory payload would be smaller. However lookup will definitely be slower. Here is a sample test : http://jsperf.com/prototype-vs-this-access

http://stackoverflow.com/q/27879983
score: 2
tagged with: cordova
downvote count: 0
type: UnansweredQuestion
type: Question
tagged with: localnotification
has comment: http://stackoverflow.com/comment/44531692
has body: I am using this plugin and trying to trigger local notification for my Cordova iOS app with Local notifications plugin. I dd following steps: Installed plugin: cordova plugin add de.appplant.cordova.plugin.local-notification@0.7.7 Updated config.xml: gap:plugin name="de.appplant.cordova.plugin.local-notification" Added the following JavaScript in head tag for index.html plugin.notification.local.promptForPermission(function (granted) { alert("promptForPermission: "+granted); }); plugin.notification.local.hasPermission(function (granted) { alert("hasPermission: "+granted); }); Have a button in index.html to create a local notification after 5 secs. Code for that looks like this: function setLocalNotification() { alert("from setLocalNotification"); var t = new Date(); t.setSeconds(t.getSeconds() + 3); window.plugin.notification.local.add({ title: 'Scheduled with delay', message: 'Test Message ', date: t }); alert("alert set"); }; I do see a prompt for user's permission and the alert from hasPermission method shows the value as true. But I am still not able to get the actual local notification I am trying to set by clicking a button. I have already updated the APPLocalNotification.m file for the this issue by copying this fix. I don't see any more errors in the console log but I am still not able to trigger a local notification.
upvote count: 2
has comment: http://stackoverflow.com/comment/44174027
has title: Trigger local notification for iOS - Cordova/Phonegap
tagged with: ios
answer count: 1
has comment: http://stackoverflow.com/comment/44168014
tagged with: javascript
has comment: http://stackoverflow.com/comment/44165968
favorite count: 0
has comment: http://stackoverflow.com/comment/44188137
has answer: http://stackoverflow.com/a/30349855
has comment: http://stackoverflow.com/comment/45594006

http://stackoverflow.com/q/27876229
tagged with: regex
favorite count: 0
has title: Split a string after a comma followed by any number
possible better answer: http://stackoverflow.com/a/27876251
has answer: http://stackoverflow.com/a/27876747
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27876249
score: 1
accepted answer: http://stackoverflow.com/a/27876249
has body: I have a variable that outputs an address, such as: Budapest, Mindegy utca, 1002 Hungary. I don't need the number and 'Hungary', only the first part. So I'd like to split if there is a comma followed by any number. The output of the address above should be: Budapest, Mindegy utca This is what I tried to do: addressVariable.split(', /\[[0-9]+\]/'); But it doesn't split the variable.
type: Question
has comment: http://stackoverflow.com/comment/44153900
tagged with: split
downvote count: 0
tagged with: javascript
tagged with: string
answer count: 3
has answer: http://stackoverflow.com/a/27876251

http://stackoverflow.com/q/27850382
tagged with: java
has comment: http://stackoverflow.com/comment/44105055
type: Question
has comment: http://stackoverflow.com/comment/44105577
has answer: http://stackoverflow.com/a/32076985
tagged with: javascript
has body: Hello. I have a problem with video source link. On my website i have my own video player and i want to play movies in this player thats why I need video source link. I have made script in PHP which retrieve video source url from html code. So I put htXtp://www.cda.pl/video/16942690/Uderz-ja-Reakcja-dzieci this code and on field in my site then my script grabbed video source url http://vsbg012.cda.pl/14204991293875.mp4?st=VOOh7w9RbwazMsCO9bP5pg&amp;e=1420688920 to database and everything were fine. Video was playing on my video player. After 3 hours I wanted do display this same movie from my site and then information appeared ‘The requested video is not found’.To see what happened, I went to this link htXtp://www.cda.pl/video/16942690/Uderz-ja-Reakcja-dzieci myself and checked html code on browser. It turned out that the video source url was changed! From this first above to this http://vsbg012.cda.pl/14204991293875.mp4?st=L1l4-FwEx1DQT4zvMaMy1w&amp;e=1420752870 . If you put video source link to brower then appear ‘401 Forbidden nginx’. Before in this same link was playing video on player. So thats mean they have some mechanism which generate links video source for every session or dynamically generate links with access token or it is part of some mechanism of server– I dont know. 1. I want to know what is that mechanism and how it called? 2. Is there possibilty to grab dynamically video source url to my site? Its normal when I put video source url on my database its static and stored. But I was wondering about that, when someone click on my video to play then -> programming language will grab dynamically video source url from normal link like that htXtp://www.cda.pl/video/16942690/Uderz-ja-Reakcja-dzieci and store it or database( ornot if not needed) -> video will play. 3. What tools and programming language should I use to do that script please give me advice and tips. Thanks for any help
has title: Video source link grabbing
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: php
tagged with: nginx

http://stackoverflow.com/q/27954413
has answer: http://stackoverflow.com/a/27954560
has comment: http://stackoverflow.com/comment/44303864
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/44303866
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27954470
has comment: http://stackoverflow.com/comment/44333401
type: Question
has body: So i'm testing $http.get in angular to grab a json file and i've used this code: $scope.classes = $http.get('coursedata.json') .success(function (result){ $scope.classes = result; a console.log(result); }) .error(function(data,status){ console.log(status); } ); but it wasn't working, its showing a successful get but in my angular html page it is not accessing the data. my html is something like: &lt;div class="row" ng-controller="oflClassCtrl"&gt; &lt;tr ng-repeat = "selectedClass in classes | filter:searchTxt"&gt; &lt;td&gt;&lt;a ng-click="clickToOpen($index)"&gt;{{selectedClass.class}}&lt;/a&gt;&lt;/td&gt; the page renders correctly when i have the data in the controller but for some reason something is not working when i try to use the get request and $http service. also im running a local host with php on xampp apache server so the $http should work right?
tagged with: javascript
has answer: http://stackoverflow.com/a/27974205
accepted answer: http://stackoverflow.com/a/27974205
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/27954470
has title: angular $http.get not working
tagged with: angularjs

http://stackoverflow.com/q/27888235
has answer: http://stackoverflow.com/a/27898650
type: Question
answer count: 2
tagged with: arcgis-js-api
has body: I was having some problem when trying to set the map to zoom to certain point. Here is how I set up my map using Esri base map with a OneMap map overlay on top of it: function setMap() { function init() { require( [ "esri/map", "dojo/dom-construct", "esri/geometry/Point", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/graphic", "esri/Color","esri/tasks/ProjectParameters", "dojo/domReady!" ], function ( Map, domConstruct, Point, SimpleMarkerSymbol, SimpleLineSymbol, Graphic, Color,ProjectParameters ) { map = Map("map-canvas", { }); map.setZoom(0); coreFunctions(); }); // Get current location map.on("load", getCurrentLoc); } dojo.ready(init); gsvc = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); } And I added an overlay: function addLayersToData() { var layer = new esri.layers.ArcGISTiledMapServiceLayer("https://www.onemap.sg/ArcGIS/rest/services/BASEMAP/MapServer"); mapLayers.push(layer); } And my method to set the map to zoom to certain point: function zoomPostal(postalCode) { $.getJSON("http://www.onemap.sg/API/services.svc/basicSearch?token=qo/s2TnSUmfLz+32CvLC4RMVkzEFYjxqyti1KhByvEacEdMWBpCuSSQ+IFRT84QjGPBCuz/cBom8PfSm3GjEsGc8PkdEEOEr&amp;searchVal=" + postalCode + "&amp;otptFlds=SEARCHVAL,CATEGORY&amp;returnGeom=0&amp;rset=1", function (data) { esriConfig.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); var loc = new esri.geometry.Point({ "x": data.SearchResults[1].X, "y": data.SearchResults[1].Y, "spatialReference": { "wkid": 3414 } }); var params = new esri.tasks.ProjectParameters(); params.geometries = [loc.geometry]; params.outSR = map.spatialReference; esri.config.defaults.geometryService.project(params, function (loc) { map.centerAndZoom(loc[0],12); }); }); } So far I know to zoom the map to certain level using setZoom but I have no idea how to zoom it to certain point. Any ideas? …
has comment: http://stackoverflow.com/comment/44177522
tagged with: javascript
tagged with: esri
tagged with: arcgis
has comment: http://stackoverflow.com/comment/44178073
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/41394597
has title: Esri Map Zoom to Certain Point
has comment: http://stackoverflow.com/comment/44177476
has comment: http://stackoverflow.com/comment/44189673
tagged with: maps
upvote count: 0
has comment: http://stackoverflow.com/comment/44178031
score: -1

http://stackoverflow.com/comment/44237302
type: AnswerComment
score: 0
type: Comment
has text: Worth noting that as the OP is using the `step` callback to do the actual animation that if animations are ever globally disabled in jQuery, the element wouldn't end up in it's final position. Not a problem here, as the final position is back where it started anyway.
comment on: http://stackoverflow.com/a/27919801

http://stackoverflow.com/q/27892082
has comment: http://stackoverflow.com/comment/44191458
downvote count: 1
has comment: http://stackoverflow.com/comment/44191450
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44191496
accepted answer: http://stackoverflow.com/a/27978161
has comment: http://stackoverflow.com/comment/44185991
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/44185396
has title: Can (should) JavaScript promises be used for co-dependent functions?
has comment: http://stackoverflow.com/comment/44191467
tagged with: javascript
has comment: http://stackoverflow.com/comment/44185776
has comment: http://stackoverflow.com/comment/44185907
has comment: http://stackoverflow.com/comment/44191857
has comment: http://stackoverflow.com/comment/44185950
score: 3
has comment: http://stackoverflow.com/comment/44191448
answer count: 1
tagged with: asynchronous
has answer: http://stackoverflow.com/a/27978161
favorite count: 0
has comment: http://stackoverflow.com/comment/44185394
has body: Promises are great for attaching something to the end of an async call, without the async call needing to be aware of its followers. Can promises be used in more general or complex situations where callbacks are needed in the middle of an async call, and if so can it provide the same level of separation? For example, suppose you have two functions a &amp; b where the execution order transfers from a to b and back twice. Using callbacks: function a() { console.log('a1'); b(function(b2) { requestAnimationFrame(function() { console.log('a2'); b2(); }); }); } function b(a2) { console.log('b1'); a2(function() { requestAnimationFrame(function() { console.log('b2'); }); }); } I'm aware that the two functions could be each broken into two pieces and strung together with promises, but that might lose important expensive-to-compute scope variables setup in a1/b1, or lead to redundant code or even harder to follow execution order. The question is, can this code be rewritten using promises in such a way that b() doesn't need to know about a(), but does offer the caller a chance to interject something before b() is done executing?
tagged with: promise
has comment: http://stackoverflow.com/comment/44191915
has comment: http://stackoverflow.com/comment/44191608

http://stackoverflow.com/comment/44139257
has text: You're right about suspecting the UDP socket buffer size. It may be that the datagrams are being received faster than the server can handle.
type: QuestionComment
comment on: http://stackoverflow.com/q/27867428
type: Comment
score: 2

http://stackoverflow.com/comment/44084207
type: Comment
type: QuestionComment
has text: @cDima Pebble doesn't support it, and the final js will run on the Pebble.
score: 0
comment on: http://stackoverflow.com/q/27840222

http://stackoverflow.com/comment/44297078
comment on: http://stackoverflow.com/a/27950959
has text: if text nodes do not have the innerHTML property, then why is it that alert(newNode.innerHTML) returns the value of message.paste as expected?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27903088
answer count: 1
downvote count: 0
favorite count: 0
has title: AngularJS Jqlite after doesn't add element
tagged with: angularjs
has answer: http://stackoverflow.com/a/27903604
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44206770
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/44207406
has comment: http://stackoverflow.com/comment/44284731
score: 3
tagged with: jqlite
tagged with: javascript
has comment: http://stackoverflow.com/comment/44205619
has body: Consider this runnable example: Why is el4 not put after el3? If I debug and print el3 it seems that el4 has disappeared. How can I put an element after another element, so that they become siblings? EDIT: I don't want to append el3, before calling .after(). I simply have two angular.elements an I want combine them into two siblings, and the append or replace them in the directive element. angular.module('myModule', []) .directive('mydir', [function () { return { restrict: 'E', scope: {}, template:' {{myf.str}}', link: function (scope, elem, attrs, ctrl) { var el = angular.element('First '); var el2 = angular.element('Second '); el.append(el2); elem.append(el); var el3 = angular.element('Third '); var el4 = angular.element('Fourth'); el3.after(el4); elem.append(el3); } }; }])
type: Question

http://stackoverflow.com/q/27851371
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44106818
has title: SyntaxError: Unexpected token var in my js code
downvote count: 3
has comment: http://stackoverflow.com/comment/44106830
upvote count: 1
type: Question
score: -2
has comment: http://stackoverflow.com/comment/44106799
tagged with: javascript
has answer: http://stackoverflow.com/a/27851387
tagged with: inheritance
has comment: http://stackoverflow.com/comment/44106817
answer count: 2
has comment: http://stackoverflow.com/comment/44106822
tagged with: variables
has body: I am trying to finish a small js task, wrote the code but I am getting a SyntaxError: Unexpected token var . Can you guys tell me what error is in it.? Modify the StudentReport class so that no grades will be printed to the console in the for-in loop. However, getGPA should still function properly in the last line. function StudentReport() { var grade1 = 4; var grade2 = 2; var grade3 = 1; var getGPA = function() { return (var grade1 + var grade2 + var grade3) / 3; }; } var myStudentReport = new StudentReport(); for(var x in myStudentReport) { if(typeof myStudentReport[x] !== "function") { console.log("Muahaha! " + myStudentReport[x]); } } console.log("Your overall GPA is " + myStudentReport.getGPA());
favorite count: 0
has answer: http://stackoverflow.com/a/27851385

http://stackoverflow.com/comment/44320962
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27963908
type: AnswerComment
has text: @thefourtheye thanks for your comment ! I edited my answer correspondingly.

http://stackoverflow.com/comment/44273426
has text: My problem is that this script is perfectly working if only and only I have ' ' region in my html code. When i have it with other codes it does not work.
type: AnswerComment
comment on: http://stackoverflow.com/a/27938064
score: 0
type: Comment

http://stackoverflow.com/q/27931610
has comment: http://stackoverflow.com/comment/44260945
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44260839
has comment: http://stackoverflow.com/comment/44260805
has comment: http://stackoverflow.com/comment/44260777
answer count: 2
has comment: http://stackoverflow.com/comment/44261198
has title: How do i get my keycode to focus the element?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44260859
score: 0
accepted answer: http://stackoverflow.com/a/27932183
has comment: http://stackoverflow.com/comment/44260803
possible better answer: http://stackoverflow.com/a/27931858
has answer: http://stackoverflow.com/a/27931858
has comment: http://stackoverflow.com/comment/44260717
has answer: http://stackoverflow.com/a/27932183
has body: If i leave it without a keycode it will work with every key but i'm trying to add the "/" key which is keycode "191" and now i can't get it to work. I've even tried using the preventDefault after it and still nothing. How do i properly write it to make it work? Yes i also have the keypress in my input line as well, it's not the problem. function setFocusToTextBox(field, event) { if (event.keyCode === 191) { document.getElementById("order_number").focus(); } } Jeffers HomeAgain Microchip Entry <form name="chip_insert" id="chip_insert" action="<?php echo $PHP_SELF;?>" onsubmit="return validateForm()" method="post" onkeydown="setFocusToTextBox(field, event)"> Order Number: <input tabindex="1" maxlength="12" type="text" name="order_number" id="order_number" value="<?php echo $value; ?>" required="required"onkeydown="return tabOnEnter(this,event)" onfocus="this.focus();this.select()" /> Tag Number:

http://stackoverflow.com/a/27868411
has comment: http://stackoverflow.com/comment/44139326
answers question: http://stackoverflow.com/q/27868330
has comment: http://stackoverflow.com/comment/44139385
has comment: http://stackoverflow.com/comment/44140378
type: Answer
has body: Your post is unclear so I'll give a couple sugesstions. If you're just trying to find out how to bind a hover event to the sibling of some known selector... JavaScript var el = document.getElementById('test').nextElementSibling; el.addEventListener('mouseover', function(e){...}); CSS #test+section:hover { ... } NOTE: HTML id attributes must be unique. So your markup shouldn't contain two elements with the same id.
has comment: http://stackoverflow.com/comment/44140107
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/27819094
answers question: http://stackoverflow.com/q/27818991
score: 0
has body: Below code will add the class to the last li.. $(document.ready(function() { $('.container li:last-child').addClass('active'); });
type: Answer

http://stackoverflow.com/comment/44260414
type: QuestionComment
comment on: http://stackoverflow.com/q/27930938
has text: Can you tell me which function? I tried the resource, tried the controller(though I don't know why would it work if I invoke the controller before it could get the data), but it didn't work.
score: 0
type: Comment

http://stackoverflow.com/comment/44179227
type: QuestionComment
comment on: http://stackoverflow.com/q/27889079
score: 0
has text: @hatzaviv Yesy, that would be good. Then I can choose it as the best answer to help anyone else having the same issue. Then they will be able to see the answer clearly. Thank you very much!
type: Comment

http://stackoverflow.com/comment/44104943
type: Comment
type: QuestionComment
has text: create a dependency system that loads dependencies first and only once
comment on: http://stackoverflow.com/q/27850349
score: 1

http://stackoverflow.com/q/27919843
accepted answer: http://stackoverflow.com/a/28418102
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
has title: Cyclomatic complexity paths count
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28419017
has answer: http://stackoverflow.com/a/28418102
has answer: http://stackoverflow.com/a/28419017
answer count: 2
downvote count: 0
tagged with: cyclomatic-complexity
favorite count: 0
has body: I'm reading a book about testable JS and there is a chapter about Cyclomatic complexity, but it doesn't really tell how to calculate it. It just says that Cyclomatic complexity is a measure of the number of independent paths through your code. And it gives this example stating that it has cyclomatic complexity of 2: function sum(a, b) { if (typeof(a) !== typeof(b)) { throw new Error("Cannot sum different types!"); } else { return a + b; } } Hence I'm wondering whether this made up example has a cyclomatic complexity of 3: function madeup(a) { if (typeof(a) === "string") { if (a === "some") { console.log("is a some"); } else { console.log("not a some"); } } else { console.log("not a string"); } } And this of 4: function madeup(a) { if (typeof(a) === "string") { if (a === "some") { console.log("is a some"); } else { console.log("not a some"); } } else { if (a === 5) { console.log("is a 5"); } else { console.log("not a 5"); } } } ?
has comment: http://stackoverflow.com/comment/45168296

http://stackoverflow.com/q/27904331
has comment: http://stackoverflow.com/comment/44207848
has answer: http://stackoverflow.com/a/27904446
has title: Order of string replacement function invocations
score: 2
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/27905376
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/27904446
type: Question
tagged with: regex
possible better answer: http://stackoverflow.com/a/27904420
has comment: http://stackoverflow.com/comment/44207859
has body: When calling String.replace with a replacement function we're able to retrieve offsets of the matched substrings. var a = []; "hello world".replace(/l/g, function (m, i) { a.push(i); }); // a = [2, 3, 9] In the example above, we're getting a list of offsets for the matching l characters. Can I count on implementations to always invoke the match function in ascending order of occurrence? That is: Can I be sure that the result above will always be [2,3,9] and not [3,9,2] or any other permutation of those offsets? I've looked at the specification and I cannot find anything that specifies the order of invocation, but perhaps this is implied by how the regular expression engine is supposed to be implemented?
has answer: http://stackoverflow.com/a/27904420
upvote count: 2
answer count: 2

http://stackoverflow.com/q/27927668
has title: Date object in JSON return data treated as string
has body: I try to get JSON data from an URL and to push the values into a function. All JSON values are enclosed by quotes to have a proper JSON format.But in fact not all values are strings. Here is a JSON sample: table = [ { 'date1': 'new Date(2015,13,1)', 'content': 'this is the content' }, { 'date1': 'new Date(2015,13,2)', 'content': 'this is the contentB' } ]; The file is loaded like this: var req = new XMLHttpRequest(); var url = "http://localhost/json-test"; req.onreadystatechange = function() { if (req.readyState == 4 &amp;&amp; req.status == 200) { var myData = JSON.parse(req.responseText); drawFunction(myData); } } req.open("GET", url, true); req.send(); function drawFunction(myData) { doSomething(); } This works - but the "new Date" values are (of course) also returned as strings. How can I convert them? The function should use the values like this: table = [ { 'date1': new Date(2015,13,1), //as new Date - not as string - without quotes 'content': 'this is the content' }, { 'date1': new Date(2015,13,2), 'content': 'this is the contentB' } ]; I might doing this completely wrong. Any hint would be appreciated. The JSON source file cannot be changed.
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/44252435
score: 0
has comment: http://stackoverflow.com/comment/44252561
answer count: 1
has comment: http://stackoverflow.com/comment/44254426
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27928670
has comment: http://stackoverflow.com/comment/44252491

http://stackoverflow.com/comment/44124904
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27860432
type: AnswerComment
has text: Hm.. ` {{mainFormTmpl}} ` is just for debugging. I used ng-include as attribute ``, because in documentation written that it can be used as attribute too. https://docs.angularjs.org/api/ng/directive/ngInclude All in all thank you for a solution. Just wondering why in my case ngInclude as attribute do not work.

http://stackoverflow.com/a/27860437
has body: This displays the number of child checkboxes that are checked: $(document).ready(function() { $('#global').click(function() { $('.child').prop('checked', $(this).is(':checked')); if ($(this).is(':checked')) $('#mydiv').show(); else $('#mydiv').hide(); count(); }); $('.child').change(function() { var checkedLength = $('.child:checked').length; if (checkedLength > 0) $('#mydiv').show(); else $('#mydiv').hide(); count(); }); }); var count = function() { var i = $('input.child:checked').length; $('#counter').html(i); } RESTORE | DELETE Checked:
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27860284
has comment: http://stackoverflow.com/comment/44128398
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44123287
downvote count: 0
has comment: http://stackoverflow.com/comment/44123246
type: Answer
accepted answer of: http://stackoverflow.com/q/27860284

http://stackoverflow.com/a/27857834
score: 0
answers question: http://stackoverflow.com/q/27857587
has body: Do not use jQuery for handling clicks. Use Angular. Try &lt;input ng-model="test" ng-click="foo();" id="openPaymentButton" type="submit" value="test"&gt; https://docs.angularjs.org/api/ng/directive/ngClick
type: Answer

http://stackoverflow.com/comment/44189118
score: 3
has text: In other words, you can't rely on it being in any particular format at all. `toDateString()` is convenient in some situations where precise control over the format doesn't matter, but most of the time, you need to do your own date formatting (or use something like https://github.com/samsonjs/strftime)
type: AnswerComment
comment on: http://stackoverflow.com/a/27893956
type: Comment

http://stackoverflow.com/q/27937721
answer count: 1
has comment: http://stackoverflow.com/comment/44272189
tagged with: onblur
has comment: http://stackoverflow.com/comment/44272156
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27937755
type: Question
has body: I have a form having 5 fields and a submit button. On one of the fields i am having an onblur event but if the user changes the value in that textbox and directly clicks on submit button then in that case onblur is notgetting triggered or not working. Even onchange is not working in that case. What if i use onkeyup and down but if user used mouse for pasting the data? Please help! Thanks and regards Asus.
tagged with: javascript
score: 0
has title: onblur even is not working as expected
tagged with: onchange

http://stackoverflow.com/comment/48065116
score: 0
type: QuestionComment
type: Comment
has text: Great if that helped anyhow...
comment on: http://stackoverflow.com/q/27898977

http://stackoverflow.com/comment/44032506
comment on: http://stackoverflow.com/q/27812511
has text: use parseFloat instead
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27853755
has comment: http://stackoverflow.com/comment/44111453
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44111524
score: 1
has body: Pretty sure you are returning a string not boolean. Try... if(data=="true")
accepted answer of: http://stackoverflow.com/q/27853672
answers question: http://stackoverflow.com/q/27853672
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44111510

http://stackoverflow.com/comment/44355358
type: AnswerComment
comment on: http://stackoverflow.com/a/27981428
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68951/discussion-between-naeem-shaikh-and-sajeetharan).
score: 0

http://stackoverflow.com/comment/44221086
type: Comment
has text: You are asking to take an asynchronous function, which is asynchronous for a reason, and make it synchronous... Research/understand asynchronous functions.
score: 0
comment on: http://stackoverflow.com/q/27909901
type: QuestionComment

http://stackoverflow.com/a/27810853
answers question: http://stackoverflow.com/q/27810789
downvote count: 0
type: Answer
upvote count: 2
score: 2
has body: I would suggest you select a random number m from 1 to n inclusive (where n is the maximum length of the sentence you want). Then you randomly select m items from the array and put them into a new array: var words = ["yes", "ok", "java", "pull my hair out", "sleep"]; alert(randomize(words, 10).join(" ") + "."); function randomize(array, maximum) { // array, n var length = Math.ceil(maximum * Math.random()); // m var result = new Array(length); var count = array.length; var index = 0; while (index &lt; length) { result[index++] = array[Math.floor(count * Math.random())]; } return result; } Hope that helps. Perhaps not.
has comment: http://stackoverflow.com/comment/44030521
has comment: http://stackoverflow.com/comment/44030492

ruby-on-rails
tags question: http://stackoverflow.com/q/27951698
tags question: http://stackoverflow.com/q/27855123
tags question: http://stackoverflow.com/q/27854597
tags question: http://stackoverflow.com/q/27804405
tags question: http://stackoverflow.com/q/27902548
type: Tag
tags question: http://stackoverflow.com/q/27879515
tags question: http://stackoverflow.com/q/27889443
tags question: http://stackoverflow.com/q/27910811
tags question: http://stackoverflow.com/q/27911761
tags question: http://stackoverflow.com/q/27869341
tags question: http://stackoverflow.com/q/27958853
tags question: http://stackoverflow.com/q/27825825
tags question: http://stackoverflow.com/q/27934461
tags question: http://stackoverflow.com/q/27855637
tags question: http://stackoverflow.com/q/27826118
tags question: http://stackoverflow.com/q/27911321
tags question: http://stackoverflow.com/q/27848615
tags question: http://stackoverflow.com/q/27889302
tags question: http://stackoverflow.com/q/27953354
tags question: http://stackoverflow.com/q/27879268
tags question: http://stackoverflow.com/q/27948111
tags question: http://stackoverflow.com/q/27906731
tags question: http://stackoverflow.com/q/27956857
tags question: http://stackoverflow.com/q/27889930
tags question: http://stackoverflow.com/q/27838100
tags question: http://stackoverflow.com/q/27836008
tags question: http://stackoverflow.com/q/27961768
tags question: http://stackoverflow.com/q/27961278
tags question: http://stackoverflow.com/q/27955586
tags question: http://stackoverflow.com/q/27821010
tags question: http://stackoverflow.com/q/27893442
tags question: http://stackoverflow.com/q/27854875
tags question: http://stackoverflow.com/q/27939610
tags question: http://stackoverflow.com/q/27808858
tags question: http://stackoverflow.com/q/27845569
tags question: http://stackoverflow.com/q/27894602
tags question: http://stackoverflow.com/q/27881937
tags question: http://stackoverflow.com/q/27921369
tags question: http://stackoverflow.com/q/27898455
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/27850996
tags question: http://stackoverflow.com/q/27824609
tags question: http://stackoverflow.com/q/27951061
tags question: http://stackoverflow.com/q/27806689
tags question: http://stackoverflow.com/q/27900637
tags question: http://stackoverflow.com/q/27872193
tags question: http://stackoverflow.com/q/27824200
tags question: http://stackoverflow.com/q/27845110
tags question: http://stackoverflow.com/q/27885620
tags question: http://stackoverflow.com/q/27946559
tags question: http://stackoverflow.com/q/27877024
tags question: http://stackoverflow.com/q/27866331
tags question: http://stackoverflow.com/q/27849237
tags question: http://stackoverflow.com/q/27921599

http://stackoverflow.com/comment/44055630
score: 0
comment on: http://stackoverflow.com/a/27824386
type: AnswerComment
has text: k is just to iterate over all the selected dates and used in the date format loop only. you can see it above.
type: Comment

http://stackoverflow.com/comment/72464605
type: Comment
comment on: http://stackoverflow.com/a/42663333
has text: But for the real purpose of this question, is indeed the best answer!
type: AnswerComment
score: 0

http://stackoverflow.com/a/27804535
answers question: http://stackoverflow.com/q/27804456
type: Answer
has body: else (choice1 === "scissors") { is an illegal statment. else if expects a conditional. else should not have one.
score: 0

http://stackoverflow.com/a/30440399
answers question: http://stackoverflow.com/q/27930702
downvote count: 0
has body: $ionicNavBarDelegate.showBackButton(false);
type: Answer
upvote count: 3
score: 3

http://stackoverflow.com/q/27812367
tagged with: binary-search-tree
has comment: http://stackoverflow.com/comment/44034047
has comment: http://stackoverflow.com/comment/44032778
has body: Here's my implementation for a Binary Search Tree in JavaScript. All functions appear to be working properly except for the remove function. Specifically, it seems to be removing nodes properly until there's 2 nodes left in the tree: var binaryTreeNode = function (value) { return { value : value, left : null, right : null }; }; var binarySearchTree = function () { var tree = Object.create( binarySearchTreeMethods ); tree.root = null; return tree; }; var binarySearchTreeMethods = { insert: function (value, node) { var newNode = binaryTreeNode( value ); // check if tree is empty if ( this.isEmpty() ) { this.root = newNode; return; } // initialize node if ( node === void 0 ) node = this.root; // compare value with node.value if ( value &lt;= node.value ) { // check if left exists if ( node.left ) { this.insert( value, node.left ); } else { node.left = newNode; } } else { if ( node.right ) { this.insert( value, node.right ); } else { node.right = newNode; } } }, remove: function (value, node) { var nextRightValue, nextLeftValue, minRight; if ( !this.isEmpty() ) { // initialize node if ( node === void 0 ) node = this.root; // compare the node's value with the value if ( value &lt; node.value ) { // check if there is a left node if ( node.left ) { node.left = this.remove( value, node.left ); } } else if ( value &gt; node.value ) { // check if there is a right node if ( node.right ) { node.right = this.remove( value, node.right ); } } else { // at this point, value === node.value // check if node is a leaf node if ( node.left === null &amp;&amp; node.right === null ) { // edge case of single node in tree (i.e. root node) if ( this.getHeight() === 0 ) { this.root = null; return this.root; } else { node = null; } } else if ( node.left === null ) { node = node.right; } else if ( node.right === null ) { node = node.left; } else { // node has both left and right minRight = this.findMinValue( node.right ); node.value = minRight; node.right = this.remove( minRight, node.right ); …
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27812601
downvote count: 0
possible better answer: http://stackoverflow.com/a/40910760
type: Question
has answer: http://stackoverflow.com/a/27812601
score: 3
tagged with: algorithm
has comment: http://stackoverflow.com/comment/44037407
has comment: http://stackoverflow.com/comment/44036737
tagged with: javascript
tagged with: data-structures
upvote count: 3
answer count: 3
has title: Binary Search Tree JavaScript implementation - remove function
has answer: http://stackoverflow.com/a/40910760
has answer: http://stackoverflow.com/a/49748709
has comment: http://stackoverflow.com/comment/44037774
has comment: http://stackoverflow.com/comment/44032998
favorite count: 0

http://stackoverflow.com/comment/44047683
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27820946
has text: Well, I need a working code which I will put in my function to get it work tho. I'm still new here. Thanks in advance
score: 0

http://stackoverflow.com/q/27833691
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44072918
score: 1
linked to: http://stackoverflow.com/q/8093057
type: Question
possible better answer: http://stackoverflow.com/a/27834291
has comment: http://stackoverflow.com/comment/44075512
has answer: http://stackoverflow.com/a/27834291
tagged with: javascript
has comment: http://stackoverflow.com/comment/44073869
has comment: http://stackoverflow.com/comment/44074012
tagged with: inheritance
has answer: http://stackoverflow.com/a/27833915
has comment: http://stackoverflow.com/comment/44101814
tagged with: prototype
has answer: http://stackoverflow.com/a/27833979
has comment: http://stackoverflow.com/comment/44073948
answer count: 3
has comment: http://stackoverflow.com/comment/44074745
linked to: http://stackoverflow.com/q/27821397
downvote count: 0
has comment: http://stackoverflow.com/comment/44073396
accepted answer: http://stackoverflow.com/a/27833979
has body: I'm trying to understand inheritance in Javascript. I know that every object has a prototype, which is an object it inherits properties from. I know that the .prototype property exists only on functions, and it is the object that will be set asthe prototype of objects created from this function, when it's used as a constructor. I know that clasically an object's prototype is inaccessible, although some browsers support the __proto__ property. (But since it's not a 'classical' part of the language, I want to understand how to use the language without it). So if all of this is correct (?), I want to underatand what the standard way is to define inheritance chains. The only approach I can think of is this: All objects that I want them to inherit from another object, have to be created through a constructor function. Their 'base object' would be set as the .prototype of their constructor. And when I want one of them to be a 'base object' of other objects, I'd set it as the .prototype of another constructor. And so on. This seems odd. Is there a way (in 'normal' JS) to set an object's 'base' directly? Or do I have to use constructors in the way described above, in order to create inheritance chains? What would be the 'standard' way to create inheritance? Is the approach I describsd the standard approach?
linked to: http://stackoverflow.com/q/19633762
has comment: http://stackoverflow.com/comment/44073807
favorite count: 0
has title: Is this the 'standard' way to define inheritance chains in JavaScript?

http://stackoverflow.com/q/27809142
has title: validateForm for data in loop
tagged with: submit
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44027517
tagged with: php
has comment: http://stackoverflow.com/comment/44027912
answer count: 0
tagged with: forms
type: Question
has body: I'm new here and my english is not perfect. I want to validateForm that examined the forms are not empty or if the data are numbers. If not, then the message and I would like to previous data in forms have. If so, then the message and redirect to another page. Forms are created in the loop: for. I can not find a solution, I tried in javascript, but maybe you know other solutions. Thank you. <?php for($i = 1; $i <= $num_rows; $i++) { echo ' '; } echo ' '; ?> `
tagged with: javascript
has comment: http://stackoverflow.com/comment/44027551
score: 0

http://stackoverflow.com/a/27901938
score: 0
answers question: http://stackoverflow.com/q/27896707
type: Answer
has body: You should set pointRange and then adapt tickInterval.

http://stackoverflow.com/comment/44331768
type: QuestionComment
has text: iOS shows you that the Catmull-Rom curve you've defined is entering and departing the curve points from the wrong direction. The tangents look right, so you seem to have lost some minus signs while you were porting to ensure the (dx,dy) stays (dx,dy) instead of becoming (-dx,-dy)
comment on: http://stackoverflow.com/q/27956441
score: 0
type: Comment

http://stackoverflow.com/comment/44262481
score: 0
type: Comment
type: QuestionComment
has text: What happens if you change `$(window).ready` to `$(document).ready`? Just curious if those are different events...
comment on: http://stackoverflow.com/q/27932208

http://stackoverflow.com/comment/77131861
type: AnswerComment
has text: To make it work with a relative path one can use: `'default_directory': process.cwd() + '/relative/path/'`.
score: 9
comment on: http://stackoverflow.com/a/27924901
type: Comment

http://stackoverflow.com/comment/44029172
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27810091
has text: @KrzysztofWende: and furthermore you probably better replace `\S` with `\w`, otherwise the comma (`,`) is captured as well.
type: AnswerComment

http://stackoverflow.com/comment/121592709
comment on: http://stackoverflow.com/a/50111377
type: Comment
has text: What is the character for TIF?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44319191
type: AnswerComment
comment on: http://stackoverflow.com/a/27962464
type: Comment
has text: What is RestangularProvider? It's not declared anywhere?
score: 0

http://stackoverflow.com/a/27852646
has comment: http://stackoverflow.com/comment/44117037
has body: As mentioned in the answers, defining a function on the scope and calling it on the binding expression solves the problem. But I would like to point some other options that you might consider. Binding to the left function: Take a look on your console to see how many times the function is called, even when you are doing nothing that should trigger the computation of characters. It affects Angular dirty check performance Binding to a pre computed property: Instead of put a function call on your expression like the option above, you can listen to the variables that matter for the characters left, and automatically compute again whatever they change, having always an updated value. $scope.$watch('[name,email,textarea]', function (values) { $scope.count = 255; angular.forEach(values, function (val) { $scope.count -= val? val.length : 0; }) }, true); Create a filter: Move the computation from the controller into an specific filter which receives the string to be measured and the max number of character: html &lt;span ng-bind="name + email + textarea | cl:255"&gt;&lt;/span&gt; javascript angular.module('contact', []) .filter('cl', function () { return function (input, size) { input = input || ''; return size - input.length; } }) Conclusion So, trying to help you with Cleaning up my View with AngularJS and give you some sort of answer. As you can see there are some options that you should consider and trade off which one is more appropriate. I personally would try to stick with the 3th options which uses an filter because it is more flexible and can be reused in any other view that you have.
has comment: http://stackoverflow.com/comment/44112876
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27851150
answers question: http://stackoverflow.com/q/27851150
type: Answer
upvote count: 2

http://stackoverflow.com/q/27846170
type: Question
has title: Css Rescaling Fixed Banner
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44097595
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: web
tagged with: meteor
has answer: http://stackoverflow.com/a/27846928
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/44097130
has comment: http://stackoverflow.com/comment/44097568
has body: So quick question, I haven't been able to find the correct phrasing perhaps in google but I'm attempting to make a fixed banner will scale when the page is resized. I've found that using a percentage width works for at least the large container, however my banner container within the main container will not rescale into that adequately (The banner is extending longer than the main container). CSS: .contMain { width:80%; position: top padding-top: 0; border-top: 0; margin: 0 auto; background-color: #F1EDCC; } .contMain-banner { position:fixed; width: inherit; background: #87AADF; } HTML: Some Title {{> MeteorTemplate}} The only higher level css is a .body tag in css for a background color. I am using MeteorJS for this. Cheers

http://stackoverflow.com/q/27940691
tagged with: jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44277470
accepted answer: http://stackoverflow.com/a/27941022
tagged with: scroll
has body: I have the following code: var w = $(window); var $navbar = $('.navbar'); var didScroll = false; w.on('scroll', function(){ didScroll = true; }); function AddScrollHeader(pxFromTop) { setInterval(function() { if ( didScroll ) { didScroll = false; var scroll = w.scrollTop(); if (scroll &gt;= pxFromTop) { $navbar.addClass('scroll-header'); } else { $navbar.removeClass('scroll-header'); } } }, 200); } w.on("resize", function(){ if ( w.width() &lt; 992 ) { didScroll = false; $navbar.addClass('scroll-header'); } else if ( w.width() &gt; 992 ) { AddScrollHeader(150); } else { return false; } }).resize(); It applies a class when required to the header across the widths, but for some reason on resize, less than 992 it still uses AddScrollHeader() even though its not in the coditional of the if. Does anyone know why this is happening? I've rearranged the didScroll and the top scroll function and in so many different places i can't seem to disable the scroll event.
type: Question
has comment: http://stackoverflow.com/comment/44277362
has answer: http://stackoverflow.com/a/27941022
tagged with: javascript
tagged with: resize
has title: Cancel time-based function from running in a conditional statement
has comment: http://stackoverflow.com/comment/44277545
score: 0
answer count: 1

http://stackoverflow.com/comment/44141114
type: Comment
score: 0
has text: Would I be better off spending my time learning JQuery then to accomplish this?
comment on: http://stackoverflow.com/q/27869088
type: QuestionComment

http://stackoverflow.com/a/28015404
has body: In the end, I decided to create a separate dimension, performing my filtering such that all groups reflect its values. duration = rides.dimension(function(d) { return d.timeonbike; }), durations = duration.group(), duration2 = rides.dimension(function(d) { return d.timeonbike; }), durationsAvg = duration2.groupAll().reduce(reduceAddDuration, reduceRemoveDuration, reduceInitialDuration).value(),
accepted answer of: http://stackoverflow.com/q/27915189
type: Answer
answers question: http://stackoverflow.com/q/27915189
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/44251639
has text: @VaelVictus do you have an example jsfiddle of this?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27846430
type: AnswerComment

http://stackoverflow.com/comment/44029674
has text: Well in my updated answer there is a codesnippet that you can pretty much copy and paste to you
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27810310
type: AnswerComment

size
type: Tag
tags question: http://stackoverflow.com/q/27854021
tag name: size

http://stackoverflow.com/comment/44307315
score: 0
comment on: http://stackoverflow.com/a/27956054
type: AnswerComment
type: Comment
has text: Nice! stopPropagation is what I needed. So, to get it clear, why would keypress happen after? Is it simply because it's below keydown code?

http://stackoverflow.com/q/27821961
has comment: http://stackoverflow.com/comment/44049672
has answer: http://stackoverflow.com/a/27822041
favorite count: 0
has answer: http://stackoverflow.com/a/27822024
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/27923546
accepted answer: http://stackoverflow.com/a/27923546
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27822024
has comment: http://stackoverflow.com/comment/44049591
answer count: 3
has body: This is a problem I've been struggling with for a while now. I've implemented an HTML5 progress element like so: 0 % Suppose I update the value of progress and percent in a JS loop: i = 0; pBar = document.getElementById('progress'); pBar.value = i;//start at 0% percent = 1;//set target for next progress bar update in % //DO do { //IF(i > i_max) EXIT //CALL VERLET VERLET(i, x, v, a, time, const0, gamma, A_o, omega, dt); x_plot[i] = [time[i], x[i]]; v_plot[i] = [time[i], v[i]]; a_plot[i] = [time[i], a[i]]; //i = i + 1 i = i + 1; if (parseInt(i / i_max * 100, 10) === percent) { pBar.value = percent;//update progress bar document.getElementById('percent').innerHTML = percent; percent = percent + 1; } //END DO } while (i < i_max); This is the relevant portion of my script. Please assume all variables are properly declared and initialized, and the script as whole is linted. A draft of the page can be found here. I don't understand why the values of the progress and output elements are not updated until after the calculation is finished. Or this is what appears to happen. IE11(?) seems to show some updating when initially loading the page, but again doesn't update the progress bar for a new calculation without reloading. Here is something along similar lines, but not using this modern method. I've taken a stab at getting this example to work, without success. This example, though better written I think, might shed some light on the problem. Is it a timeout issue? Is there a simple jQuery method I could make use of? Any feedback on this problem will be appreciated.
upvote count: 1
has title: HTML progress element not updating
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27840274
has title: Get the first value from a javascript array within an object
tagged with: arrays
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27840399
possible better answer: http://stackoverflow.com/a/27840399
has answer: http://stackoverflow.com/a/27840431
type: AnsweredQuestion
tagged with: object
accepted answer: http://stackoverflow.com/a/27840431
has body: CLICK FOR DEMO In the example below I am unable to get pick[0] to retrive the correct value. If pick[0] is hardcoded with one of the object values e.g A[0] the code works as expected. QUESTION How can I retrieve the first array value from the javascript object depending on the array selected? JQUERY var pick = $( "#select option:selected" ).text(), myArray = { A: ['#004d94', '#0073b9'], B: ['#f6f0c1', '#b9cdaf'] }; $(function () { $('.Bx').css('background', myArray.pick[0]); $('.Tx').text(pick); });
type: Question
score: 0
answer count: 2

http://stackoverflow.com/a/27889996
score: 1
downvote count: 0
has body: TJ Crowder is correct in that you cannot examine the constructor to examine if the "class" Foo has a certain method. However, you can do this: function Foo() { /* Constructor */ } Foo.prototype.bar = function() { /* Whatever you want */ } Then to test, you can simply do typeof Foo.prototype.bar === "function". There are various advantages and disadvantages to this approach. (See Use of 'prototype' vs. 'this' in JavaScript?). If you really need to test if a certain constructor's instances will inherit a method, you can use the prototype approach.
answers question: http://stackoverflow.com/q/27889925
type: Answer
upvote count: 1

http://stackoverflow.com/q/27829839
linked to: http://stackoverflow.com/q/1495219
upvote count: 7
type: Question
has body: I've been scouring the interwebz and Atom-shell documentation trying to find out how to disable the back() functionality of the backspace key within a browser window. I would prefer not to have to resort to a javascript onkeydown listener (which works) and rather use something more native and at more of the application level instead of the browser window level.
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
tagged with: electron
has title: Disable backspace in Atom-shell
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30831373
score: 7

http://stackoverflow.com/comment/44223981
has text: You actually create the script tag, that is ok but afterwards, you append the existing directive element on it. Nothing there can happen. You can try: `element.replaceWith(angular.element(' '));`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27912133
score: 0

http://stackoverflow.com/q/27921354
has comment: http://stackoverflow.com/comment/44253298
tagged with: computed-observable
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44245290
favorite count: 0
accepted answer: http://stackoverflow.com/a/27961213
tagged with: knockout-2.0
has comment: http://stackoverflow.com/comment/44245427
has comment: http://stackoverflow.com/comment/44240249
has body: Edit: Added code for function populateDropdown and function isSystemCorrect (see bottom) Edit 2 I have narrowed it down a bit and the problem seems to arise in the arrayFilter function in the computed observable. This returns an empty array, no matter what I try. I have checked that self.testsuites() looks ok right before filtering, but the filtering still fails. I have a problem with my computed observable, filteredTestsuites. As you can see from the screendump, the testsuites observable is populated correctly, but the computed observable remains empty. I have also tried choosing another option than "Payment" from the dropdown menu, to see if this will trigger the observable, it did not. I would think the computed observable would be updated every time self.testsuites() or self.dropdownSelected() was changed, but it doesnt seem to trigger on neither of them. What am I doing wrong here? I simply want to make the computed observable filter the testsuites after the chosen dropdown option, every time either of them change. function ViewModel() { var self = this; // The item currently selected from a dropdown menu self.dropdownSelected = ko.observable("Payment"); // This will contain all testsuites from all dropdown options self.testsuites = ko.mapping.fromJS(''); // This will contain only testsuites from the chosen dropdown option self.filteredTestsuites = ko.computed(function () { return ko.utils.arrayFilter(self.testsuites(), function (testsuite) { return (isSystemCorrect(testsuite.System(), self.dropdownSelected())); }); }, self); // Function for populating the testsuites observableArray self.cacheTestsuites = function (data) { self.testsuites(ko.mapping.fromJS(data)); }; self.populateDropdown = function(testsuiteArray) { for (var i = 0, len = testsuiteArray().length; i &lt; len; ++i) { var firstNodeInSystem = testsuiteArray()[i].System().split("/")[0]; var allreadyExists = ko.utils.arrayFirst(self.dropdownOptions(), function(option) { return (option.Name === firstN…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44323181
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44314165
has comment: http://stackoverflow.com/comment/44245639
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/44242497
has answer: http://stackoverflow.com/a/27961213
tagged with: javascript
has comment: http://stackoverflow.com/comment/44239952
has title: Knockout.js: computed observable not updating as expected

http://stackoverflow.com/q/27915602
has answer: http://stackoverflow.com/a/27917120
has body: I am trying to figure out how JXA(JavaScript for Automation) works, so try to translate a simple applescript as below to JXA. tell application "Finder" open location "smb://XXXXXXXX" end tell what I tried is here: finder = Application("Finder") finder.open({location:"smb://xxxxxx"}) but I fail..., and I am new to applescript, not really understand the description in library. and here is how the library describe the open open (v) : Open the specified object(s) open specifier : list of objects to open [using specifier] : the application file to open the object with [with properties record] : the initial values for the properties, to be included with the open command sent to the application that opens the direct object please kindly advise how should I amend the code. ^^ Thanks
answer count: 1
tagged with: javascript-automation
favorite count: 0
type: UnansweredQuestion
score: 3
upvote count: 3
has title: javascript for automation [open location in finder]
type: Question
downvote count: 0
tagged with: osascript
tagged with: javascript

http://stackoverflow.com/a/33586559
type: Answer
score: -1
downvote count: 1
has body: You can read a STEP file into FreeCAD, convert the solid to a mesh, and then export it to STL.
has comment: http://stackoverflow.com/comment/57007205
upvote count: 0
answers question: http://stackoverflow.com/q/27834498

http://stackoverflow.com/q/27928924
favorite count: 0
tagged with: datepicker
tagged with: drupal
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: A friend of mine has a Drupal 6 site where users are able to select a future date for a delivery. Recently, several customers have been selecting weekends and holidays for delivery dates, and my friend would like to prevent them from doing so. This is the code we're currently using to block out weekends. Can someone help modify it to also block out Christmas and New Years Eve? Thanks very much! drupal_add_js(" Drupal.behaviors.date_popup = function (context) { for (var id in Drupal.settings.datePopup) { $('#'+ id).bind('focus', Drupal.settings.datePopup[id], function(e) { if (!$(this).hasClass('date-popup-init')) { var datePopup = e.data; // CUSTOM datePopup.settings.beforeShowDay = function(date) { var day = date.getDay(); return [(day != 0 &amp;&amp; day != 6), '']; } // Explicitely filter the methods we accept. switch (datePopup.func) { case 'datepicker': $(this) .datepicker(datePopup.settings) .addClass('date-popup-init') $(this).click(function(){ $(this).focus(); }); break; case 'timeEntry': $(this) .timeEntry(datePopup.settings) .addClass('date-popup-init') $(this).click(function(){ $(this).focus(); }); break; } } }); } }; ",'inline'); UPDATE: I ended up doing the following, which works for our needs: drupal_add_js(" Drupal.behaviors.date_popup = function (context) { for (var id in Drupal.settings.datePopup) { $('#'+ id).bind('focus', Drupal.settings.datePopup[id], function(e) { if (!$(this).hasClass('date-popup-init')) { var datePopup = e.data; // CUSTOM datePopup.settings.beforeShowDay = function(date) { var day = date.getDay(), Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6; var closedDates = [[12, 31, 2015], [12, 25, 2015]]; var closedDays = [[Saturday], [Sunday]]; for (var i = 0; i &lt; closedDays.length; i++) { if (day == closedDays[i][0]) { return [false]; } } for (i = 0; i &lt; closedDates.length; i++) { if (date.getMonth() == closedDates[i][0] - 1 &amp;&amp; date.getDate() == closedDates[i][1] &amp;&amp; dat…
has title: Drupal 6 datepicker, blocking out weekends and certain holidays
downvote count: 0
tagged with: jquery
tagged with: drupal-6

http://stackoverflow.com/a/27933190
has comment: http://stackoverflow.com/comment/44265389
has comment: http://stackoverflow.com/comment/44271338
has comment: http://stackoverflow.com/comment/44264596
has comment: http://stackoverflow.com/comment/44265319
type: Answer
has comment: http://stackoverflow.com/comment/44264328
score: 2
has comment: http://stackoverflow.com/comment/44298166
downvote count: 0
has comment: http://stackoverflow.com/comment/44298257
accepted answer of: http://stackoverflow.com/q/27932818
upvote count: 2
answers question: http://stackoverflow.com/q/27932818
has comment: http://stackoverflow.com/comment/44266047
type: AcceptedAnswer
has body: Your issue is caused by the asynchronous call to query.find(). You practically order the browser to retrieve your information from the cloud database and tell him what to do with the result if it retrieves anything successfully, while the code continues execution (in your case, the for loop still iterates through the first collection). By the time the first request ends, for reaches the end and because the second query's success is in the scope of the first, the variable theuser is still instantiated and has the last value available. To prevent that, you can change the scope of the variable using a function call with your parameter. I've rewritten your code and it looks like this: var current = Parse.User.current(); var relation = current.relation("FriendRelations"); var $ul = $('ul') relation.query().find({ success:function(results){ for(var i = 0; i &lt; results.length; i++) { theuser = results[i].getUsername(); // you can use &lt;&lt;var $friendrating = $("&lt;li id='frienditems_" + i"'/&gt;").html(...... &gt;&gt; var $friendrating = $(document.createElement("li")).attr("id", "frienditems_" + i).html('&lt;div class="friendname"&gt;' + results[i].getUsername() + '&lt;/div&gt;') $ul.prepend($friendrating); getUserRating(theuser, $friendrating); } } }); function getUserRating(theUser, $node) { //Get friend's rating. //This is a query within a query. var GameScore = Parse.Object.extend("Rating"); var query = new Parse.Query(GameScore); query.equalTo("user", theUser); query.find({ success: function(result) { //The log just outputs the last user's name each time, because I guess the //other function already looped through completely, so it's forever set to the last one?** console.log(theUser); for (var y = 0; y &lt; result.length; y++) { var object = result[y].get("Rating"); //Logging the rating. console.log("Rating:" +object); $node.append('&lt;p class="friendrating"&gt;' + object + '&lt;/p&gt;'); } }, error: function(error) { } }); } Please, be advised that i haven't…

http://stackoverflow.com/comment/44077799
has text: According to the php docs it should be output how you want it, what do you get if you var_dump/print_r $r inside the while?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27836673

http://stackoverflow.com/q/27826876
tagged with: eclipse
answer count: 2
has comment: http://stackoverflow.com/comment/44357418
has comment: http://stackoverflow.com/comment/44424123
tagged with: validation
has body: Sometime ago I asked this question: Enable javascript validation for eclipse I wanted eclipse to highlight javascript errors/warnings.. The problem as you can see in the answer was that the project was not configured as Javascript Nature. Now I migrated to Eclipse Luna and have the same problem.. But now I cannot find anywhere the option to configure the project. Is there any other way?
has title: Enable javascript validation in eclipse luna
favorite count: 0
has answer: http://stackoverflow.com/a/27961632
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/25067186
has comment: http://stackoverflow.com/comment/44359567
upvote count: 4
has answer: http://stackoverflow.com/a/27903403
downvote count: 0
linked to: http://stackoverflow.com/q/9592081
type: Question
tagged with: javascript
score: 4

http://stackoverflow.com/a/27877121
has comment: http://stackoverflow.com/comment/44157107
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44157261
accepted answer of: http://stackoverflow.com/q/27877024
has comment: http://stackoverflow.com/comment/44155988
type: Answer
answers question: http://stackoverflow.com/q/27877024
score: 1
has comment: http://stackoverflow.com/comment/44156996
upvote count: 1
has comment: http://stackoverflow.com/comment/44155767
has body: You should delete the ) after var4 and $('#advertisement_registration_form').submit(); should be after the function call. function validate() { var var1 = document.getElementById("advertisement_age"), var2 = document.getElementById("advertisement_weight"), var3 = document.getElementById("advertisement_region_id"), var4 = document.getElementById("advertisement_height"); judge.validate(var1,var2,var3,var4, { valid: function(element) { element.style.border = '1px solid green'; }, invalid: function(element, messages) { element.style.border = '1px solid red'; alert(messages.join(',')); } }); // After no errors I want to submit form. $('#advertisement_registration_form').submit(); }

http://stackoverflow.com/comment/44895381
type: Comment
has text: Khan from my perspective it doesn't break declarative programming paradigm. My proposition refers to already defined concepts. I'm suggesting to make them more flexible. The directive order already defines the notion of priority, so having one inside directive is an over-engineering. So my proposition makes angular more simple and flexible. What are the gains if it will remain bulky and crusty but "declarative" according to your understanding? And it's "unfair" to refer to "declarative programming" since there is no universal measure for code being declarative enough for this or that purpose
comment on: http://stackoverflow.com/a/28194371
score: 0
type: AnswerComment

http://stackoverflow.com/a/27960326
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27960256
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27960256
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44314228
has body: Here is a reference to object oriented javascript on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript If you use the var keyword then those variables will be private to your object. You won't be able to do myObj.otherThing If you use this, then the variable is a property of your object, so you can use myObj.thing When you call a variable from within the object you would use this.thing, outside the object you would use myObj.thing Hope that helps.

http://stackoverflow.com/a/27840679
answers question: http://stackoverflow.com/q/27840592
type: Answer
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27840592
has body: $compile service always needs a scope to compile the given content. It basically executes every angular expression &amp; code in HTML in context with given scope. So you need to provide some scope in order to make it work like $rootScope. services.factory('getRegistersrvs', function($http, $rootScope, $compile) { return { getRegisterpage: function() { return $http.get(baseUrl+'signup', {cache: true}); }, replaceTemp: function(response, $elem) { $elem.replaceWith($compile(response.data)($rootScope)); } } });

http://stackoverflow.com/comment/44208954
type: QuestionComment
comment on: http://stackoverflow.com/q/27821029
score: 1
has text: @arisalexis - The other answer was more complete.
type: Comment

http://stackoverflow.com/q/27855951
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has body: I'm fairly new to Node and although I think it is great for service type apps I'm having some issues when using it for apps that simply run from end to end like a data export app when callbacks are needed for accessing databases or other such things. Here is my current setup. I have a script that exports data from MongoDB into an XML file to be used in a separate process. The export script is simple enough: db.getData(function(err, data) { data.forEach(function(entry) { // write the data to the file writeData(entry); }); }); The problem is when I need to make a non-synchronous call during the export such as: db.getData(function(err, data) { data.forEach(function(entry) { var cacheValue = cache.get(entry.someOtherId); if (cacheValue) { // write the value from the cache writeData(entry, cacheValue); } else { // THIS IS CALLED 1000's OF TIMES EVEN THOUGH THE FIRST FEW CALLS // SHOULD POPULATE THE CACHE db.getLookup(entry.someOtherId, function(err, value) { // store it in the cache to avoid db calls cache.store(entry.someOtherId, value); // write the data to the file after getting the lookup writeData(entry, value); }); } }); }); Due to the non-blocking nature of node while getLookup is being performed the main forEach loop will continue, and because the entry.someOtherId field is a lookup, often it will contain the same value as another record. So what happens is that for a large file with a relatively small amount of lookups I get thousands of database calls sent into getLookup before the first one has a chance to return and store the value in the cache. Pre-Loading not desired I know I could simply re-load the cache as the lookup table is fairly small, but how should this be tackled for larger lookups where it is not practical to re-cache all the values? Pausing the main loop In a synchronous environment this would be simple, the main loop would stop until the DB value is returned so next time round the value is already in the cache. I know there are various librarie…
has title: Exporting large file in node with database lookup - Avoid multiple DB calls?
linked to: http://stackoverflow.com/q/10161894
possible better answer: http://stackoverflow.com/a/27856614
type: Question
has answer: http://stackoverflow.com/a/27874864
tagged with: node.js
answer count: 2
upvote count: 1
accepted answer: http://stackoverflow.com/a/27874864
tagged with: caching
tagged with: mongodb
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27856614

http://stackoverflow.com/a/27916200
type: AcceptedAnswer
has body: Use display:inline-block and float:left properties like, INPUT TYPE TEXT INPUT TYPE TEXT INPUT TYPE TEXT INPUT TYPE TEXT </div
accepted answer of: http://stackoverflow.com/q/27916113
type: Answer
answers question: http://stackoverflow.com/q/27916113
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/27932208
has comment: http://stackoverflow.com/comment/44262981
has answer: http://stackoverflow.com/a/27932414
type: Question
has answer: http://stackoverflow.com/a/27932680
has title: Uncaught TypeError: undefined is not a function (asset-pipeline)
tagged with: asset-pipeline
possible better answer: http://stackoverflow.com/a/27932381
accepted answer: http://stackoverflow.com/a/27932680
has answer: http://stackoverflow.com/a/27932381
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44262481
has comment: http://stackoverflow.com/comment/44262653
tagged with: javascript
tagged with: jquery
has body: I am dealing with an Announcement class which I use to load information through an API when an event is called. Announcement = function Announcement (id) { var id = id; var vars = {}; this.load = function load () { $.ajax({ url: '/api/announcements/' + id, dateType: 'json', async: false, success: function (data) { vars = data.announcement; } }); } this.getVars = function getVars() { return vars; } } This is my event: $(window).ready(function () { Dynatable.selector.bind('dynatable:afterUpdate', function (rows) { $('.dy-button').on('click', function (event) { var record = $(this).attr('record'); var Announcement = new Announcement(record); Announcement.load(); }); }); }); The two pieces of code are in different files however they are concatenated with an asset-pipeline. The Announcement class is loaded first. When I reach: var Announcement = new Announcement(record); It says: Uncaught TypeError: undefined is not a function I have been trying to fix it for the past day.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44262693

http://stackoverflow.com/q/27922829
has answer: http://stackoverflow.com/a/27923012
accepted answer: http://stackoverflow.com/a/27923012
possible better answer: http://stackoverflow.com/a/27923031
has body: Very simple problem, but not sure how to solve it I have ng-repeat, that iterate model video. the model has a chosen value and I want to see it in the dropdown list: {{singleVideo}} this is the video model: $scope.model = { videos:[ {id:1,name:"VIDEO_ONE"}, {id:2,name:"VIDEO_TWO"} ] } this is the videoList item: $scope.videoList = [ {id:1,name:"VIDEO_ONE"}, {id:2,name:"VIDEO_TWO"}, {id:3,name:"VIDEO_Three"} ]; simply I expect to see that the first dropdown value will be set to VIDEO_ONE the second dropdown value will be set to VIDEO_TWO. Currently the dropdown is empty. How can I achieve that?
type: Question
has title: AngularJS ng-option inside ng-repeat
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27923031
upvote count: 11
tagged with: angularjs
score: 11
type: AnsweredQuestion

http://stackoverflow.com/q/27886280
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27887121
tagged with: javascript
has comment: http://stackoverflow.com/comment/44174996
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44174372
has body: I want to use this functionality in my website (when press in 'SHOW IT') --> http://labs.voronianski.com/jquery.avgrund.js/ The problem is that this functionality need to put body height to 100%. In some time, in me site I need to detect the scroll user to make topbar appear and disappear em some positions. So to can join this two functionality's, I only change body height to 100% when I press button to show the div avground. But where I have a problem: the button is on page footer and when I change body height, they automatically send me to the top of page and after show de div avground. Is any way to this don't happen or is possible to scroll to footer before the div avground appear? If someone have another solution, I appreciate. Thanks
tagged with: web
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27887121
has answer: http://stackoverflow.com/a/27887098
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: press button to make $("body").css("height":"100%")
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27887098

http://stackoverflow.com/q/27865013
tagged with: scope
score: 0
answer count: 2
has title: Revealing module pattern isn't setting my private variable, why?
has answer: http://stackoverflow.com/a/27865084
has comment: http://stackoverflow.com/comment/44132475
has answer: http://stackoverflow.com/a/27866743
type: UnansweredQuestion
has body: function stapler() { var color = "black"; function setColor(newColor) { console.log(color); //2. - black color = newColor; console.log(color); //3. - brown } function displayColor() { console.log(color); } return { c: color, set: setColor, display: displayColor } } thing = stapler(); console.log(thing.c); //1. - black thing.set('brown'); console.log(thing.c); //4. - black, why doesn't this print brown? As you can see from the above, thing.c (the last line) is returning black, but why not brown? Why doesn't the change get saved? What am I missing? EDIT: See http://repl.it/7gs for a working copy of the below code. function stapler() { var color = "black"; function setColor(newColor) { console.log(color); //2. - black color = newColor; console.log(color); //3. - brown } function getColor() { return color; } return { get: getColor(), set: setColor, } } thing = stapler(); console.log(thing.get); //1. - black thing.set('brown'); console.log(thing.get); //4. - black, why isn't this brown? And finally, to really complicate this ... check out the following example - (viewable at http://replit.com/7hD) function stapler() { var color = "black"; function setColor(newColor) { console.log(color); //2. - black, 6. - brown, why now has it changed? color = newColor; console.log(color); //3. - brown, 7. - purple } function getColor() { return color; } return { get: getColor(), set2: function(newColor) { setColor(newColor); }, set: setColor, } } thing = stapler(); console.log(thing.get); //1. - black thing.set('brown'); console.log(thing.get); //4. - black, why isn't this brown? console.log(thing.get); //5. - black, why isn't this brown console.log('-----'); thing.set2('purple'); console.log(thing.get); //8. - black What is going on here?
type: Question
tagged with: javascript

http://stackoverflow.com/a/28013089
type: AcceptedAnswer
score: 0
has body: Try $(function () { var suggestions = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: '/api/suggests?querytext=%QUERY', filter: function(results) { return $.map(results.Results, function(suggestion) { return {value:suggestion.Name, suggest:suggestion}; }); } }); suggestions.initialize(); $("#bloodhound .typeahead").typeahead({ minLength: 3, hint: true, highlight: true }, { name: 'suggestions', displayKey: 'value', templates: { suggestion: function(data) { var str = ''; if (data.suggest.Type === 'Customer') { str += '' + data.suggest.Type + ''; } else if (data.suggest.Type === 'Product') { str += '' + data.suggest.Type + ''; } str += ' ' + data.value + ' '; return str; } }, source: suggestions.ttAdapter() }); }) $(function () { var data = { "Results":[ { "Type":"Customer", "Id":5, "Name":"Bill", "LastUpdated":"01-01-2015" }, { "Type":"Customer", "Id":135, "Name":"Billows", "LastUpdated":"01-02-2015", }, { "Type":"Product", "Id":241, "Name":"Bill Check", "LastUpdate":"01-04-2015" } ], "TotalResults":3, "TotalCustomers":2, "TotalProducts":1 }; var suggestions = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, local: $.map(data.Results, function(d) { return {value:d.Name, suggest:d} }) }); suggestions.initialize(); $("#bloodhound .typeahead").typeahead({ minLength: 3, hint: true, highlight: true }, { name: 'suggestions', displayKey: 'value', templates: { suggestion: function(data) { var str = ''; if (data.suggest.Type === 'Customer') { str += ''+data.suggest.Type+''; } else if (data.suggest.Type === 'Product') { str += ''+data.suggest.Type+''; } str += ' ' + data.value + ' '; return str; } }, source: suggestions.ttAdapter() }); }) @font-face { font-family:"Prociono"; src: url("../font/Prociono-Regular-webfont.ttf"); } html { overflow-y: scroll; } .container { margin: 0 auto; max-width: 750px; te…
type: Answer
accepted answer of: http://stackoverflow.com/q/27926875
answers question: http://stackoverflow.com/q/27926875

http://stackoverflow.com/comment/44239886
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27918189
has text: @FossArduino If my answer helped you, please mark it as accepted so future seekers could know you found a solution to your problem.
score: 0

http://stackoverflow.com/a/27876010
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: if you have access to the slides array and you know which is the current slide you can show/hide parts of the slide navigation. Here is one working jsfiddle based on yours. jQuery: $('.slideshow &gt; ul') .before('&lt;div class="wrapper"&gt;&lt;div class="content"&gt;&lt;div class="slide-nav"&gt;') .cycle({ fx: 'scrollLeft', speed: '600', timeout: 4000, pager: '.slide-nav', next: '#next', prev: '#prev', nowrap: true, onPrevNextEvent: function(isNext, zeroBasedSlideIndex, slideElement) { if(zeroBasedSlideIndex == 0) { $('#prev').hide(); } else { $('#prev').show(); } if(zeroBasedSlideIndex == ($('#slideshow ul li').length - 1) ) { $('#next').hide(); } else { $('#next').show(); } } }); Nowrap prevents the slides from looping. onPrevNextEvent is the main part.
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27874557
answers question: http://stackoverflow.com/q/27874557
score: 2

http://stackoverflow.com/comment/44248533
comment on: http://stackoverflow.com/a/27925444
has text: @indubitablee Assuming it's a problem on the server rather than the client. If it's the client mangling the URL in the PUT request, changing stuff on the server won't help.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/44147933
score: 0
type: Comment
has text: The space in your selector means you will select all `.total` elements that are descendants of `td` elements. You need to remove that space: `'td.total'` to select tds with that class, but in any case that doesn't help because the question is about selecting the td with that class *in the same row* as the clicked anchor.
comment on: http://stackoverflow.com/a/27872793
type: AnswerComment

http://stackoverflow.com/q/27832311
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27832406
possible better answer: http://stackoverflow.com/a/27832397
upvote count: 2
has title: Can't get my Quiz app to work
type: Question
has body: I'm doing the "Learn JavaScript Properly" track on http://javascriptissexy.com/how-to-learn-javascript-properly/. It took me forever, but I finally figured out how to get to the next question, but the choices don't change. However, when I hard code the "questionIndex" the question and choices work fine. Anyway here's my code (I know it's a bit messy, I'm a beginner): http://jsfiddle.net/utfwae8d/1/ HTML: &lt;div id="container"&gt; &lt;div id="quiz"&gt;&lt;/div&gt; &lt;div id="choices"&gt;&lt;/div&gt; &lt;input type="button" value="Next"&gt; &lt;/div&gt; JavaScript: var allQuestions = [{ question: "Who is the best in the world?", choices: ["CM Punk", "John Cena", "Daniel Bryan", "Roman Reigns"], correctAnswer: 0 }, { question: "Who is the current WWE World Champion?", choices: ["John Cena", "Brock Lesnar", "Triple H"], correctAnswer: 1 }, { question: "Where is Toronto located?", choices: ["Ontario", "California", "Georgia", "Texas"], correctAnswer: 0 }, { question: "What is the largest California city?", choices: ["Los Angeles", "San Fransico", "San Deigo", "Anahiem"], correctAnswer: 0 }]; var quiz = document.getElementById('quiz'); var choicesContainer = document.getElementById('choices'); var nextButton = document.querySelector('[type=button]'); var correctAnswers = 0; var questionIndex = 0; function showQuiz() { var currentQuestion = allQuestions[questionIndex].question; quiz.textContent = currentQuestion; var choicesNum = allQuestions[questionIndex].choices.length; var correctAnswer = allQuestions[questionIndex].correctAnswer; var choices; for (var i = 0; i &lt; choicesNum; i++) { choices = allQuestions[questionIndex].choices[i]; choicesHTML = "&lt;input type='radio' name='choice'&gt;" + choices + "&lt;/br&gt;"; choicesContainer.innerHTML += choicesHTML; } nextButton.addEventListener('click', function () { questionIndex++; quiz.textContent = allQuestions[questionIndex].question; }); } showQuiz();
tagged with: javascript
has answer: http://stackoverflow.com/a/27832505
accepted answer: http://stackoverflow.com/a/27832406
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27832397

http://stackoverflow.com/q/27808924
has comment: http://stackoverflow.com/comment/44027664
answer count: 2
has comment: http://stackoverflow.com/comment/44026852
tagged with: javascript
tagged with: web
score: 0
possible better answer: http://stackoverflow.com/a/27809230
has answer: http://stackoverflow.com/a/27809230
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44027698
tagged with: css
has body: I have the following script in usage: script type="text/javascript"&gt; $(document).ready(function () { $('li:last-child').hover(function () { $('#test').addClass('transparent'); //mouseover }, function () { $('#test').removeClass('transparent'); //mouseout }); }); &lt;/script&gt; With the following HTML layout: &lt;body onload="javascript that makes the menu..."&gt; &lt;div id="menu" //this houses the li elements that are created by the javascript&gt;&lt;/div&gt; &lt;div id="test"&gt; Essentially, I have javascript that creates a menu filled with li elements. The last of these elements should be able to change the opacity of a div with the id test on hover. The css that is relevant is as follows: .transparent{ opacity: 0 !important; } But for some reason, this code doesn't work. Inspecting in the browser's console gives me a TypeError that $(...) is null at the line that starts the javascript seen above. What could cause this error, and how could I work around it?
has comment: http://stackoverflow.com/comment/44027680
has comment: http://stackoverflow.com/comment/44026901
has comment: http://stackoverflow.com/comment/44027717
has answer: http://stackoverflow.com/a/27808984
accepted answer: http://stackoverflow.com/a/27808984
type: Question
has title: What can cause a document.ready function to be null?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44027073

http://stackoverflow.com/q/27823740
type: Question
score: 5
has answer: http://stackoverflow.com/a/27829709
tagged with: javascript
has title: Chrome extension message passing between content and background not working
has body: I am developing a chrome extension, here are the main files: background.js getPageDimension = function (){ chrome.tabs.getSelected(null, function(tab) { chrome.tabs.sendMessage(tab.id, { message: "DIMENSION" }, function(response){ if (response != null) { console.log(response.x); console.log(response.y); console.log(response.w); console.log(response.h); }else{ console.log('Response is null'); } }); }); }; content.js chrome.runtime.onMessage.addListener(function(msg, sender, sendResponse) { if (msg.message &amp;&amp; (msg.message == "DIMENSION")) { var dimension = getPageDiemension(document.documentElement); console.log(dimension.x); console.log(dimension.y); console.log(dimension.w); console.log(dimension.h); sendResponse({x: dimension.x, y: dimension.y,w: dimension.w,h: dimension.h}); } }); getPageDiemension = function(currentDom){ var dimension = new Object(); dimension.x = 0; dimension.y = 0; dimension.w = currentDom.scrollWidth; dimension.h = currentDom.scrollHeight; return dimension; } So my aim is to get the full height and width of page loaded in current active tab. When I debug my content script, I get the proper response in my background.js, but if run the script without debugging, I get an undefined response in my background.js. Here is the declaration of my cotent.js in my manifest.json file: "content_scripts": [{ "all_frames": true, "matches": [ "http://*/*", "https://*/*" ], "js": ["content.js"] }], Kindly help me, where am I going wrong?. Let me know if you need any further data.
tagged with: google-chrome-extension
answer count: 1
favorite count: 0
upvote count: 5
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27829709
tagged with: google-chrome

http://stackoverflow.com/a/27812940
has body: Firstly you have to inject 'ngRoute' in your angular module in the way: var sampleApp = angular.module('sampleApp', ['ngRoute']); Another thing is include angular-route.js in your index.html file This will resolve your problem
answers question: http://stackoverflow.com/q/27812685
has comment: http://stackoverflow.com/comment/44035031
has comment: http://stackoverflow.com/comment/44033752
score: 0
type: Answer

http://stackoverflow.com/q/27940900
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27966194
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/27966194
type: Question
tagged with: filtering
has title: Jquery filter table with multiple range sliders
tagged with: jquery-ui
has body: the other day i asked almost the same question Jquery slider range: apply range as a filter on table rows i got a fast and good answer on it, and i tought i could change it myself to make it so it accepts multiple range sliders and would filter on them all. I tried writing a function like this: function slide(){ var table = document.getElementById("ADC_DAC"); for (var i = 1, row; row = table.rows[i]; i++) { //iterate through rows (we SKIP the first row: counter starts at 1!) for (var j = 0, col; col = row.cells[j]; j++) { //iterate through columns: if first column not in range: HIDE, else SHOW //if (j == 0) { // if first column if ($(col).html() &gt;= indexmin &amp;&amp; $(col).html() &lt;= indexmax &amp;&amp; j == 0) { // if in interval $(row).show(); } else if ($(col).html() &gt;= minvoltmin &amp;&amp; $(col).html() &lt;= minvoltmax &amp;&amp; j == 7){ if (j==7) { $(row).show(); } }else{ $(row).hide(); } } } } indexmin, indexmax, minvoltmin and the minvoltmax are the minimal and max from the sliders. the indexmin has to filter in the first column and the minvoltmin is for the 8th column. the expected output was a table that changes when you move the slider, but it just clears the table and doesnt change anymore after that. Thanks for the help in advance :)
tagged with: javascript
linked to: http://stackoverflow.com/q/27841464
answer count: 1
downvote count: 0

http://stackoverflow.com/q/27962811
tagged with: regex
has answer: http://stackoverflow.com/a/27962878
accepted answer: http://stackoverflow.com/a/27962878
tagged with: parsing
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27963231
has body: I create a javascript parser for my markup language. I wish no spaces between tags and content like this: __underline a sentence __and more. (or correctly : __underline a sentence__ and more.) to : underline a sentence and more. But result is in the first case : underline a sentence and more. My code : var tabML = ['\'','*','_'], tabHTML = ['em','strong','u'] tag, char; for(var i=0; i<tabML.length; i++){ tag = tabHTML[i]; char = tabML[i]; regex = new RegExp(char+char+'(.+)'+char+char, 'ig'); txt = txt.replace(regex, '<'+tag+'>$1</'+tag+'>'); } Thanks.
type: Question
tagged with: replace
score: 0
possible better answer: http://stackoverflow.com/a/27963231
answer count: 2
tagged with: javascript
has title: how to remove white space at the beginning and end of a regular expression?

http://stackoverflow.com/a/27813911
score: 0
answers question: http://stackoverflow.com/q/27813134
has body: You can get the length of text input elements next to the 2nd text area with the below js: //get the index of 2nd textarea tr var curIndex = $("table textarea:eq(1)").closest("tr").index(); //get the length of text input elements var txtlen = $("table tr:eq("+curIndex+")").nextAll('tr').andSelf().find("input[type=text]").length; alert(txtlen); Demo Link: http://jsfiddle.net/84wk1kry/2/
type: Answer

http://stackoverflow.com/q/27922848
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44243042
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/27923208
has title: Hiding Form Options when selecting an option with jquery
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27923208
has comment: http://stackoverflow.com/comment/44242735
has body: I am trying to have certain options of a dropdown display/hide when an option from a proceeding dropdown menu is selected, a friend sent me this sort of format for the script but i cant figure out how to get it to work as im not the most experienced with jquery and javascript but this worked for him (he was using text links instead of options in a dropdown) HTML Choose a Location None Dubai Bora Bora Vancouver Rio De Janeiro Choose a Resort None Resort 1 Resort 2 Resort 3 Resort 4 Resort 5 Resort 6 SCRIPT
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27923158
has answer: http://stackoverflow.com/a/27923158

http://stackoverflow.com/q/27912296
has comment: http://stackoverflow.com/comment/44247415
has answer: http://stackoverflow.com/a/34928891
upvote count: 20
has answer: http://stackoverflow.com/a/54027215
tagged with: javascript
linked to: http://stackoverflow.com/q/42768017
score: 20
has body: does anyone know how to check if IE 11 compatibility mode is ON when I'm on a website through javascript? I added the url to the list compatibility view settings. But when I do navigator.userAgent in developer tools, it returns Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; rv:11.0) like Gecko Looking at the microsoft website (http://msdn.microsoft.com/en-us/library/ie/hh869301(v=vs.85).aspx), it says The compatible ("compatible") and browser ("MSIE") tokens have been removed. Any help on detecting whether a page is using compatibility view via javascript would be really helpful. Thanks in advance.
has answer: http://stackoverflow.com/a/33003772
has answer: http://stackoverflow.com/a/41100718
downvote count: 0
has comment: http://stackoverflow.com/comment/44256259
answer count: 7
favorite count: 0
linked to: http://stackoverflow.com/q/14791619
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28346371
has comment: http://stackoverflow.com/comment/44224264
has comment: http://stackoverflow.com/comment/44225751
has answer: http://stackoverflow.com/a/39989439
tagged with: ie-compatibility-mode
tagged with: internet-explorer-11
has answer: http://stackoverflow.com/a/28008427
has comment: http://stackoverflow.com/comment/44229299
type: Question
has title: IE11 detect whether compatibility view is ON via javascript

http://stackoverflow.com/comment/44296033
has text: @Rytmis so there should be two promises. one in the controller and one in the service?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27945213
type: Comment

http://stackoverflow.com/comment/44037680
type: QuestionComment
type: Comment
score: 9
comment on: http://stackoverflow.com/q/27815702
has text: [**read more**](http://programmers.stackexchange.com/questions/171203/what-are-the-difference-between-server-side-and-client-side-programming) about diff b/w server side and client side programming

http://stackoverflow.com/comment/44156117
comment on: http://stackoverflow.com/q/27877253
type: Comment
type: QuestionComment
has text: i want when user click on btn all of tag reload again without page reloading.
score: 0

http://stackoverflow.com/comment/44144658
has text: serialize() does not capture files, only values of controls. There are numerous tutorials on how to upload with ajax , as well as some good plugins that help make it easier
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27870836

http://stackoverflow.com/comment/44295628
has text: That the column size equals the row size is your own assumption, which may not be true.
type: AnswerComment
comment on: http://stackoverflow.com/a/27949614
score: 0
type: Comment

http://stackoverflow.com/comment/44234152
has text: Can you replicate this in a fiddle?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27917966

http://stackoverflow.com/q/27932803
has comment: http://stackoverflow.com/comment/44263371
linked to: http://stackoverflow.com/q/486896
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: I have http://localhost/?val=1 When I click on a link, is there a way this link can append a query variable to the current string, for example: Link so when I click it the url would be: http://localhost/?val=1&var2=2 but when I click the link it removes the first query string and looks like http://localhost/&var2=2 Is such a thing possible with normal HTML?
score: 1
has comment: http://stackoverflow.com/comment/44263896
upvote count: 1
accepted answer: http://stackoverflow.com/a/27933221
type: Question
type: AnsweredQuestion
tagged with: javascript
linked to: http://stackoverflow.com/q/111529
has comment: http://stackoverflow.com/comment/44263676
has comment: http://stackoverflow.com/comment/44263340
answer count: 2
has title: HTML Append Variable to Query String
has answer: http://stackoverflow.com/a/27933334
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27933221
possible better answer: http://stackoverflow.com/a/27933334

http://stackoverflow.com/a/27940784
has body: You want to use the click events context to get this which is the individual element. You can either use the node directly or convert to a JQuery element $(this). If you are then wanting to track each elements click you can bind to its context and set its clicked value. $('#result li').click(function(){ this.clicked = this.clicked ? this.clicked + 1 : 1; $(this).html(this.clicked); }); http://jsfiddle.net/su14hjc0/ This means you can also reference the clicked value in other places. console.log($('#result li:eq(1)')[0].clicked);
accepted answer of: http://stackoverflow.com/q/27940546
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27940546

http://stackoverflow.com/comment/44270265
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27934238
score: 1
has text: That is nearly JSX. If you render a lot of markup as raw HTML, you're losing the benefit of using a library like React. I'd recommend doing the small changes (like "class" -> "className") to let React handle the elements.

http://stackoverflow.com/comment/44077794
type: Comment
comment on: http://stackoverflow.com/a/27835716
has text: change ```if(x < max_fields){``` in your javascript to ```if(x <= max_fields){```
type: AnswerComment
score: 0

http://stackoverflow.com/a/27954359
has comment: http://stackoverflow.com/comment/44304249
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44346970
score: 0
type: Answer
has body: try this, just note my replace regex is contrived: "Two Three One".replace(/\b\w+\b/gi, "&lt;strong&gt;$&amp;&lt;/strong&gt;"); EDIT is this more what you want: var text = "Lorem ipsum One Dolor Foo Two Bar Baz Three Lorem Three Quux One Two"; document.addEventListener('DOMContentLoaded', function() { var val = document.getElementById('myInput').value, aVals = val.match(/\b\w+/gi); aVals.forEach(function(val) { text = text.replace(new RegExp(val+'{1}', 'i'), '&lt;span style="color: coral;"&gt;$&amp;&lt;/span&gt;' ); }); // console.log(), essentially document.body.innerHTML += text; })
answers question: http://stackoverflow.com/q/27954319

http://stackoverflow.com/q/27860213
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27860248
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/27860262
tagged with: jquery
has title: jQuery script to modify tag in HTML with user's input in textarea
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27860250
type: AnsweredQuestion
score: 1
has body: I want to make a simple jQuery script which will do the following: I have HTML-code with tag and for user to type in. User types text in -> jQuery inserts it in (class="youtyped") tag in HTML-code. HTML-code: Please type your text here Example of use: User typed "Hello" in textarea, HTML-code will look like: Hello Thanks in advance :)
upvote count: 1
possible better answer: http://stackoverflow.com/a/27860248
has answer: http://stackoverflow.com/a/27860250

http://stackoverflow.com/comment/44180193
type: Comment
score: 0
has text: Please include HTML code and demo if possible
type: QuestionComment
comment on: http://stackoverflow.com/q/27888828

http://stackoverflow.com/q/27856473
has body: I'm using button to move between tabs. But for that I have to remember the user's tab position. So my buttons keep working when the user leaves the screen and returns later. The tabchange event should be the event to use for that, however I cannot get it to trigger. View: Ext.define('MyApp1.view.Home', { extend: 'Ext.form.Panel', requires: [ 'Ext.tab.Panel' ], xtype: 'home', config: { itemId: 'home', layout: 'fit', items: { xtype: 'tabpanel', tabBarPosition: 'top', height: 500, renderTo: document.body, listeners: { beforetabchange: function (tabs, newTab, oldTab) { console.log('tab is going to change'); }, tabchange: function () { console.log('recorded tab change from listener'); }, change: function () { console.log('change of tab from listener'); } }, items: [ { title: 'one' }, { title: 'two' } ] } } }); Controller: Ext.define('MyApp1.controller.HomeController', { extend: 'Ext.app.Controller', requires: [ 'MyApp1.view.Main' ], config: { refs: { home: 'home' }, control: { home: { beforetabchange: 'onTabChange', tabchange: 'onTabChange', change: 'onTabChange' } } }, init: function() { console.log('HomeController initialized'); }, onTabChange: function () { console.log('active tab changed'); } }); So I see the initialization text in the log but none of the tab change events when I click the tab buttons.
tagged with: events
possible better answer: http://stackoverflow.com/a/27857196
has answer: http://stackoverflow.com/a/27857569
tagged with: tabpanel
has answer: http://stackoverflow.com/a/27857196
tagged with: sencha-touch
has title: Fail to catch tab change event
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27857569
answer count: 2
tagged with: javascript
tagged with: controller
score: 0

http://stackoverflow.com/q/27830160
has answer: http://stackoverflow.com/a/27830476
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27830476
has title: populating a dynamic form with javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44066440
score: 2
type: AnsweredQuestion
tagged with: dynamic
upvote count: 2
type: Question
tagged with: javascript
tagged with: forms
has body: I am trying to get a forloop with input elements to run between a form and create a form dynamically with javascript 1: in scenario one , the form in the script is getting closed before the input elements populate. 2: in scenario two , when i put the for loop variable between the form ,the error that comes is undefined . PLEASE HELP SCENARIO ONE No of Feilds SCENARIO TWO No of Feilds

http://stackoverflow.com/comment/44175174
has text: Yes the problem is. Some libs, for example https://github.com/theturtle32/WebSocket-Node suggest to use server-side cross origin protection. wss is just encrypt your traffic.
comment on: http://stackoverflow.com/q/27886404
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27810420
tagged with: pdfmake
has answer: http://stackoverflow.com/a/42721085
upvote count: 7
has body: I am using Angular JS ui Grid http://ui-grid.info/docs/#/tutorial/312_exporting_data_complex My requirement is that I want to show e.g. 5 columns, but when I export PDF, I don't want to export certain columns like username. How can I do that?
has answer: http://stackoverflow.com/a/42721011
possible better answer: http://stackoverflow.com/a/42721011
has title: How can I remove some columns in pdf export in angular js ui Grid
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27822700
downvote count: 0
has answer: http://stackoverflow.com/a/44593471
tagged with: javascript
tagged with: ng-grid
favorite count: 0
type: Question
score: 7
tagged with: angular-ui-grid
accepted answer: http://stackoverflow.com/a/27822700
tagged with: angularjs

http://stackoverflow.com/q/27820404
score: 0
has comment: http://stackoverflow.com/comment/44046540
has comment: http://stackoverflow.com/comment/44049966
accepted answer: http://stackoverflow.com/a/27824891
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44050012
has comment: http://stackoverflow.com/comment/44048344
has comment: http://stackoverflow.com/comment/44049513
type: AnsweredQuestion
has body: I've created an API that fetch data from database and then I added another project and added this API as a reference to that project, I created a simple JavaScript function to fetch the data from that referenced API. I can't find the exact path and It shows this error "NetworkError: 502 Fiddler - Connection Failed -http //localhost:29440/api/purchase/" First Is this the wright way to call that API function With JavaScript ( var uri = 'http://localhost:29440/api/purchase'; ) If it is then why do we need to tell the exact location of the API isn't that a security Issue. Second It says some thing about the CORS, I checked a project on asp.net web about this core and self hosting but nothing works as give, I tried To host them on same localhost address But that Didn't worked either and yes Tried that CONSOLE stuff to, same sh** no progress So please guide me through this Regards
has comment: http://stackoverflow.com/comment/44050293
type: Question
has title: How to host an API 2.0 in another project
has answer: http://stackoverflow.com/a/27824891
tagged with: asp.net-web-api2
has comment: http://stackoverflow.com/comment/44051111
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44050474
has comment: http://stackoverflow.com/comment/44050993

http://stackoverflow.com/comment/44227981
score: 3
comment on: http://stackoverflow.com/q/27914375
type: Comment
has text: I'm not sure if this is a Java question as it looks to involve Javascript only and not Java. Are you sure about your use of the [tag:java] tag? Please correct me if I'm wrong, but note that if you mis-tag your question you will not get the right experts in to review it, and that this may hurt your chances of getting decent help.
type: QuestionComment

http://stackoverflow.com/q/27806095
type: AnsweredQuestion
has title: What happens if a write to localStorage is canceled?
type: Question
score: 5
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27806185
accepted answer: http://stackoverflow.com/a/27806185
has body: Let's say I make a call to local storage like so: window.localStorage.setItem("key", bigJsonObject); And immediately afterwards, the user closes their web browser. What will be the result of window.localStorage.getItem("key") Will the bigJsonObject be partially written? Or will the whole write fail? Is their any way to guarantee that there will be no partial writes?
tagged with: cordova
downvote count: 0

http://stackoverflow.com/a/51534560
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/27837158
downvote count: 0
has body: This post might be helpful: CKEditor + Magnific Popup. Link editing does not work Here is one more example (based on CKEditor5): let theEditor; ClassicEditor .create(document.querySelector('#editor'), { toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote'] }) .then(editor =&gt; { theEditor = editor; }) .catch(error =&gt; { console.error(error); }); $.fn.modal.Constructor.prototype.enforceFocus = function() {}; .ck-editor__editable { min-height: 150px; } body { --ck-z-default: 100; --ck-z-modal: calc( var(--ck-z-default) + 999); } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://cdn.ckeditor.com/ckeditor5/10.0.1/classic/ckeditor.js"&gt;&lt;/script&gt; &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" /&gt; &lt;div class="container"&gt; &lt;!-- Button to Open the Modal --&gt; &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"&gt; Open modal &lt;/button&gt; &lt;!-- The Modal --&gt; &lt;div class="modal" id="myModal"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;!-- Modal Header --&gt; &lt;div class="modal-header"&gt; &lt;h4 class="modal-title"&gt;Modal Heading&lt;/h4&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt; &lt;/div&gt; &lt;!-- Modal body --&gt; &lt;div class="modal-body"&gt; &lt;textarea name="content" id="editor"&gt; &lt;p&gt;Lorem ipsum dolor sit ameta quam, nec bibendum neq&lt;/p&gt; &lt;/textarea&gt; &lt;/div&gt; &lt;!-- Modal footer --&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;
type: Answer

http://stackoverflow.com/comment/44185124
type: Comment
type: QuestionComment
has text: I have never used jsfiddle.net before, so I am not sure if I have got everything there correctly. But here is my attempt: http://jsfiddle.net/dpc70er0/1/
comment on: http://stackoverflow.com/q/27891316
score: 0

http://stackoverflow.com/q/27812272
score: -3
linked to: http://stackoverflow.com/q/3446216
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/27812329
upvote count: 0
has body: I want to capture image from webcam user image that image stored in specified folder and captured image path store into mysql using php. I have an problem with webcam captured image path is not stored in mysql database. so please help me... <?php include 'connection.php'; // be aware of file / directory permissions on your server $newname = move_uploaded_file($_FILES['webcam']['tmp_name'], 'uploads/webcam'.date('YmdHis').rand(383,1000).'.jpg'); $query = "INSERT INTO entry(name) VALUES('".$_GET['url']."')"; mysql_query($query)or die(mysql_error()); echo " "; ?> Javascript Webcam Profile Picture Your captured image will appear here...
has title: How to store captured image path in mysql database using php.?
tagged with: mysql
has comment: http://stackoverflow.com/comment/44032180
type: Question
tagged with: javascript
downvote count: 3
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44032105
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44152156
comment on: http://stackoverflow.com/q/27875085
has text: I cant load jquery in ionic?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27825105
downvote count: 0
has body: It's most likely because the editor template is asking for Category.Name, but it is null. The Category object in DataItems only has Id defined and has no idea that there is a relationship defined at CategoryOptions. In your editor template, you can try something like this (or similar). #= (Category.Id !== null) ? $.grep(CategoryOptions, function(e){ return e.Id == Category.Id; })[0].Name : ' ' # Basically, return the Name of the object in CategoryOptions with an Id that matches the Category Id of DataItem. If trying that does not work, you can try the column.values configuration that kendo supports. I imagine it would look something like this: Your category column (no more template): { field: "Category", title: "Category", editor: categoryDropDownList, values: CategoryOptions }, Your data model would then need to be like this: { "DataItems": [ { "Id": 1, "Name": "Foo", "Category": 1 }, { "Id": 2, "Name": "Bar", "Category": 2 } ], "CategoryOptions": [ { "value": 1, "text": "A" }, { "value": 2, "text": "B" }, { "value": 3, "text": "C" } ], } Adding function to kendo template context Declare your wrapper function inline as part of the editor template: "# var GetCategoryNameById = function(id){ return $.grep(CategoryOptions, function(e){ return e.Id == id; })[0].Name; }; # #= GetCategoryNameById(name) #" Kendo Template Hash Usage FYI: #= # --> Render as HTML # # --> Arbitrary JS
answers question: http://stackoverflow.com/q/27822565
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27822565
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/44058892
upvote count: 1
has comment: http://stackoverflow.com/comment/44060677

http://stackoverflow.com/comment/44176815
score: 0
type: Comment
has text: Yes I did. Is that incorrect?
type: QuestionComment
comment on: http://stackoverflow.com/q/27887933

http://stackoverflow.com/comment/44150657
type: AnswerComment
has text: Most helpful answer to my question.
comment on: http://stackoverflow.com/a/27870405
score: 0
type: Comment

http://stackoverflow.com/comment/44304043
comment on: http://stackoverflow.com/q/27954374
score: 0
type: Comment
type: QuestionComment
has text: Use a 10 base for parseInt: `parseInt("1395427364000", 10)`

http://stackoverflow.com/q/27823770
answer count: 1
tagged with: highcharts
has answer: http://stackoverflow.com/a/27824983
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/csv
has body: I have a bunch of graphs made from CSV files and I want some of the series disabled by default. The series are made with the highcharts data processing function and I don't know how to target them once they're made. I tried: switch (plotOptions.series.name) { case "DACH - Austria, Germany and Switzerland": $(this.hide()); break; } but it won't work. Any ideas on how to do this? I want to write a switch because 8/13 series should be disabled by default...fiddle below $("select").change(function() { $("select option:selected").each(function() { var variable = $(this).val(); var graphtitle; switch (variable) { case "CSV/Sheet1.csv": graphtitle = "Academic-Corporate Collaboration"; break; case "CSV/Sheet2.csv": graphtitle = "Academic-Corporate Collaboration Impact"; break; case "CSV/Sheet3.csv": graphtitle = "Citation Count"; break; case "CSV/Sheet4.csv": graphtitle = "Citation Count, self-citations excluded"; break; case "CSV/Sheet5.csv": graphtitle = "Citations per Publication"; break; case "CSV/Sheet6.csv": graphtitle = "Citations per publication, self-citations excluded"; break; case "CSV/Sheet7.csv": graphtitle = "Cited publications (%)"; break; case "CSV/Sheet8.csv": graphtitle = "Cited publications (%), self-citations excluded"; break; case "CSV/Sheet9.csv": graphtitle = "Field-Weighted Citation Impact"; break; case "CSV/Sheet10.csv": graphtitle = "Output in top 10 percentiles (%)"; break; case "CSV/Sheet11.csv": graphtitle = "Output in top 10 percentiles (%), self-citations excluded"; break; case "CSV/Sheet12.csv": graphtitle = "Publications in top 10 journal percentiles (%, SJR)"; break; case "CSV/Sheet13.csv": graphtitle = "Scholarly Output"; break; } $.get(variable, function(csv) { $('.graphcontainer').highcharts({ chart: { type: 'line' }, data: { csv: csv, itemDelimiter: ';' }, title: { text: graphtitle }, plotOptions: { series: { connectNulls: true } }, yAxis: { title: { text: '' } }, legend: { layout: 'vertical' }, credits: { enabled: false }, tooltip: { f…
has comment: http://stackoverflow.com/comment/44054810
favorite count: 0
downvote count: 0
type: AnsweredQuestion
has title: Highcharts: making series disabled by default when loading data from CSV
score: 1
accepted answer: http://stackoverflow.com/a/27824983
type: Question

http://stackoverflow.com/a/28553214
downvote count: 0
has body: I've solved this question from @Rob Schmuecker answers. So, the focus of this question about using an appropriate proxy to call the json from google like using : addressModel.getProxy().setExtraParam('url', 'http://maps.google.com/maps/api/geocode/json?address=' + queryString + '&amp;sensor=false'); to set the params dynamically, from this data model : addressModel = Ext.define("Addresses", { extend: 'Ext.data.Model', proxy: { type: 'jsonp', url: 'https://jsonp.nodejitsu.com', reader: { type: 'json', root: 'results', totalProperty: 'totalCount' } }, fields: ['formatted_address'] }); after that you can create a combobox and add listener to the combobox each keyup to call the extraparam in your proxy. this is the demo from @Rob Schmuecker : https://fiddle.sencha.com/#fiddle/g70 and this is for the complete answer from Rob, who solved my problem : Check This...
accepted answer of: http://stackoverflow.com/q/27839486
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27839486
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44161999
comment on: http://stackoverflow.com/q/27880171
has text: @AlexandruSerban you have mentioned that your it reaches till `if(lengthInSeconds.600`, but did u checked if your `if` condition is `true` ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44317235
comment on: http://stackoverflow.com/q/27961388
score: 0
has text: Check my answer below, with other fixes.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44087370
comment on: http://stackoverflow.com/q/27841718
has text: @amanhuipg Are you really expecting Interwebs Exploder to behave sensibly? Oh the shame...
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/44087510
comment on: http://stackoverflow.com/a/27841818
has text: @Kelsadita copy-paste youre right its not necessery, updated answer
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27838977
type: UnansweredQuestion
type: Question
tagged with: dom
score: 0
has comment: http://stackoverflow.com/comment/44082093
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44084632
has title: Pass javascript object via generated link to modal bootstrap
tagged with: http://stackoverflow.com/tag/html
has body: I have generated a tag via Javascript and I want to pass a 'js object' to this receiver. This is the generated code: toReturn += ""; But here my object data became a string and I lose my data. I want to retrieve them in the called modal, like this: $('#taskInfoModal').on('show.bs.modal', function (event) { var link = $(event.relatedTarget); var taskInfo = link.data('task-info'); var modal = $(this); modal.find('.modal-body').html(taskInfo); console.log(taskInfo); });
answer count: 0

http://stackoverflow.com/a/27860325
has comment: http://stackoverflow.com/comment/44123140
downvote count: 0
answers question: http://stackoverflow.com/q/27860281
type: Answer
has body: a = 1 means that a is a global varialbe, it is not private. Write var a = 1; to make it private. When you omit var, you can easily create global variables - very dangerous. Some materials are here: Difference between variable declaration syntaxes in Javascript (including global variables)?
upvote count: 3
score: 3

http://stackoverflow.com/a/27913756
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27913601
score: 1
has comment: http://stackoverflow.com/comment/44226905
has body: Here's a function I adapted from another StackOverflow post a while ago. See the links in the source for more details. /* http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript decimal_sep: character used as deciaml separtor, it defaults to '.' when omitted thousands_sep: char used as thousands separator, it defaults to ',' when omitted */ Number.prototype.toMoney = function(decimals, decimal_sep, thousands_sep) { var n = this, c = isNaN(decimals) ? 2 : Math.abs(decimals), //if decimal is zero we must take it, it means user does not want to show any decimal d = decimal_sep || '.', //if no decimal separator is passed we use the dot as default decimal separator (we MUST use a decimal separator) /* according to [http://stackoverflow.com/questions/411352/how-best-to-determine-if-an-argument-is-not-sent-to-the-javascript-function] the fastest way to check for not defined parameter is to use typeof value === 'undefined' rather than doing value === undefined. */ t = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, //if you don't want to use a thousands separator you can pass empty string as thousands_sep value sign = (n &lt; 0) ? '-' : '', //extracting the absolute value of the integer part of the number and converting to string i = parseInt(n = Math.abs(n).toFixed(c)) + '', j = ((j = i.length) &gt; 3) ? j % 3 : 0; return sign + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); } You can use it like this var num = 1000 + 2000 + 200; num.toMoney(2, ',', '.'); // =&gt; 3.200,00
downvote count: 0

http://stackoverflow.com/comment/44211408
type: Comment
type: QuestionComment
has text: no, i actually want the property as well.
comment on: http://stackoverflow.com/q/27906087
score: 0

http://stackoverflow.com/comment/44210271
comment on: http://stackoverflow.com/q/27905506
score: 0
type: Comment
type: QuestionComment
has text: Just because someone can read your code, that doesn't give them any IP rights over it. Unless you've specifically published it under such a license, of course

http://stackoverflow.com/q/27817854
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44044195
has body: Im building an application in which i have successfully implemented video chat functionality using easyrtc. Now what i want to do is record that video. I have done that as well by reading tutorials over the internet. But I'm able to record the video at client side(on browser). while i want to record it on server directly. because in this way, my browser get hang and stops responding due to the size of video. Is there any possible way to save it directly on server or it can be sent to server simultaneously when it recorded. any help would be appreciated. thanks Neeraj
score: 1
tagged with: easyrtc
has comment: http://stackoverflow.com/comment/44044112
type: Question
has comment: http://stackoverflow.com/comment/44042778
downvote count: 0
tagged with: javascript
has title: how to record video on server instead of browser using record rtc
upvote count: 1

http://stackoverflow.com/comment/44266507
score: 0
has text: I'm still not sure what you're trying to achieve.
type: Comment
comment on: http://stackoverflow.com/q/27933982
type: QuestionComment

http://stackoverflow.com/comment/44209662
type: AnswerComment
type: Comment
score: 1
has text: See the updated notes, .post-link is an image, so you wouldn't want to use '.html()' on it
comment on: http://stackoverflow.com/a/27904714

http://stackoverflow.com/q/27934616
has answer: http://stackoverflow.com/a/27934888
tagged with: regex
has answer: http://stackoverflow.com/a/27935244
has comment: http://stackoverflow.com/comment/44268843
has comment: http://stackoverflow.com/comment/44329457
has comment: http://stackoverflow.com/comment/44267842
type: UnansweredQuestion
score: 1
upvote count: 1
has body: I have a service that needs to take an array of sentences, split from a lengthy, original string (say 10,000 characters in length). The total string in each array "item" needs to be a combined list of complete sentences (ending in a period), but the total character count of that combined list can't exceed 300 characters. If a trailing sentence brings the total character count of an array item to 301, the list must truncate that whole sentence, and use it as the beginning sentence of the next item in the array... until the original string is finally broken apart. This of course means that it's ok if a an array item is short of the 300 character max. I realize the magic of Regular Expressions can do some pretty special things, but am not sure if this is even possible. If it is... golden! If not, I'd even settle for a Javascript function that can return the same results. My mind simply can't fathom the method to achieve this, and I'm grateful for any help on this matter. Thanks.
type: Question
has comment: http://stackoverflow.com/comment/44267275
answer count: 2
has comment: http://stackoverflow.com/comment/44293014
has comment: http://stackoverflow.com/comment/44330752
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44268905
has title: Get array of sentences from lengthy string, without each array[index] exceeding a max char length

http://stackoverflow.com/comment/44215722
has text: If you look on my website you will realise a couple of things - one, I'm using full page. Two full page doesn't do what I need it to
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27901452

http://stackoverflow.com/a/27933368
answers question: http://stackoverflow.com/q/27933312
type: Answer
has body: If you want to remove a circle from the canvas you will have to draw a circle (same position; same size) but this time with the color of the canvas background. drawCircle(150,150,25,'black'); // ... drawCircle(150,150,25,'white'); // removes previous circle if the canvas was white colored If you want to erase everything from the canvas before drawing something new you can just execute this context.clearRect(0, 0, canvas.width, canvas.height);
score: 0

http://stackoverflow.com/a/27923031
score: 1
upvote count: 1
has body: {{singleVideo}}
downvote count: 0
answers question: http://stackoverflow.com/q/27922829
type: Answer

http://stackoverflow.com/comment/44162182
comment on: http://stackoverflow.com/q/27880171
score: 0
has text: No, I meant *not* using them could create an issue. You should always use semicolons where they belong.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27881091
has comment: http://stackoverflow.com/comment/44181033
upvote count: 1
type: AcceptedAnswer
has body: This question looks similar to open url in new tab or reuse existing one whenever possible window.open(URL,name,specs,replace) URL : Optional. Specifies the URL of the page to open. If no URL is specified, a new window with about:blank is opened name : Optional. Specifies the target attribute or the name of the window. The following values are supported: _blank - URL is loaded into a new window. This is default _parent - URL is loaded into the parent frame _self - URL replaces the current page _top - URL replaces any framesets that may be loaded name - The name of the window (Note: the name does not specify the title of the new window) < script > document.getElementById("container").onclick = function(evt) { if (evt.target.tagName === "A") window.open(evt.target.href, evt.target.href); return false; } < /script> goo sta
type: Answer
has comment: http://stackoverflow.com/comment/44177998
accepted answer of: http://stackoverflow.com/q/27880985
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27880985

http://stackoverflow.com/comment/44213133
type: Comment
has text: Thanks for the informative reply on how to populate the data for select multiple chain and the explain on the array structure, but i still don't understand how do i actually can add in multiple row select separately into the data array from the result of query in php.
comment on: http://stackoverflow.com/a/27906637
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44325140
score: 0
type: Comment
has text: My mistake. I should have ran it before posting. Corrected it.
type: AnswerComment
comment on: http://stackoverflow.com/a/27937865

http://stackoverflow.com/q/27953402
tagged with: java
tagged with: javascript
tagged with: servlets
score: 0
answer count: 1
tagged with: jsp
has title: Update HTML from JSP file
accepted answer: http://stackoverflow.com/a/27953561
type: AnsweredQuestion
has body: I got a problem where I am not sure how to implement the desired behaviour. I want to show the contents of a svn repository in a TreeView. So I have a Java Class which connects to the repository and stores the repositories contents in my Java DataModel. Then in my .jsp file I create a TreeView with HTML and Javascript and update the contents of the TreeView accordingly. The problem is, that I need to listen for an event when another node is selected, since I want to show the according revision number on the site too. The event is of course implemented in Javascript, because the TreeView is too. So I need to call my Java Class with the selected node from the Javascript Event and show the results in the html(.jsp) file. How would i do this ? I do not know how to implement the correct behaviour here. Is this even possible ? So to sum up my task: Get repository file/folder names from java library Show information in TreeView If another node in TreeView was selected, get selected files revision number from java library Show information on site Maybe you can enlighten me. Thanks in advance.
has answer: http://stackoverflow.com/a/27953561
type: Question

parallax
tags question: http://stackoverflow.com/q/27918485
type: Tag
tags question: http://stackoverflow.com/q/27814772
tags question: http://stackoverflow.com/q/27931094
tag name: parallax

http://stackoverflow.com/a/27882356
answers question: http://stackoverflow.com/q/27881449
has comment: http://stackoverflow.com/comment/44187640
upvote count: 2
has comment: http://stackoverflow.com/comment/44216450
has comment: http://stackoverflow.com/comment/44182861
type: Answer
has comment: http://stackoverflow.com/comment/44188174
has comment: http://stackoverflow.com/comment/44188665
has comment: http://stackoverflow.com/comment/44188501
score: 2
has comment: http://stackoverflow.com/comment/44191817
has body: @SpencerWieczorek is not wrong, PHP and MySql will work for what you need. However, there is a bit of a learning curve there. For a beginner, I'd recommend using Parse. It's free and it makes saving and retrieving data trivial. Below is simple app that lets the user input a class year and their name and saves them so others can see them on the same page. The snippet here wont work due to SO restrictions... ...but here is a working jsfiddle This is accomplished with plain ole javascript BTW To get this going on your own you'll need to: You'll need to go to https://www.parse.com/#signup and create an account with them Go to https://www.parse.com/apps/new and create an app add this in your html's head tag Go to https://www.parse.com/apps/quickstart#parse_data/web/new, select your app from the dropdow (top-ish right) the Parse.initialize() function will be shown here with your app's Application ID and JavaScript key, copy this line for later Replace the Parse.initialize() function in my example with the one you copied in step 4 Read up on the their javascript guide here to see what all you can do with parse for a more indepth look, check out the Parse JavaScript SDK & Cloud Code Reference You can also interact with parse with other scripting languages if you'd like. Parse is free up to a certain amount of usage. I have one app that's used daily by 100+ users and doesn't come anywhere near having to pay anything. Parse.initialize("Application ID", "JavaScript key"); function saveInput(){ //get our new values var klassYear = document.getElementById('klassYear').value.trim(); var studentName = document.getElementById('studentName').value.trim(); // dont continue if either value is blank if(klassYear=="" ||studentName=="" ){ alert ('Please fill in both fields.') ; return; } // create the `Parse` object var Klass = Parse.Object.extend("Klass"); var _klass = new Klass(); // set the object's values to our input values _klass.set("klassYear", klassYear); _klass.set("studentName…
accepted answer of: http://stackoverflow.com/q/27881449
downvote count: 0
has comment: http://stackoverflow.com/comment/44213217
has comment: http://stackoverflow.com/comment/44188209
has comment: http://stackoverflow.com/comment/44182744
has comment: http://stackoverflow.com/comment/44182407
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44188241
has comment: http://stackoverflow.com/comment/44181332

http://stackoverflow.com/comment/44911068
has text: @Lu4: The point of declarative programming is about telling "what" you want, not "how" you do it. With your suggestion, it's more about "how" you want to get a task done. The downside of your suggestion is that when we use directives, we need to understand how it works "internally". For example: when you use many directives on the same element, the person who uses the directives need to understand what is the order (that's should be the concern of the person who implements the directives). That's something declarative programming tries to avoid because it's complex for users of the directives
type: Comment
comment on: http://stackoverflow.com/a/28194371
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44120664
type: Comment
has text: So i've only to add {{counterAct}} where I would add a badge?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27826578

http://stackoverflow.com/a/28675049
accepted answer of: http://stackoverflow.com/q/27874103
answers question: http://stackoverflow.com/q/27874103
has body: I guess this is what you are looking for Object.set({columnName: {"name": File.name, "url": File.url, "__type": "File"}});
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44069316
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27826234
has text: Thank you for explationation :)
type: Comment

http://stackoverflow.com/a/27833889
has body: Select the container, iterate the array with a for loop or forEach method, create elements and append them. var arr = ["Alice", "Bob"] var ulEl = document.querySelector("ul"); for (var i = 0; i &lt; arr.length; ++i) { var li = document.createElement("li"); li.innerHTML = arr[i]; ulEl.appendChild(li); } &lt;ul&gt; &lt;/ul&gt;
type: Answer
answers question: http://stackoverflow.com/q/27833826
score: 0

http://stackoverflow.com/q/27939873
has comment: http://stackoverflow.com/comment/44276145
has comment: http://stackoverflow.com/comment/44276111
score: -2
tagged with: javascript
has body: I read that it is usually best to include your javascript code within a function block like so (function () { "use strict"; // stuff here }()); But if the code is meant to be globally accessible, a function or a constant for example, is that ok to be outside of a function block or should I set it up in another way? Also - if I moved the code outside of the function block JSLint, for example, would suggest I move the use strict statement inside a function block. Would just have to be a concession I would have to make?
has comment: http://stackoverflow.com/comment/44275958
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/4462478
has answer: http://stackoverflow.com/a/27939985
favorite count: 0
has comment: http://stackoverflow.com/comment/44276306
type: UnansweredQuestion
has title: JS Scoping of functions / global variables
has comment: http://stackoverflow.com/comment/44276290
downvote count: 3
has comment: http://stackoverflow.com/comment/44276053
type: Question

http://stackoverflow.com/comment/44136912
comment on: http://stackoverflow.com/q/27866951
score: 0
type: Comment
type: QuestionComment
has text: What have you tried? It seems like `gulp-jsx` and `gulp-rename` will get you what you want, if you just want to output a jsx transformed file with a `.js` extension.

http://stackoverflow.com/comment/44095634
type: QuestionComment
comment on: http://stackoverflow.com/q/27844598
has text: Hidden Field comes handy when it comes to store values on client side. Even if we can't see content at page view but still one can easily see content from Dom element by inspecting it. If security is your main concern and if u are assigning value from code behind just set hidden field visibility false . It won't be displayed at Dom level and will be still accessible from server but not from client side.
score: 0
type: Comment

http://stackoverflow.com/q/27828832
answer count: 0
has comment: http://stackoverflow.com/comment/44064120
type: Question
has comment: http://stackoverflow.com/comment/44064046
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have searched high and low on how to set the default option of a dataTable column filter but I cannot find out how to do it. I am still a novice with DT's so I figured I would hit SO first and then tear into hours of documentation if nothing presents itself. In any case, I have a function set up to to instantiate a new DT. It then adds a column filter to the "username" column in my table. The data all shows fine in the table. Success!! In my column filter I have several usernames that appear as options. My question: how to I preselect one of the options and only make that users data show up in the table. Scenario: In my users column I have the value of "Peter Pan". In my users column filter I have the option "Peter Pan". I am passing the value of "Peter Pan" into the page. How to I only show the value of Peter Pan in the table? $(document).ready(function() { $('#userListTable').DataTable( { initComplete: function () { var api = this.api(); api.columns().indexes().flatten().each( function ( i ) { var column = api.column( 2 ); var select = $('&lt;select&gt;&lt;option value=""&gt;&lt;/option&gt;&lt;/select&gt;') .appendTo( $(column.header()).empty() ).on( 'change', function () { var val = $.fn.dataTable.util.escapeRegex( $(this).val() ); column.search( val ? '^'+val+'$' : '', true, false ).draw(); }); column.data().unique().sort().each( function ( d, j ) { select.append( '&lt;option value="'+d+'"&gt;'+d+'&lt;/option&gt;' ) } ); select.val("Peter Pan"); select.trigger('change'); } ); } } ); }); Thanks!
has comment: http://stackoverflow.com/comment/44063687
has title: DataTables pre-select filter option to show specific data
tagged with: datatable
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44063739
score: 2
has comment: http://stackoverflow.com/comment/44063883

http://stackoverflow.com/a/27829021
upvote count: 2
type: AcceptedAnswer
has body: bind("click") does not magically re-add the event. You need to add it back the event. $("#dp1Icon").on("click", function(){ $("#dp1").datepicker('show'); } ); You might be better off just setting a flag inside that function and not removing the event.
has comment: http://stackoverflow.com/comment/44064199
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27828990
accepted answer of: http://stackoverflow.com/q/27828990

http://stackoverflow.com/a/27921990
type: Answer
answers question: http://stackoverflow.com/q/27921835
has body: Add your script to onload handler of body tag the same way as to onclick.
score: 0

http://stackoverflow.com/a/27816344
has body: In lodash you can do like this: get full object console.log(_.filter(array, 'data-model_id')); get only data-model_id property var res = _.chain(array).filter('data-model_id').map(function (el) { return _.pick(el, 'data-model_id'); }).value(); Example
answers question: http://stackoverflow.com/q/27816213
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/44078718
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27837100
score: 1
has text: ...and to explain why: Browsers keep a fast lookup dictionary for IDs, which contain a single DOM element against each ID value. This means that `document.getElementById` (and therefore jQuery also) can only see the first occurring element with a specific ID.

http://stackoverflow.com/comment/44020513
type: Comment
type: QuestionComment
has text: I don't really understand what's going on but you can use `.text()` rather than `.val()`.
score: 0
comment on: http://stackoverflow.com/q/27805737

http://stackoverflow.com/a/27958523
type: Answer
answers question: http://stackoverflow.com/q/27958343
score: 0
accepted answer of: http://stackoverflow.com/q/27958343
has comment: http://stackoverflow.com/comment/44311337
has comment: http://stackoverflow.com/comment/44311167
has comment: http://stackoverflow.com/comment/44311215
has body: You can use this : function RefreshParent() { if (window.opener != null &amp;&amp; !window.opener.closed) { window.opener.location.reload(); } } window.onbeforeunload = RefreshParent; You can find a demo here : http://aspsnippets.com/demos/542/
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44311278

http://stackoverflow.com/q/27952259
answer count: 2
possible better answer: http://stackoverflow.com/a/27952336
has comment: http://stackoverflow.com/comment/44300625
has answer: http://stackoverflow.com/a/27952336
tagged with: jquery
has comment: http://stackoverflow.com/comment/44299896
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
tagged with: ajax
has title: Ajax asynchronous call - how to overcome this?
downvote count: 3
score: -3
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27952764
accepted answer: http://stackoverflow.com/a/27952764
linked to: http://stackoverflow.com/q/802854
type: Question
has body: I'm New to JS - just want to start with that. Look at this simple example, where i want to draw X number of gauges, where X is taken from the JSON via Ajax call. This part doesn't work, as AJAX is spawned asynchronously therefore Server_Sessions is always 0 ! for (i = 0; i < Server_Sessions; i++) { document.write(" "); } How can i draw gauges for sessions if this variable is always 0 ?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44299730

http://stackoverflow.com/a/27903106
score: 0
answers question: http://stackoverflow.com/q/27902969
has comment: http://stackoverflow.com/comment/44205515
type: Answer
has body: With JQuery, you can do: $("div").text().length This gives you the number of characters within the div.

http://stackoverflow.com/a/27806280
answers question: http://stackoverflow.com/q/27806256
type: Answer
score: 2
upvote count: 2
has body: You can use this regex to match content between ( and ) including newlines: /\([\s\S]*?\)/g In the absence of dotall flag in Javascript we use [\s\S] to make it match newlines as well. RegEx Demo
accepted answer of: http://stackoverflow.com/q/27806256
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44306477
type: Comment
has text: [How do I test whether an element has a particular class?](http://learn.jquery.com/using-jquery-core/faq/how-do-i-test-whether-an-element-has-a-particular-class/)
type: QuestionComment
comment on: http://stackoverflow.com/q/27955818
score: 1

http://stackoverflow.com/comment/95799968
comment on: http://stackoverflow.com/a/27905153
has text: While the event is the same, these two techniques have very different ways of configuring the callback. Scope for the two is different.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44151898
type: Comment
type: QuestionComment
score: 0
has text: @SpencerWieczorek only if you also add `role="button"`, `tabindex="0"` and handle `keydown` in addition to `click` events (which isn't the case here).
comment on: http://stackoverflow.com/q/27875085

http://stackoverflow.com/a/27850814
type: Answer
score: 1
has body: Here is a regex you could use. Note that in the delimiter form /.../ the delimiter character / must be escaped \/ in the regex if it is anywhere in the regex (there is one in your character class). # /^(?=.{8})(?=.*(?:\d|[\\!"#$%&amp;'()*+,\-.\/:;&lt;=&gt;?@\[\]^_`´{|}~]))/ ^ # Beginning of string (?= .{8} ) # Lookahead for at least 8 characters (?= # Lookahead .* # 0 to many, any character, to get to one of the following (?: \d # A digit | # or, [\\!"#$%&amp;'()*+,\-./:;&lt;=&gt;?@\[\]^_`´{|}~] # A special character ) ) # Because we were just looking ahead, we are still # at the beginning of the string here. # Optionally match the entire line. # .+ $ Additionally, Digit and Special Character can be combined into a single class. # /^(?=.{8})(?=.*[\d\\!"#$%&amp;'()*+,\-.\/:;&lt;=&gt;?@\[\]^_`´{|}~])/ # Beginning of string ^ # Lookahead for at least 8 characters (?= .{8} ) # Lookahead for a digit OR a special character (?= .* [\d\\!"#$%&amp;'()*+,\-./:;&lt;=&gt;?@\[\]^_`´{|}~] ) # Optionally match the entire line. # .+ $
upvote count: 1
has comment: http://stackoverflow.com/comment/44132150
downvote count: 0
answers question: http://stackoverflow.com/q/27848784
has comment: http://stackoverflow.com/comment/44108954

http://stackoverflow.com/a/27871209
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44145210
upvote count: 2
has body: I'm guessing that the issue is in how deleteMovieFromDownloadList is being called. If you do something like this: var myController = new HomeController(); someFramework.doSomethingWithCallback(myController.deleteMovieFromDownloadList); ...someFramework would end up calling the callback without it being bound to the expected context. If this is the case, you can fix it by doing this: var boundCallback = myController.deleteMovieFromDownloadList.bind(myController); someFramework.doSomethingWithCallback(boundCallback); Update: In reading through the Angular documents, it appears that what you put in the click handler isn't really JavaScript, but is interpreted by Angular. So maybe homeCtrl.deleteMovieFromDownloadList(m) is doing something like this essentially: var fn = homeCtrl.deleteMovieFromDownloadList; fn(m): ...which of course would not set this correctly. With the controller being set, can't you just do this? data-ng-click="deleteMovieFromDownloadList(m)"
answers question: http://stackoverflow.com/q/27871155

http://stackoverflow.com/comment/44208546
score: 0
type: Comment
type: QuestionComment
has text: A google search gives you plenty of answers.
comment on: http://stackoverflow.com/q/27904706

http://stackoverflow.com/q/27956166
tagged with: javascript
score: 0
has title: Correct way to use for loop inside a Helper function | MeteorJS
answer count: 1
tagged with: meteor
accepted answer: http://stackoverflow.com/a/27956680
type: AnsweredQuestion
has body: I have this helper function Template.myTemplate.helpers({ listaPerfilUsuarioLikesPeligro:function(){ var findLike = LikesPost.find({authorId:Meteor.userId()}).fetch(); for(var i = 0;i&lt;findLike.length;i++){ console.log(findLike[i].postId) console.log(findLike[i].author) var findLook = Peligro.find({_id:findLike[i].postId}).fetch(); console.log(findLook) return Peligro.find({_id:findLike[i].postId}).fetch(); } } }); So here first I'm doing a find on my LikesPost Collection, which works pretty fine, and returns two objects. Now I try to use a for loop, to do a find on the `Peligro' collection but it's just returning one object to the html template. The html looks like this: {{#each listaPerfilUsuarioLikesPeligro}} Nombre de Mascota {{metadata.tipoDeAnimalPeligro}}&lt;br&gt; {{/each}} The 2nd `console.log' returns the ids and he author 2 times too. Also if I change the index inside the return statement on the for loop it returns the second object in the array: return Peligro.find({_id:findLike[1].postId}).fetch(); This is how my console looks: ZW5TFWiAzCBgoTvn4 ethan [FS.File] MnEEb8bhaNFyLPhpe ethan [FS.File] This is the correct way to accomplish this?
type: Question
has answer: http://stackoverflow.com/a/27956680

http://stackoverflow.com/a/27852981
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44111310
upvote count: 2
answers question: http://stackoverflow.com/q/27852861
downvote count: 0
has comment: http://stackoverflow.com/comment/44110049
has comment: http://stackoverflow.com/comment/44111248
has body: use $modalInstance.dismiss API in NewCaseModalCtrl: controller('NewCaseModalCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance, ... $modalInstance.close(data);

http://stackoverflow.com/comment/44131643
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27864617
has text: Even better. Use `RegExp` or regular string replacement to work out the occurrences and print the result. You don't need any `loop` here.

http://stackoverflow.com/q/27923107
type: AnsweredQuestion
type: Question
has body: In windows I was using these lines gui = require('nw.gui'); //To open a website externally gui.Shell.openExternal(URL); //To execute command line gui.Shell.openItem(commandString); Its working properly. The same piece of code is not working in MAC. What am i missing here? I dont want to create any file and write commands in it (batch file, which is usually called a shell script.). Is there a way without creating batch file and run these commands in MAC?
has title: Node webkit: How to open external link with system default browser in MAC
tagged with: javascript
has answer: http://stackoverflow.com/a/28034319
score: 0
answer count: 1
tagged with: macos
accepted answer: http://stackoverflow.com/a/28034319
tagged with: node-webkit
tagged with: node.js

http://stackoverflow.com/comment/44064431
score: 0
type: AnswerComment
type: Comment
has text: @charlietfl - it's my understanding that the way that I wrote it isn't the best way - usually what you'd do is select (1) element, as you stated, and assign the events that are watching for that element passed. however, the way I wrote it will still work would it not?
comment on: http://stackoverflow.com/a/27808206

mobile
tags question: http://stackoverflow.com/q/27911433
type: Tag
tags question: http://stackoverflow.com/q/27928742
tags question: http://stackoverflow.com/q/27841656
tags question: http://stackoverflow.com/q/27846711
tags question: http://stackoverflow.com/q/27944600
tag name: mobile
tags question: http://stackoverflow.com/q/27833977
tags question: http://stackoverflow.com/q/27849701

http://stackoverflow.com/q/27807410
answer count: 1
accepted answer: http://stackoverflow.com/a/27881236
type: AnsweredQuestion
type: Question
tagged with: polymer
has title: Polymer, core-ajax shared response
has answer: http://stackoverflow.com/a/27881236
tagged with: javascript
tagged with: ajax
score: 0
has body: Using Polymer, I am attempting to instantiate several ajax-service elements using template binding, . Code is as follows: The problem is, each ajax response is concatenated to a shared list variable, rather then instantiating its own local list variable per repeated template, so when the sub template is triggered, it generates s in each section for the sum of data from all ajax calls. Is there an easy way to solve this? Is there something I am over looking? EDIT: Same sort of problem occurs with the inner template. Each instantiated inner template shares the list variable, if anything is pushed to template.model.list, all instantiated template models are updated.
tagged with: web-component

http://stackoverflow.com/comment/44102969
has text: I always hate these sorts of arbitrary password rules. I'd like to see more password strength restrictions based on how long it would actually take to brute-force, like this: https://howsecureismypassword.net/ (it's a little more difficult to make but is both more permissive and more secure if given a suitable threshold)
type: QuestionComment
comment on: http://stackoverflow.com/q/27848784
score: 0
type: Comment

http://stackoverflow.com/comment/44081399
type: QuestionComment
has text: @dhavalcengg I ll try to create a jsfiddle if I have time, in the meantime i ll be checking out burzum's suggestion
comment on: http://stackoverflow.com/q/27838464
score: 1
type: Comment

http://stackoverflow.com/q/27942850
has title: alignment or formatting issue with elements in the header of my web pages
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44294900
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/44281392
answer count: 0
type: Question
has body: My page is a bit hand-knitted I know, but there is one issue that I am struggling with. The header has a banner served by adserv software, and there should be a search box beside it. The page is 960px wide, and these two elements 'add up' to 928px. On most browsers it is OK, but on some - including IE 9.0.8 and Chrome 31.0 it is dropping the seach box down below the banner. The page is http://www.wine-pages.com. The code of my site is: CSS body,html { margin:0; padding:0; background:#FFFFB7; font-family: verdana, arial, 'sans serif'; font-size:12px } #frame { width:960px; margin-right:auto; margin-left:auto; margin-top:auto; padding:0px; text-align:left; } #contentcenter { width:67.6%; padding:0px; float:left; background:#FFFFB7; } #contentright { width:300px; padding:0px; float:right; text-align: left; } #contentheader { font-family:verdana, Tahoma, arial, "Trebuchet MS", sans-serif; font-size:10px; color: #FFFFFF; font-weight:bold; background:url(images/mastheadWIDE.jpg) no-repeat; } The html for this section is: Wine-Searcher Find wines and prices If anyone can offer advice I'd be very grateful.
tagged with: javascript

http://stackoverflow.com/q/27872825
has answer: http://stackoverflow.com/a/27872893
has body: My array has the pairs of child and parent elements . The first element of each subarray is a child , the second is the parent var myArray = [['activity', 'none'] , ['movies', 'activity'], ['theater','activity'], ['drama', 'movies'], ['comedy', 'movies'], ['puppet', 'theater'], . . ]; I need to create the following HTML dynamically: activity movies drama comedy puppet I tried to write a recursive function but everything messed up. Do I need a recursive function at all ?
favorite count: 0
has comment: http://stackoverflow.com/comment/44148030
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27872893
downvote count: 2
possible better answer: http://stackoverflow.com/a/27872892
has title: How to create html from a two dimensional array?
has comment: http://stackoverflow.com/comment/44147984
has answer: http://stackoverflow.com/a/27872892
type: Question
upvote count: 4
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44147961
has comment: http://stackoverflow.com/comment/44147976

http://stackoverflow.com/q/27878757
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44159070
has answer: http://stackoverflow.com/a/27878851
favorite count: 0
has body: I've seen How to execute a JavaScript function when I have its name as a string, Calling a JavaScript function named in a variable, Can I use the value of a variable to initiate a function?, but I can't figure out how to get this working with an array and a for loop. What I've tried: I have a few functions, let's say: function one() { alert('one'); } function two() { alert('two'); } function three() { alert('three'); } and an array: callThese = ['one', 'two'] and I want to call one and two. This doesn't work: for (i = 0; i &lt; callThese.length; ++i) { //console.log(callThese[i]); &lt;--- (outputs one and two) window[callThese[i]](); } The error I get is TypeError: object is not a function. The functions are definitely there, and they work by calling them manually (ie. one(), two(), etc...). Sorry if this is a basic mistake, but how do I get this working?? I don't mind a jQuery solution if there is one.
has comment: http://stackoverflow.com/comment/44159141
accepted answer: http://stackoverflow.com/a/27878834
possible better answer: http://stackoverflow.com/a/27878851
linked to: http://stackoverflow.com/q/359788
has comment: http://stackoverflow.com/comment/44159134
has comment: http://stackoverflow.com/comment/44159096
linked to: http://stackoverflow.com/q/1723287
upvote count: 1
has comment: http://stackoverflow.com/comment/44159129
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44159127
has answer: http://stackoverflow.com/a/27878834
type: Question
linked to: http://stackoverflow.com/q/12504037
score: 0
answer count: 2
has title: Execute functions whose names are in an array

http://stackoverflow.com/comment/44085093
score: 0
comment on: http://stackoverflow.com/a/27839281
type: Comment
has text: A little problem is that the form is visible in the developer tool inspector, so the user can manipulate with the price right now :/
type: AnswerComment

http://stackoverflow.com/a/27936256
downvote count: 0
has body: Background: Border-radius is really great for creating the appearance of curves. The problem is that anything inside an container which is curved using this style ignores said curving. As you pointed out, we need to use margins. However, by keeping everything symmetric, we can keep the margin-lefts to three sets, one of which doesn't require a class. Answer: We can get away with a very simple structure here: Text We have the ul as the outer wrapper with the top and bottom horizontal borders. We use a ::before pseudo-element attached to the wrapper, to create the curved line. Each li is the menu entry. The blue circles are created with ::before pseudo-elements attached to the li, and we can achieve the text animation via the span inside. We could get away with not having a span, but we'd need to declare the actual text content in the CSS, and I think it belongs in the HTML. The CSS isn't too bad. We curve the ul::before and give it the border. We make it larger than 100% because the curve you show cuts off the top and bottom. Screenshot: Code: ul { height:300px; width:300px; margin:0; padding:0; list-style:none; position:relative; border-top:solid 2px black; border-bottom:solid 2px black; overflow:hidden; } ul::before { height:133%; width:133%; border-radius:50%; border:solid 2px black; display:block; position:absolute; top:-18%; left:10px; content:""; } li { margin:28px 0; color:lightblue; font-style:italic; font-weight:bold; overflow:hidden; } li::before { height:20px; width:20px; content:""; display:inline-block; background-color:lightblue; border-radius:50%; position:relative; top:4px; margin-right:6px; } li.right { margin-left:30px; } li.middle { margin-left:6px; } li span { position:relative; left:-100%; transition: left 200ms ease-in; } li:hover span { left:0; } Anecdotes Interviews Records Recent Stats Recent Snaps Success! As mentioned, this might be better using Canvas, or possible SVG. But if you want to stay strictly with HTML & CSS, this should help. Sec…
has comment: http://stackoverflow.com/comment/44275817
has comment: http://stackoverflow.com/comment/44347183
type: Answer
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/44280868
answers question: http://stackoverflow.com/q/27935938
accepted answer of: http://stackoverflow.com/q/27935938
has comment: http://stackoverflow.com/comment/44325539
type: AcceptedAnswer

http://stackoverflow.com/q/27900177
has answer: http://stackoverflow.com/a/30583282
type: Question
tagged with: http://stackoverflow.com/tag/gif
tagged with: javascript
score: 0
tagged with: canvas
answer count: 1
has title: Javascript - loading GIF freezed while drawing image to canvas (Phonegap/Cordova)
has body: While i draw image to canvas, loading gif won't animate on phonegap/cordova, the code looks like this: .hide{ display:none; } .absolute{ position:absolute; } &lt;div id="loading" class="hide absolute"&gt; &lt;img src="loading.gif"/&gt; &lt;/div&gt; var drawCanvas = function (img) { var element = document.getElementById('loading') canvas = document.getElementById('canvas') context = canvas.getContext('2d'); element.classList.remove('hide'); setTimeout(function () { context.drawImage(img,0,0); }, 0); element.classList.add('hide'); }; I also tried replacing animated gif with css animation, but its exactly the same, the browser refuses to animate anything while drawing the canvas Any help appreciated NB: it happens not on desktop but only in cordova/phonegap, i guess the cause is lack of hardware performance on mobile (tested on Android tablet 4.1)
type: UnansweredQuestion
tagged with: loading
tagged with: cordova

http://stackoverflow.com/a/27843466
downvote count: 0
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27842936
has comment: http://stackoverflow.com/comment/44091502
accepted answer of: http://stackoverflow.com/q/27842936
type: Answer
has comment: http://stackoverflow.com/comment/44090681
score: 2
has body: It's a guess but this (or something similar) might do as you describe. $(function(){ var disabled = false; var theMessage = $("#theMessage"); $("#theParent").on("mouseover",function(e){ if(e.target.id == "theChild"){ theMessage.text("bar"); disabled=true; } else if(!disabled) { theMessage.text("foo"); } }).on("mouseout",function(e){ if(e.target.id == "theParent"){ disabled=false;; } theMessage.text("...") }); }); #theParent {width:200px; height:200px; background:red; position:relative;} #theChild {position:absolute; top:0; right:0; bottom:0; left:0; margin:auto; width:100px; height:100px; background:blue;} ... v2: $(function(){ var disabled = false; var theMessage = $("#theMessage"); $("#theParent").on("mouseover",function(e){ if(e.target.id == "theChild"){ theMessage.text("bar"); } else { theMessage.text("foo"); } }).on("mouseout",function(e){ if(e.target.id == "theParent"){ disabled=false; theMessage.text("..."); } }); }); #theParent {width:200px; height:200px; background:red; position:relative;} #theChild {position:absolute; top:0; right:0; bottom:0; left:0; margin:auto; width:100px; height:100px; background:blue;} ... v3: Use the data-attribute to store the hover text: $(function(){ var theMessage = $("#theMessage"); var defaultTxt = theMessage.text(); $("#theParent, #theChild").on("mouseover",function(e){ e.stopPropagation(); theMessage.text($(this).data("txt")); }); $("#theParent").on("mouseout",function(){ theMessage.text(defaultTxt); }); }); #theParent {width:200px; height:200px; background:red; position:relative;} #theChild {position:absolute; top:0; right:0; bottom:0; left:0; margin:auto; width:100px; height:100px; background:blue;} ...

http://stackoverflow.com/comment/44183988
comment on: http://stackoverflow.com/a/27891459
score: 0
type: AnswerComment
has text: @Oday whilst that's the implicit effect of the above, it's unclear whether that's a formal requirement of the language. The MDN site makes no mention of it, nor can I find anything in the ES5 specification.
type: Comment

http://stackoverflow.com/q/27927965
has comment: http://stackoverflow.com/comment/44256267
has comment: http://stackoverflow.com/comment/44255610
has comment: http://stackoverflow.com/comment/44253017
type: Question
has answer: http://stackoverflow.com/a/27928054
has title: Mouseover triggering underlaying sibling?
tagged with: javascript
has body: I have two sibling divs. One div is a sub-navigation that partially overlays the slider div. I have a mouseover event on the slider, which hides the sub-navigation. The problem is, as soon as I mouse over the sub-navigation, the slider mouseover event is triggered even though my mouse isn't touching the slider yet - although the mouse is technically over the slider - it's just being overlayed by the sub-navigation. Hopefully I explained this well that someone will understand. Is there any way around this issue?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44254028
tagged with: dom-events
has comment: http://stackoverflow.com/comment/44254143
type: UnansweredQuestion

http://stackoverflow.com/a/27863597
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27863515
type: Answer
has comment: http://stackoverflow.com/comment/44129335
upvote count: 1
has body: you could call the function from the button itself: &lt;input type="button" value="输入" id="btn1" onclick='f();' /&gt; function f(){ alert("ok"); }

http://stackoverflow.com/a/27805360
upvote count: 3
has comment: http://stackoverflow.com/comment/44019728
score: 3
answers question: http://stackoverflow.com/q/27805300
has body: You have 2 issues in code: 1) concatenating substring 2) setting attribute via jquery var id = "//www.youtube.com/embed/"+idu.substr(27,37); $('.videofeatem').attr("src", id);
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44034896
has text: thanks for reply We developing Phone-Gap app so navigator.onLine is not work to me. it's returns always true
comment on: http://stackoverflow.com/a/27813869
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27873847
type: AnsweredQuestion
upvote count: 0
possible better answer: http://stackoverflow.com/a/27873868
has answer: http://stackoverflow.com/a/27873868
has answer: http://stackoverflow.com/a/27873933
type: Question
has body: i have a link like : www.localhost.com/test/#test1 i want this output test/#test1 using jquery here is my code jQuery(document).ready(function() { // my code which is working fine jQuery(this).attr('href','test/#test1'); alert(window.location.pathname); }); Now i am getting this test Does Anybody have idea about that Thanks
score: -1
answer count: 2
has title: path name with parameters in jQuery
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27873933

http://stackoverflow.com/a/27810612
score: 0
type: Answer
has body: Remove the curly braces around your ng-model and ng-show and also use another variable instead of id. Maybe something like product.show Theres also a few things you need to do before it can actually work. http://plnkr.co/edit/Il6pvUG4HlZMzRyyw0Ha &lt;input type="checkbox" ng-model="product.show" &gt; Also change the ng-show &lt;div ng-show="product.show"&gt;
accepted answer of: http://stackoverflow.com/q/27810594
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27810594

http://stackoverflow.com/q/27958162
type: UnansweredQuestion
has body: How to update a array object value , I have a object name totaldays value is 0 . When I button click the value will +1. Example now "totaldays":0 , when click "totaldays":1 var checkin_status = [ {"startdate":"2015-01-08", "totaldays":0, "roadmap":[ {"gifttype":"stars","quantity":100,"day":1}, {"gifttype":"stars","quantity":500,"day":3}, {"gifttype":"stars","quantity":1000,"day":10}, {"gifttype":"stars","quantity":1200,"day":20}, {"gifttype":"stars","quantity":2200,"day":30}, ] }]; clickforfun(checkin_status); function clickforfun(){ var button = "&lt;input type='button' id='click_button' class='click_button' value='Click me now' /&gt;" $("#call_button").append(button); $("#click_button").click(function(){ checkin_status[0].totaldays + 1; }); console.log(checkin_status[0].totaldays); // now should be 1 ? } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="call_button"&gt;&lt;/div&gt;
has answer: http://stackoverflow.com/a/27958223
has answer: http://stackoverflow.com/a/27958324
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has title: Update array object value

http://stackoverflow.com/q/27866147
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27866931
answer count: 3
downvote count: 0
has body: Since I'm a newbie with automated tests and protractor, I'm having some trouble setting this up in my tests. According to the guide, every time that I create a new instance of screenshot reporter, I have to pass a directory path. Right, this means that every time I create a new instance in my spec file? Also, there are functions to take screenshots of my skipped and my failed tests. Where i supposed to use takeScreenShotsForSkippedSpecs and takeScreenShotsOnlyForFailedSpecs? In my config file? This is my onPrepare: onPrepare: function () { browser.driver.manage().window().maximize(); global.dvr = browser.driver; global.isAngularSite = function (flag) { browser.ignoreSynchronization = !flag; } jasmine.getEnv().addReporter(new ScreenShotReporter({ baseDirectory: '/tmp/screenshots', takeScreenShotsForSkippedSpecs: true, takeScreenShotsOnlyForFailedSpecs: true }));
tagged with: jasmine
has answer: http://stackoverflow.com/a/27870678
favorite count: 0
upvote count: 7
type: AnsweredQuestion
tagged with: screenshot
score: 7
tagged with: selenium
accepted answer: http://stackoverflow.com/a/27870678
type: Question
has title: Setting up Screenshot Reporter for Protractor
tagged with: protractor
has answer: http://stackoverflow.com/a/27866931
has answer: http://stackoverflow.com/a/40146163

http://stackoverflow.com/q/27841270
has answer: http://stackoverflow.com/a/28633643
has title: React waiting for map function before deciding render to prevent div flash
favorite count: 0
accepted answer: http://stackoverflow.com/a/27841766
tagged with: dictionary
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
tagged with: reactjs
answer count: 2
has body: I am having a bit of trouble preventing a div flash where react will render the error message then receive props and finally render the props. In my EventsView component I have the following. view.js var view; if (_.size(this.props.events) !== 0) { view = this.props.events.map(function(year) { return &lt;YearView year={year} /&gt;; }); } else { view = &lt;NoEventsView /&gt; } So the variable view is rendered, initially there is no this.props.events on page load as I have another part of the file creating it. The moment this.props.events is created the events are rendered. This is done throught a react.Backbone mixin. I have tried doing something used some of the component lifecycle methods such as componentWillUpdate. The problem is they don't seem to want to work the way I want them to work and the error message is never rendered. Example of what I have tried (among others) below I thought of doing something like this. view.js componentWillUpdate: function(nextprops, nextstate) { if (_.size(nextprops.events) !== 0) { var view = nextprops.events.map(function(year) { return &lt;YearView year={year} /&gt;; }); this.setState({ view: view }); } else { this.setState({ view: &lt;NoEventsView /&gt; }) } }, // render this.state.view I would then set the getInitialState:view to the a this.props.events map. *EDIT - A temporary and terrible workaround * So the problem I was having was I had a top level component accepting a single prop which was a global variable like so view.js React.render(&lt;EventsView events={theseEvents} /&gt;, document.getElementById('mainContent')); theseEvents is actually a Backbone Collection global variable initialized in another file. On document load theseEvents would be unpopulated so my view would flash with the &lt;NoEventView /&gt; and then rerender when theseEvents is then populated. This is handled by the backbone mixin shown below. Dan's solution pointed me in the right direction. I set a global variable window.hasEvents to true or false de…
has answer: http://stackoverflow.com/a/27841766
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28633643

http://stackoverflow.com/comment/44183440
score: 0
type: AnswerComment
has text: i have added an id, ok let me rename to avoid confusion
type: Comment
comment on: http://stackoverflow.com/a/27891252

http://stackoverflow.com/q/27827529
has answer: http://stackoverflow.com/a/32481407
has comment: http://stackoverflow.com/comment/53032892
favorite count: 0
has comment: http://stackoverflow.com/comment/44061586
tagged with: angularjs
tagged with: angularjs-ng-options
upvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44061280
has body: What I need, is to be able to sort a select element's child option nodes by their text, while maintaining their value associations. I can either get them to alphabetize and disassociate from their keys, or I can associate their keys without alphabetization. I know there is a method for accessing JSON directly, but this is a phased implementation, and that functionality will come later. For now, I must load the json via precursory script block to when the app script MyInterface.js is loaded. I've researched custom filters, but that's where the disassociation from the keys comes from. If the JSON needs to be in an entirely different format, I'd be willing to adopt it. Here's what I've got... HTML Select Animal... MyInterface.js (function(json) { // AngularJS Module var MyInterface = angular.module('MyInterface', []); // Custom Filters MyInterface.filter('orderObjectBy', function() { return function(items, field, reverse) { var filtered = []; angular.forEach(items, function(item) { filtered.push(item); }); filtered.sort(function(a, b) { return a[field] > b[field] ? 1 : -1; }); if(reverse) filtered.reverse(); return filtered; }; }); // Controllers MyInterface.controller('SimpleJSON', function($scope) { $scope.JSON = angular.fromJson(json); }); })(json); Essentially what the selection needs to have option-wise is: Select Animal... Anteater Monkey Zebra Alterations Incorporating Accepted Answer HTML Select Animal... MyInterface.js (function(json) { // AngularJS Module var MyInterface = angular.module('MyInterface', []); // Controllers MyInterface.controller('SimpleJSON', function($scope, orderByFilter) { // Load JSON $scope.JSON = angular.fromJson(json); // Alphabetize by Value $scope.JSON = orderByFilter($scope.JSON, 'value'); }); })(json);
possible better answer: http://stackoverflow.com/a/32481407
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: Alphabetize Options from Object Preserving Key/Value Associations in AngularJS
has answer: http://stackoverflow.com/a/27828167
accepted answer: http://stackoverflow.com/a/27828167
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs-filter

http://stackoverflow.com/comment/44927858
comment on: http://stackoverflow.com/a/28285887
score: 0
type: AnswerComment
has text: On a web page you have file upload input. The user clicks "browse" and selects a file to upload. You now want to, in the browser in javascript, remove that file from the file upload input. If that is what you are attempting to do, the code above will do that in IE9 and Chrome 40.
type: Comment

http://stackoverflow.com/q/27886012
has comment: http://stackoverflow.com/comment/44173393
type: Question
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44173306
tagged with: css
has comment: http://stackoverflow.com/comment/44173753
favorite count: 0
has comment: http://stackoverflow.com/comment/44173265
has body: I am new to javascript object and in my ongoing project i am facign a problem where i have to recall the object constructor from inside for example function MediaRule(name, parent, string) { this.name = name; this.parent = parent; this.rules = new Array(); while(string != "") { if (string.charAt(0) == '@') { if (string.search("@keyframes") == 0) { } else { mediaString = new String; var endString = false; var nestLevel = 0; while (endString == false) { var brace = string.indexOf("}"); var getString = string.substring(0,brace+1).trim(); mediaString += getString; string = string.replace(getString, "").trim(); if (string.charAt(0) == "@") { nestLevel++; } else if (string.charAt(0) == "}") { if (nestLevel &gt; 0) { mediaString += "}"; string = string.replaceAt(0, ""); nestLevel--; } if ((nestLevel == 0) &amp;&amp; (string.charAt(0) == "}")) { mediaString += "}"; string = string.replaceAt(0, ""); var aIndex = mediaString.indexOf("{"); var bIndex = mediaString.lastIndexOf("}"); var eleString = mediaString.substring(aIndex+1,bIndex).trim(); var mediaQName = mediaString.substring(0, aIndex).trim(); this.rules.push(new MediaRule(mediaQname, this.name, eleString)) endString = true; } } } } } this object constructor is being called again and again from inside when certain condition is met the problem is that it works if i nest one level but beyond that the browser hangs i think i am doing something wrong with how the constructor is being called. i want this to work no matter how many times the same string pattern is nested.
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44173282
has title: Calling Object Constructor from within itself
score: 1

http://stackoverflow.com/a/27857827
type: AcceptedAnswer
type: Answer
has body: use ng-hide/ng-show inplace of ng-if. ng-if does not render the element in DOM where as ng-hide/ng-show render the elements in DOM and hide/show based on condition.
has comment: http://stackoverflow.com/comment/44118402
answers question: http://stackoverflow.com/q/27857587
accepted answer of: http://stackoverflow.com/q/27857587
score: 0

http://stackoverflow.com/a/77199075
has body: Something to keep in mind if you are trying to access by Interface['index'], but index is possibly undefined (optional). Note the vocabulary? below: interface ExerciseData { id: number; name: string; vocabulary?: { from: string; to: string; }[]; } Use the NonNullable utility type like so... type Test = { prop: NonNullable&lt;ExerciseData['vocabulary']&gt;[number]['from'] }
score: 8
downvote count: 0
upvote count: 8
answers question: http://stackoverflow.com/q/27875483
type: Answer

backbone.js
tags question: http://stackoverflow.com/q/27912399
tags question: http://stackoverflow.com/q/27932170
tags question: http://stackoverflow.com/q/27952924
tags question: http://stackoverflow.com/q/27805246
tags question: http://stackoverflow.com/q/27928573
tags question: http://stackoverflow.com/q/27928250
tags question: http://stackoverflow.com/q/27935623
tags question: http://stackoverflow.com/q/27919585
tags question: http://stackoverflow.com/q/27913454
tags question: http://stackoverflow.com/q/27915103
tags question: http://stackoverflow.com/q/27833184
tags question: http://stackoverflow.com/q/27844726
tags question: http://stackoverflow.com/q/27906686
tags question: http://stackoverflow.com/q/27878741
tags question: http://stackoverflow.com/q/27878969
tags question: http://stackoverflow.com/q/27952545
tags question: http://stackoverflow.com/q/27929606
tags question: http://stackoverflow.com/q/27830170
tags question: http://stackoverflow.com/q/27805541
tags question: http://stackoverflow.com/q/27809287
tags question: http://stackoverflow.com/q/27804154
tags question: http://stackoverflow.com/q/27880694
tags question: http://stackoverflow.com/q/27844274
tags question: http://stackoverflow.com/q/27869614
tags question: http://stackoverflow.com/q/27954958
tags question: http://stackoverflow.com/q/27859459
tags question: http://stackoverflow.com/q/27810138
tags question: http://stackoverflow.com/q/27816976
tags question: http://stackoverflow.com/q/27829534
tags question: http://stackoverflow.com/q/27962752
tags question: http://stackoverflow.com/q/27958410
tags question: http://stackoverflow.com/q/27809350
tags question: http://stackoverflow.com/q/27934048
tags question: http://stackoverflow.com/q/27906241
tags question: http://stackoverflow.com/q/27818461
tags question: http://stackoverflow.com/q/27924539
tags question: http://stackoverflow.com/q/27831965
tags question: http://stackoverflow.com/q/27849121
tags question: http://stackoverflow.com/q/27815384
tags question: http://stackoverflow.com/q/27950300
tags question: http://stackoverflow.com/q/27888285
tags question: http://stackoverflow.com/q/27910088
tags question: http://stackoverflow.com/q/27853010
type: Tag
tags question: http://stackoverflow.com/q/27867433
tags question: http://stackoverflow.com/q/27857329
tags question: http://stackoverflow.com/q/27924354
tags question: http://stackoverflow.com/q/27958038
tags question: http://stackoverflow.com/q/27853544
tag name: backbone.js

http://stackoverflow.com/a/27828167
type: Answer
has comment: http://stackoverflow.com/comment/44062423
has comment: http://stackoverflow.com/comment/44062659
has comment: http://stackoverflow.com/comment/44062476
score: 2
upvote count: 2
has body: You need to use array of objects with ng-options. i.e , Example $scope.animals= [ {key:"123", value:"Zebra"}, {key:"456",value: "Monkey"}, {key:"789", value: "Anteater"} ]; and since you only want key in the ng-model you would need to use syntax ng-options="option.key as option.value for option in animals | orderBy:'value'". And for default option just provide an option with value="" Select Animal... Demo angular.module('app', []).controller('ctrl', function($scope) { $scope.JSON = [{ key: "123", value: "Zebra" }, { key: "456", value: "Monkey" }, { key: "789", value: "Anteater" }]; }); Select Animal... {{IndexCategory}} Also you need to remember DOM filters are expensive as they run twice atleast during the digest cycle. If your select list is dynamic do not place DOM filter, instead you could just sort it in your controller before binding the data. In your case you could just either use a simple native sort or the orderBy filter itself in the controller. i.e angular.module('app', []).controller('ctrl', function($scope, orderByFilter) { $scope.animals= [{ key: "123", value: "Zebra" }, { key: "456", value: "Monkey" }, { key: "789", value: "Anteater" }]; /*Using orderByFilter*/ $scope.animals= orderByFilter($scope.JSON, 'value'); /*Or just use native sort*/ //$scope.animals.sort(function(a, b){ return a['value'] > b['value'] }); }); and your view would just be: ng-options="option.key as option.value for option in animals"> If you do not have an option to get the data in array format from the server and you need to transform, just do it in your controller like: $scope.animals = convertToOptions(optionsObject); function convertToOptions(obj){ var options = []; angular.forEach(obj, function(value, key){ options.push({key:key, value:value}); }); return options; } If you are really concerned about setting the option value same as that of the key property you would need to use track by. i.e ng-options="option.value for option in animals track by option.key"> Side Note: Do n…
has comment: http://stackoverflow.com/comment/44062565
has comment: http://stackoverflow.com/comment/44062382
has comment: http://stackoverflow.com/comment/44063560
answers question: http://stackoverflow.com/q/27827529
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44062415
accepted answer of: http://stackoverflow.com/q/27827529

http://stackoverflow.com/comment/44213909
comment on: http://stackoverflow.com/q/27907315
has text: what do you mean by `I need to get a MILLIS value only with Year and Month.`? Can you give us an example of what you're looking to return?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27941288
has body: To keep track of 3 booleans, I decided to use a simple array: var processingDone = Array(3); Then, I'd just set the booleans at the proper index (pseudo code): function stepTwoDone(){ processingDone[1] = true; } I figured an easy way to check if all of the booleans in there were true, would be to use every, like this: if(processingDone.every(Boolean)){ // Do stuff } Now, for some reason, if not all of the booleans are set, but all the booleans that are set, are true, the every returns true: alert('Array(3): ' + Array(3).every(Boolean) + '\n' + // true '[,,]: ' + [,,].every(Boolean) + '\n' + // true '[true,,true]: ' + [true,,true].every(Boolean) + '\n' + // true '[,false,]: ' + [,false,].every(Boolean) + '\n' + // false 'All true: ' + [true,true,true].every(Boolean) + '\n' + // true 'All false: ' + [false,false,false].every(Boolean)); // false So, what's going on here? Why does an undefined value in the array appear to equal a truthy value, when passed to the Boolean constructor? Simply calling Boolean() without parameter returns false, as expected... Of course, and easy solution would be to just set the values to something falsy in the first place: var processingDone = [false, false, false];
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27941770
has comment: http://stackoverflow.com/comment/44278813
type: Question
tagged with: boolean
answer count: 2
has title: Undefined entries in an array return `true` after parsing them as boolean with `every`
tagged with: arrays
tagged with: javascript
favorite count: 0
upvote count: 3
score: 0
has answer: http://stackoverflow.com/a/27941770
downvote count: 3
has answer: http://stackoverflow.com/a/27941615
accepted answer: http://stackoverflow.com/a/27941615
tagged with: undefined

http://stackoverflow.com/q/27818805
answer count: 1
tagged with: directory
has body: I have a front facing user input form for a directory and have a textarea box where users enter their address details. If they press enter on keyboard and enter their address on multiple lines it still prints out online as one long line. http://ilovestaffordshire.co.uk/listing/car-finance-net/ How can i force it to show on separate lines, so is more visually pleasing and easier to read?
has title: Force Line Break In Text Area Form Field
favorite count: 0
linked to: http://stackoverflow.com/q/5844465
accepted answer: http://stackoverflow.com/a/27820460
score: -2
tagged with: css
has comment: http://stackoverflow.com/comment/44046425
type: AnsweredQuestion
downvote count: 2
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/44043453
has comment: http://stackoverflow.com/comment/44047060
has answer: http://stackoverflow.com/a/27820460
tagged with: javascript
upvote count: 0
tagged with: textarea

http://stackoverflow.com/comment/44032921
score: 1
has text: Please post the answer here. Links might break over time.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27812712

http://stackoverflow.com/comment/44094076
has text: @RonaldinhoLearnCoding, So replace `timeStamp = 1420671199000;` with `timestamp = <%= timestamp %>` where the latter is the retrieved server time as unix time stamp in milliseconds.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27830021
type: AnswerComment

http://stackoverflow.com/comment/68554895
comment on: http://stackoverflow.com/a/27843898
score: 1
type: AnswerComment
has text: omg hector, i love you man! I had the same shitty problem :D thanks so much1!!
type: Comment

http://stackoverflow.com/comment/44144642
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27871019
has text: Doesn't the Google Translate API require an API key?

http://stackoverflow.com/comment/44121539
type: Comment
has text: This is cool! I've used a `var globalVariable = (function(){...})();` before, but passing `this` makes it prettier than just using a global constant.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27859357

http://stackoverflow.com/comment/44077710
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27836535
has text: format is '08-jan-15'
score: 0

http://stackoverflow.com/a/27858449
score: 4
type: Answer
has body: This is one of the best module available online,i used the same for my website,it is supported by a major number of mobile devices,many developers has contributed to this repository,might be helpful to you,also it caters for redirection to website through mobile version Redirection to Mobile Site
answers question: http://stackoverflow.com/q/27858168
upvote count: 4
accepted answer of: http://stackoverflow.com/q/27858168
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27959007
tagged with: popup
score: 1
upvote count: 1
type: Question
tagged with: jquery-ui
tagged with: javascript
has answer: http://stackoverflow.com/a/27959284
linked to: http://stackoverflow.com/q/20213330
answer count: 1
downvote count: 0
has body: I work with an Asp.net and C#. When I click on a button to show the message I get one popup box, but when I click close button on popup box it’s not closing the popup. aspx page syntax: &lt;div id='dialog-page' title="Modal"&gt; &lt;/div&gt; &lt;asp:LinkButton ID="lbtnModal" runat="server" Text="View" OnClientClick="javascript:return showDialog(this.name);"&gt;&lt;/asp:LinkButton&gt; jQuery code: function showDialog(uniqueName) { var url = "ReportGenerationSingleACView.aspx?id="; var temp=document.getElementById('&lt;% =txtCustomerID.ClientID%&gt;').value; url=url+temp; $("#dialog-page").load(url).dialog({ title: "AC View Details", autoOpen: false, resizable: true, height: 400, width: 600, modal: true, buttons: { Close: function() {$(this).dialog("close");} } }); $('#dialog-page').dialog('open'); return false; } Here is some more information about the popup work but those not work for me: Stack Overflow question: jQuery Pop up not working Why is it not working for me? How to handle or what am I missing? Help me solve this issue. If have any questions, please ask - thank you in advance, any type of suggestion will be acceptable. Note: Popup X icon works properly and close button also fired but popup not close
tagged with: jquery
has title: On Asp.net page why jquery close button not working
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27928655
score: 1
tagged with: raphael
has comment: http://stackoverflow.com/comment/44279020
has body: I'm using jquery and Raphael to create an interface with cards that can be moved around and have different images on them. I've created rect objects with the images as fills. Currently the images can only be the size of the original image but I want to resize them to make them twice as long (the original images are 40 pixels wide and high, but I want them to be 80). How can I do this without changing the original files? Here's my code: for(var i = 71; i &gt; 0; i--){ var card_name = orderRecord[i - 1];//orderRecord is a randomly ordered array of ints between 1 and 72 //the images are titled 'image1.jpg', 'image2.jpg', etc. cards[card_name] = main_canvas.rect(10, 10, 80, 80).attr('fill','url(images/thumbnails/image' + card_name + '.jpg)'); }
has title: Resizing jpg's with javascript in Raphael
tagged with: image-size
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28255930
upvote count: 1
tagged with: http://stackoverflow.com/tag/jpeg
type: Question

http://stackoverflow.com/comment/44167776
type: QuestionComment
comment on: http://stackoverflow.com/q/27882371
score: 0
has text: Try narrowing it down to a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). Without that, we can't really help that much as we don't have a starting place.
type: Comment

http://stackoverflow.com/a/49251493
has body: The problem can be solved by checking if e.ctrlKey true then we can ignore the keypress. If the Ctrl key is pressed the e.ctrlKey is true &lt;script&gt; let data = '' window.onload = function () { window.document.body.addEventListener('keydown', function(event){ if( event.keyCode == 13 || event.keyCode == 16 || event.keyCode == 17 ) { event.preventDefault(); return; } if(event.ctrlKey) { event.preventDefault(); return; } data += event.key console.log(data) }); } &lt;/script&gt; By using this code we can prevent chrome from navigating to Downloads Page.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27960841
upvote count: 1

http://stackoverflow.com/q/27962154
has title: Drawing disappears on canvas (Drawn using fabricjs)
score: 0
has comment: http://stackoverflow.com/comment/44317898
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to create a T-shirt design studio. Right now i'm working on drawing functionality. User can draw anything on the tshirt. Fabric's docs states that drawing mode can be enabled by adding isDrawingMode: true to the fabric canvas element. So i added it and i was able to draw lines on the canvas. But those lines dissapear if i do something else. Here's the demo. Clicking on the Accessories tab enables the isDrawingMode and hence lines can be drawn on the canvas. But if you open Choose Style and select BACK option. Again open Choose Style and select FRONT, those lines dissapear. Why those lines are not binding with the canvas? i even tried renderAll() method stated in the docs.
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/44318703
type: UnansweredQuestion
answer count: 0
type: Question
tagged with: canvas
tagged with: javascript
tagged with: fabricjs

http://stackoverflow.com/comment/44058097
type: Comment
has text: Actually, it returns an array-like object that is called an `HTMLCollection` or `NodeList`. https://developer.mozilla.org/en-US/docs/Web/API/document.getElementsByClassName
comment on: http://stackoverflow.com/a/27826151
score: 1
type: AnswerComment

http://stackoverflow.com/comment/44111453
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27853755
has text: Thanks joe but can you please let me know how come `if(data==="true")` didn't work which I already tried?

http://stackoverflow.com/q/27960409
has answer: http://stackoverflow.com/a/27960689
has comment: http://stackoverflow.com/comment/44314770
has comment: http://stackoverflow.com/comment/44314536
upvote count: 0
accepted answer: http://stackoverflow.com/a/27960689
answer count: 1
has comment: http://stackoverflow.com/comment/44314412
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44314667
favorite count: 0
has title: jquery change text input with content of var
has comment: http://stackoverflow.com/comment/44314569
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: I'm trying to put together a Jquery &amp; JQ ui slider that calculates the subranges and after that update the content of 2 divs and 2 textboxes, my only problem is that i don't get the VAR in the textbox while im sliding the "slider". I want to have it returned to the inputs with #hidden1&amp;2 and to the divs with the #slider-results1&amp;2 but i dont know howto do that with VAR A for example. On slide he needs to calculate and then update the INPUT and DIV with the results from A B and C. So if anybody can explain what might could work or whatever im doing wrong it could be very helpfull Jsfiddle can be found here, dont change it pls: http://jsfiddle.net/m5mpkang/49/ my code so far: $(function () { var myslider = $('#basic').limitslider({ values: [100, 200], min: 0, max: 300, step: 0.5, showRanges: true, left: 7, ranges: [false, true, false], slide: function( event, ui ) { $( '#slider-result1' ).html( ui.values[0] ); $( '#slider-result2' ).html( ui.values[1] ); $( '#amount1' ).val( ui.values[0] ); $( '#amount2' ).val( ui.values[1] ); var z=$( '#amount1' ).val(); var y=$( '#amount2' ).val(); var x=300; // fixed @ 300, future use: &lt;?=$php-&gt;size?&gt; var a=z; // subrange between the begin / selector 1 var b=y-z; // subrange between selector 1 / 2 var c=x-y; // subrange between selector 2 / MAX $('#hidden1').html(a); $('#hidden1').attr('value', 'a'); /// this "a" refers to VAR A and VAR A gets it from VAR Z $('#hidden2').attr('value', ui.values[1]); /// this works due but aint the plan cause i need the calculated VARS }, }); });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44314648
has comment: http://stackoverflow.com/comment/44314470
has comment: http://stackoverflow.com/comment/44314426
downvote count: 3
score: -3
type: Question
has comment: http://stackoverflow.com/comment/44314511
has comment: http://stackoverflow.com/comment/44314696

http://stackoverflow.com/q/27837097
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44078956
accepted answer: http://stackoverflow.com/a/27873574
has comment: http://stackoverflow.com/comment/44078638
has title: Hide div class in javascript
answer count: 4
type: AnsweredQuestion
score: -5
has comment: http://stackoverflow.com/comment/44078697
has comment: http://stackoverflow.com/comment/44078607
possible better answer: http://stackoverflow.com/a/27837314
has answer: http://stackoverflow.com/a/27837456
has answer: http://stackoverflow.com/a/27837445
has comment: http://stackoverflow.com/comment/44078549
has answer: http://stackoverflow.com/a/27837314
has comment: http://stackoverflow.com/comment/44078616
type: Question
has body: How to hide div section in step 3. i.e when clicking edit button 2nd time before editing 1st data, i want to hide 1st div. I tried with $(".idOfDIV").hide(); but it will hide div and while clicking Edit , I cant see any div section. please help me out Save Cancel function Edit(id) { $(".idOfDIV").hide(); document.getElementById('anchSave' + id).style.display = "inline-block"; document.getElementById('anchcancel' + id).style.display = "inline-block"; document.getElementById('txtDesignation' + id).style.display = "inline-block"; } I have one text box ,save and cancel anchor tags inside div. ....
has answer: http://stackoverflow.com/a/27873574
has comment: http://stackoverflow.com/comment/44078655
downvote count: 5
tagged with: javascript
upvote count: 0

http://stackoverflow.com/a/27889688
upvote count: 6
has body: There are two things that worry me about that code: remove is a relatively new DOM method which isn't well-supported. For better support, use img.parentNode.removeChild(img); getElementsByTagName returns a live NodeList, and so when you remove the elements from the beginning of the list, all the others shift up. So if the list has 5 entries, and you remove the i=0 element, all the others move and now there's a new i=0 element (and the length is 4). Your loop will move on to i=1 and so the element at i=0 (which used to be at i=1) won't get processed. For a non-live NodeList, use querySelectorAll('tagname') (or just loop through the list backward, removing from the end). Or use Array.prototype.slice to convert the NodeList into an array. querySelectorAll is supported by all modern browsers, and also by IE8. Here's an example using querySelectorAll: var imgElements = document.querySelectorAll("img"); // HTMLCollection for(var i=0; i&lt;imgElements.length; i++) { var img = imgElements[i]; img.parentNode.removeChild(img); } Or just counting backward: var imgElements = document.getElementsByTagName("img"); // HTMLCollection for(var i=imgElements.length-1; i&gt;=0; i--) { var img = imgElements[i]; img.parentNode.removeChild(img); } Or using Array.prototype.slice: var imgElements = Array.prototype.slice.call(document.getElementsByTagName("img")); for(var i=0; i&lt;imgElements.length; i++) { var img = imgElements[i]; img.parentNode.removeChild(img); }
answers question: http://stackoverflow.com/q/27889663
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27889663
type: Answer
downvote count: 0
score: 6
has comment: http://stackoverflow.com/comment/44180349
has comment: http://stackoverflow.com/comment/44180573

http://stackoverflow.com/a/27920299
accepted answer of: http://stackoverflow.com/q/27919910
score: 6
has body: You are confusing the JSON to style a map which is what you get out of the Map Styling Wizard and the GeoJSON used by the data layer They go in different places and do different things. To style the map, put the "style" data in the MapOptions styles property. The data layer is used for displaying geographic information on the map (markers, polygons, polylines,...), not styling the map tiles. Working code snippet with your map styles (if you want to load them from an external file, you can, but you wouldn't use the data layer, you would just assign the styling data to a global variable and use that for the styles property): var map; function initialize() { // Create a simple map. map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 16, center: { lat: 53.668398, lng: -2.167713 }, styles: [{ "featureType": "landscape", "elementType": "geometry.fill", "stylers": [{ "color": "#ffffff" }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#efefef" }] }, { "featureType": "water", "stylers": [{ "visibility": "off" }] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{ "visibility": "on" }, { "color": "#dedddd" }] }, { "featureType": "road", "elementType": "geometry.fill", "stylers": [{ "visibility": "on" }, { "color": "#efefef" }] }, { "featureType": "poi", "elementType": "labels.icon", "stylers": [{ "visibility": "on" }] }] }); // Load a GeoJSON from the same server as our demo. //map.data.loadGeoJson('http://pixelsandcode.local:5757/map.json'); } google.maps.event.addDomListener(window, 'load', initialize); html, body, #map-canvas { height: 100%; width: 100%; } &lt;script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk"&gt;&lt;/script&gt; &lt;div id="map-canvas"&gt;&lt;/div&gt;
type: AcceptedAnswer
downvote count: 0
upvote count: 6
answers question: http://stackoverflow.com/q/27919910
type: Answer

http://stackoverflow.com/a/27892888
accepted answer of: http://stackoverflow.com/q/27892761
answers question: http://stackoverflow.com/q/27892761
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44187067
has body: The value of mytime is not a string, and does not have a method of substring. This is why it is throwing this exception. You could cast mytime to a string, if it makes sense to. var lTime1 = String(mytime).substring(-1,1);

http://stackoverflow.com/comment/44079645
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27836634
type: Comment
has text: OK you win. Then explain what my fiddle does. That should be easy for you.

http://stackoverflow.com/comment/44075064
comment on: http://stackoverflow.com/a/27835002
type: AnswerComment
score: 0
has text: @LeoShi `(5.56789).toString()` will return `"5.56789"` anyway.
type: Comment

http://stackoverflow.com/comment/44239656
comment on: http://stackoverflow.com/q/27920901
type: Comment
type: QuestionComment
score: 0
has text: Thanks Kenvin for promptly pointing out the internal link, but When I try it, the page request UserName and PassWord. While inputting directly to the "geoip-demo" page, it provides the information for free, and doesn't ask for membership account.

http://stackoverflow.com/q/27853366
has comment: http://stackoverflow.com/comment/44110894
has comment: http://stackoverflow.com/comment/44110748
tagged with: php
has title: How can i get my string replace with to equal the value of a form input?
has comment: http://stackoverflow.com/comment/44110719
has comment: http://stackoverflow.com/comment/44110812
score: -1
type: Question
has comment: http://stackoverflow.com/comment/44110814
has comment: http://stackoverflow.com/comment/44110769
downvote count: 2
has answer: http://stackoverflow.com/a/27853432
upvote count: 1
tagged with: function
linked to: http://stackoverflow.com/q/11563638
tagged with: javascript
has comment: http://stackoverflow.com/comment/44110787
has comment: http://stackoverflow.com/comment/44110803
answer count: 1
has comment: http://stackoverflow.com/comment/44110731
has comment: http://stackoverflow.com/comment/44110827
favorite count: 0
has body: Im trying to use string replace to change a line of code within my page. &lt;script type="text/javascript"&gt; function replaceScript() { var toReplace = 'LINE OF CODE 333'; var replaceWith ='??????????'; document.body.innerHTML = document.body.innerHTML.replace(toReplace, replaceWith); } &lt;/script&gt; How can I get my... var replaceWith ='??????????'; ...to equal the value of an input from a form on the page? Note the input value is auto populated on page load and the user does not enter in there own email address.
type: UnansweredQuestion

http://stackoverflow.com/comment/44573660
score: 0
type: Comment
has text: Thank you Roberto. I eventfully ended up using ajax is a different way.
type: AnswerComment
comment on: http://stackoverflow.com/a/27808192

http://stackoverflow.com/q/27893257
has answer: http://stackoverflow.com/a/27893496
tagged with: select
type: Question
answer count: 1
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery
score: 0
has body: I am using ddslick. Is it possible on change to submit form ? My code: Chicago New York But its not working ... any help ?
type: UnansweredQuestion
has title: ddSlick select on change submit form

http://stackoverflow.com/q/27873628
has comment: http://stackoverflow.com/comment/44151050
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I was wondering if there is any way to set the slider bar plays automatically like for example, when I click the play button, the slider bar and the value will increase automatically. Here is my slider bar: JSFiddle Basically what I wanted is I clicked on the play button, then the slider bar and its value will increase automatically and stops for few seconds at each value before increment. Through my research, I know there is a method called setInterval() will repeat certain event automatically but I not sure how to implement it. And this is my Fiddle after I added the auto play function but my slider bar is not coming out.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27874807
type: AnsweredQuestion
has title: JQuery set timer for event triggering
score: 1
possible better answer: http://stackoverflow.com/a/27873773
upvote count: 1
has answer: http://stackoverflow.com/a/27873773
has comment: http://stackoverflow.com/comment/44151189
type: Question
has comment: http://stackoverflow.com/comment/44151188
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27874807

http://stackoverflow.com/comment/44021810
has text: @The_Black_Smurf i'm aware of this mistake , i corrected it but still same error
type: Comment
comment on: http://stackoverflow.com/q/27806211
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44072907
type: QuestionComment
comment on: http://stackoverflow.com/q/27833693
type: Comment
score: 0
has text: that is very clear. What are you unable to understand?

http://stackoverflow.com/a/27934202
score: 1
type: Answer
has body: Requrement: That it always rotates clockwise. One thing: If you use CSS transitions, it'll calculate the shortest route for you. You want a bit more control over rotational direction, so I commented out the transition:transform 1s ease; in your CSS because we'll control this manually. JAVASCRIPT I borrowed this JQuery function and modified it so we can feed it a starting angle, and ending angle and it'll animate #graph1 for us. (Read the link to change duration, easing, and to use the complete callback) $.fn.animateRotate = function(angle, start, duration, easing, complete) { var args = $.speed(duration, easing, complete); var step = args.step; return this.each(function(i, e) { args.complete = $.proxy(args.complete, e); args.step = function(now) { $.style(e, 'transform', 'rotate(' + now + 'deg)'); if (step) return step.apply(e, arguments); }; $({deg: start}).animate({deg: angle}, args); }); }; I also modified your JQuery so it won't rotate counter-clockwise: when currentRotationDegrees is greater than degreesToZero, it'll subtract 360, and then use this new value as the starting position for `animateRotate(). if(currentRotationDegrees &gt; degreesToZero){ currentRotationDegrees -= 360; } $('#graph1').animateRotate(degreesToZero, currentRotationDegrees); Here it is in action. http://jsfiddle.net/q4nad31t/1/
upvote count: 1
answers question: http://stackoverflow.com/q/27933728
downvote count: 0

http://stackoverflow.com/comment/44167838
score: 0
comment on: http://stackoverflow.com/q/27833784
has text: How are you defining lag? The time in between the starting of individual sounds? Or the time in between pressing some button and playing some sounds.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44207536
comment on: http://stackoverflow.com/q/27904206
has text: Try using Google....
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/44186574
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27892549
score: 0
has text: `\b` matches a word boundary (that is: The zero-width position between a `\w` and a `\W`). Your original definition *"only if not preceded by a single quote"* did not say *"and also there must be a word boundary before that single quote"*, so I removed the leading `\b`. (Because otherwise it would have *required* one of `[a-zA-Z0-9_]` before the single quote - and I figured this was likely not your intention.)

http://stackoverflow.com/comment/44066874
has text: What do you mean by *"And all rows have same id"* ?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27830422

http://stackoverflow.com/comment/44207183
has text: Right, I had no idea about that since it's not in the question. But you can add the activated class when you do the first html change. There, added that to my answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/27903769
score: 0
type: Comment

http://stackoverflow.com/comment/67921973
comment on: http://stackoverflow.com/a/36623117
type: AnswerComment
has text: I'd be using an Express server. I've seen the code for it but I'm not entirely sure how to integrate it... How would I do it with webpack, for example?
type: Comment
score: 0

http://stackoverflow.com/q/27820521
type: Question
has answer: http://stackoverflow.com/a/27820763
answer count: 1
tagged with: javascript
score: 0
tagged with: mvvm
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27820763
has body: I need to disable specific textbox from list of textbox that dynamically created. Consider the code that I create 5 textbox dynamically using "create button", from that I need to disable 2nd textbox. &lt;input type="button" value="Create TextBox" data-bind="click: addCourse"/&gt; &lt;input type="button" value="Disable 2nd TextBox" data-bind="click: disable"/&gt; &lt;div data-bind="foreach: cources"&gt; &lt;div&gt; &lt;input type="text" data-bind="value: textValue,disable: disableStatus"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div data-bind="foreach: cources"&gt; &lt;div&gt; &lt;span type="text" data-bind="text: textValue"/&gt; &lt;/div&gt; &lt;/div&gt; js code: function CourseViewModel(){ this.textValue = ko.observable(''); this.disableStatus = ko.observable(false); } function CeremonyViewModel() { this.cources = ko.observableArray(); this.addCourse = function(){ this.cources.push(new CourseViewModel()); }; this.disable = function() { this.disableStatus(true); } } ko.applyBindings(new CeremonyViewModel());
type: AnsweredQuestion
has title: Disable specific textbox from dynamic creation of textbox using knockout.js
tagged with: knockout.js

http://stackoverflow.com/a/27907016
type: Answer
has body: Well this may just be me, but you are overriding the value of x repeatedly here: var x = document.forms["register"]["firstname"].value; var x = document.forms["register"]["lastname"].value; var x = document.forms["register"]["email"].value; var x = document.forms["register"]["email2"].value; it looks to me as if x would then be given a new value every time and then would only contain the last value it was asigned. Essentially, if the last box is filled in, the form will be counted "valid". Make an array and store each value into its own index, then use a for loop to go through them and check if any are equal to null or an empty string. var x = []; x[0] = document.forms["register"]["firstname"].value; x[1] = document.forms["register"]["lastname"].value; x[2] = document.forms["register"]["email"].value; x[3] = document.forms["register"]["email2"].value; x.forEach(function(element, index, array) { if (element == null || element == "") { $(".form_error").show(); return false; } });
answers question: http://stackoverflow.com/q/27906851
score: 0

http://stackoverflow.com/q/27829200
score: 0
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/44085522
possible better answer: http://stackoverflow.com/a/27829235
tagged with: ajax
has answer: http://stackoverflow.com/a/27829229
accepted answer: http://stackoverflow.com/a/27829229
has comment: http://stackoverflow.com/comment/44064461
has comment: http://stackoverflow.com/comment/44064423
has answer: http://stackoverflow.com/a/27829235
type: Question
type: AnsweredQuestion
has title: Get value of select loaded with AJAX
has body: I am loading a select via AJAX and then trying to use the value of the select for another AJAX call. So I have: &lt;select id ="thisSelect"&gt; &lt;option value = "someValue1"&gt; Some Value 1 &lt;/option&gt; &lt;option value = "someValue2"&gt; Some Value 2 &lt;/option&gt; &lt;/select&gt; This loads fine. Then I am trying to access the value of thisSelect like so: $(document).ready(function(){ var value = $('#thisSelect').val(); alert(value); }); It only registers the first value that the select loaded with in the original AJAX call and isn't capturing any of the changes. Any ideas? I tried: $('#thisSelect').on('change', function() { var value = (this.value); //or alert(this.value); }); in the same $(document).ready block, but 'value' shows up as undefined and I don't get an alert box.
tagged with: javascript
linked to: http://stackoverflow.com/q/12824549

http://stackoverflow.com/comment/44204029
comment on: http://stackoverflow.com/q/27902060
has text: @feeela Didn't know there is any other bootstrap than Twitter Bootstrap... I have updated to include my HTML code for the list
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27842329
has answer: http://stackoverflow.com/a/27846658
has answer: http://stackoverflow.com/a/27851540
type: AnsweredQuestion
tagged with: bluebird
has body: I am writing a test where I need to loop over the results of an async api call and dynamically make mocha 'Its' to test each iteration of the response. I found some other related answers which got me started. Here is what I have tried so far. function getter(uri) { return new Promise(function(resolve, reject) { request({ method: 'GET', json: true, uri: uri }, function(error, response, body) { if (response.statusCode == 200) { resolve(body); } else { reject(error); } }); }); } describe('This works', function() { it('works', function(done) { getter('myapi_that_returns_an_array').then(function(r) { r.should.not.be.empty; done(); }).catch(function(err) { done(err); }); }); }); describe('Why not this one', function() { getter('myapi_that_returns_an_array').each(function(r) { it('should make a test', function(done) { r.should.not.be.empty; done(); }); }); }); I tried to just wrap a simple array in a promise and feed that to my test and it works! So I cannot figure out why the api call I make does not work the same way. function simple_test() { return new Promise(function (resolve, reject) { resolve([ [1, 2, 3, 4], [2, 3, 4, 1], [3, 4, 2, 1], [4, 1, 2, 3] ]); }); } describe('But this one works', function() { two().each(function(r) { it('is a test', function(done) { r.should.not.be.empty(); done(); }); }); }); I tried to add a timeout to simple_test to make it act like the api call - the result is the same as the api call. Is there a way to do this with Mocha? It looks like the describe is executing before waiting for the promise to resolve.
type: Question
linked to: http://stackoverflow.com/q/27442944
tagged with: javascript
tagged with: mocha.js
accepted answer: http://stackoverflow.com/a/27851540
has title: Bluebird Each loop in Mocha not working
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27846658

http://stackoverflow.com/q/27842323
has answer: http://stackoverflow.com/a/27842460
has title: search first element under itself using Jquery
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27842472
tagged with: javascript
has body: I am trying to select multiple checkboxes when previous one is checked. Currently the first set of checkboxes is working fine. But when I select second checkbox the attached checkboxes should be selected instead of the first checkbox set. html code Hus og hjem Boligalarm Forsikring Lån Eiend. megler Telecom Varmepumpe Annet Bil og båt Bilverksted Båtverksted Dekk Annet bil Annet båt java script code $(document).ready(function(){ $('acronym .OverFlowCheckbox').click(function(){ if ($(this).is(':checked')) { $('._user_auth').first().fadeIn('slow'); } else { $('._user_auth ').fadeOut('slow'); } }); }); current online jsfiddle code
has comment: http://stackoverflow.com/comment/44088836
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27842472
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44088366
favorite count: 0
possible better answer: http://stackoverflow.com/a/27842393
has comment: http://stackoverflow.com/comment/44088461
has answer: http://stackoverflow.com/a/27842393
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44088511

http://stackoverflow.com/comment/44129730
type: QuestionComment
comment on: http://stackoverflow.com/q/27863148
has text: I tried target="_self", but this doesn't work. I don't think it's something from the iFrame, because every iFrame does this.
score: 0
type: Comment

http://stackoverflow.com/a/27923398
type: Answer
has body: You can use hasOwnProperty. if (obj.hasOwnProperty('muxEnviroments')) {do the stuff...}
has comment: http://stackoverflow.com/comment/44243670
accepted answer of: http://stackoverflow.com/q/27923280
answers question: http://stackoverflow.com/q/27923280
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44243865
score: 0

http://stackoverflow.com/q/27867304
has answer: http://stackoverflow.com/a/53828321
tagged with: twitter-bootstrap
upvote count: 26
tagged with: http://stackoverflow.com/tag/html
has body: I have a page with several bootstrap modals with: data-toggle="modal" data-target="#modal-12345" The problem is, I have an entire table row that is clickable, like &lt;tr data-toggle="modal" data-target="#modal-12345"&gt; The modal content is in another hidden table row right below, followed by the next clickable row and so on. Now, this row also contains a button that will go to another page when clicked. I need the entire row clickable so it opens the modal, except when the button to go to the other page is clicked, then I need to stop the modal from opening. I need something like this &lt;script&gt; $('.ID').on('click', '.btn', function(e) { e.stopPropagation(); }) &lt;/script&gt; But targeting this: data-toggle="modal" I also tried giving the TR a class of "modaltoggle" and then calling it with the javascript as .modaltoggle but that didn't work either.
has title: prevent bootstrap modal from opening when a button is clicked
tagged with: css
answer count: 4
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/33506716
type: Question
has answer: http://stackoverflow.com/a/71070406
possible better answer: http://stackoverflow.com/a/53828321
has answer: http://stackoverflow.com/a/27867680
accepted answer: http://stackoverflow.com/a/27867680
score: 26
tagged with: javascript
linked to: http://stackoverflow.com/q/43047300
linked to: http://stackoverflow.com/q/67513467
tagged with: jquery
has answer: http://stackoverflow.com/a/27868091
favorite count: 0

http://stackoverflow.com/comment/44293510
score: 3
has text: use the one that keeps clutter out of your main file (require is cached anyway)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27949235

http://stackoverflow.com/q/27874750
has body: The application load at the beginning some users via Angularjs / $http.get() and on scroll down it load more (infinite scroll). The page has also some location filters, so users can choose a different Country and City to see Users only from that location. The controller is this: $scope.country; $scope.city; $scope.users = []; $scope.busy = false; $scope.destroy = null; $scope.nextPage = function() { if ($scope.busy) return; $scope.busy = true; $http.get('/users', { params: { destroy: $scope.destroy, country: $scope.country, city: $scope.city } }).success(function(res) { var users = res.users; for (var i = 0; i &lt; users.length; i++) { $scope.users.push(users[i]); } $scope.busy = false; $scope.destroy = null; }).error(function() { alertify.error('Error loading Escorts'); }); }; On location change I call a service that return new country and city; So I set these information and empty the users array; I also set the $scope.destroy to tell the server to clear the session; In the session I store the ids of the users already loaded in the page to avoid duplications. This is the code that handle the location change in the same controller: $scope.$on('handleLocationBroadcast', function() { $scope.country = SharedLocationService.country; $scope.city = SharedLocationService.city; $scope.destroy = 'destroy'; $scope.users = []; $scope.nextPage(); }); Server side I'm using Expressjs / Node and the controller is pretty simple: exports.getUsers = function(req, res) { // If parameter destroy is 'destroy' then clear the session.skip. if (req.query.destroy === 'destroy') req.session.skip = []; // set skip with session or empty array (need for the first call) var skip = req.session.skip || []; // set locations (I use to store also the location in a session for future calls var country = req.query.country || req.session.country || { $ne: '' }; var city = req.query.city || req.session.city || { $ne: '' }; // Get users User.find({ '_id' : { '$nin': skip }}) .where( { 'location.country' …
tagged with: angularjs
tagged with: node.js
type: AnsweredQuestion
type: Question
has title: Node.js / Expressjs do not clear session
tagged with: session
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/27875284
accepted answer: http://stackoverflow.com/a/27875284
score: 0
answer count: 1

http://stackoverflow.com/a/27932120
upvote count: 2
has body: .prepend() inserts an element as the first child of another; it sounds like you need .before(). Your selector also needs a dot (assuming jstree-icon is a class). $('.jstree-icon').before(' test ');
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27932088

http://stackoverflow.com/comment/44090878
type: QuestionComment
type: Comment
has text: You're already in PHP. Remove the `<?php echo` and `?>` from it.
comment on: http://stackoverflow.com/q/27843561
score: 0

http://stackoverflow.com/comment/44214178
type: Comment
comment on: http://stackoverflow.com/q/27907337
has text: Can you post more of your relevant code? At least the controller for your app?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44151193
type: AnswerComment
score: 0
type: Comment
has text: @JulianRubisch Sorry but did not look at this properly to see the obvious. The basic point is to replace your underscore|lodash (whichever) `_each.` call with something like `async.each`. That at least has a callback mechanism that signifies the end of each iteration and of course the end of all iterations. Will try to edit with an example soon. But that is the general point.
comment on: http://stackoverflow.com/a/27860163

http://stackoverflow.com/comment/44260717
comment on: http://stackoverflow.com/q/27931610
has text: If you `console.log(event.kecode);` inside the function when pressing the **/-key**, what do you get in console?
type: QuestionComment
type: Comment
score: 0

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/27955351

http://stackoverflow.com/comment/44027966
type: Comment
comment on: http://stackoverflow.com/a/27809126
has text: @carb0nshel1 I've provided a workable solution above. As a general rule, having your application logic rely so heavily on markup structure is a bad idea. If you're just starting out then these kinds of muddles are good ones to learn from. Keep going with it, but don't be afraid of scrapping what you have and starting over.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44168406
type: Comment
has text: Yeah that is fine, what is the issue? forEach, map etc are native, ecmascript5 standard not supported in older browsers without the help of shim.
comment on: http://stackoverflow.com/a/27881872
score: 0
type: AnswerComment

http://stackoverflow.com/a/27842087
has comment: http://stackoverflow.com/comment/44092797
has body: First of all you need to use a field (or fields) as primary key in your database. You mention that you could use the email field to do this, but check that the field is set as unique. Then you can capture the session value of email and fetch the database for the rest of the data: if(isset($_SESSION)){ $userEmail=$_SESSION['email']; $userData = fetch_assoc(query("SELECT * FROM your_table WHERE email = '$userEmail'")); } Note that you should define fetch_assocand querymethods depending on your way to connect to the database. Something like: global $link = mysqli_connect('localhost','username','password','database'); //TODO: your connection here function query($sql) { return mysqli_query($link, $sql); } function fetch_assoc($query) { return mysqli_fetch_assoc($query); } Once you have that, you add in each input the corresponding value: &lt;input type="text" id="part2" value="&lt;?= $userData['lastName'] ?&gt;"/&gt; And so on. Also, consider using classes instead of repeating code in styles.
upvote count: 0
has comment: http://stackoverflow.com/comment/44094169
answers question: http://stackoverflow.com/q/27841739
has comment: http://stackoverflow.com/comment/44099063
type: Answer
score: -1
has comment: http://stackoverflow.com/comment/44095322
downvote count: 1

http://stackoverflow.com/comment/44216880
has text: Could you please clarify what you need to do?
score: 4
comment on: http://stackoverflow.com/q/27908789
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27946356
has body: There are some differences here: $('foo') This will get the element with id="foo". Using this, Prototype will wrap it around it's functions. Each argument is a different element with a different id that will be selected. Here you are using the $ (dollar) utility function. Using this: document.getElementbyId('foo'); You are selecting the same element, but it isn't wrapped in any framework. You have direct access to it. Internally, $('foo') will be mapped to document.getElementbyId('foo'). This isn't relevant to the question, but it's good to point out. This example: $('foo') Might be confused with the jQuery framework, passing as the first element a CSS element selector which would select all &lt;foo&gt; elements. This would have the same behavior as Prototype's $$ (dollar-dollar) utility.
has comment: http://stackoverflow.com/comment/44288878
has comment: http://stackoverflow.com/comment/44289367
upvote count: 1
has comment: http://stackoverflow.com/comment/55891479
downvote count: 1
answers question: http://stackoverflow.com/q/27946168
has comment: http://stackoverflow.com/comment/55891686
score: 0
has comment: http://stackoverflow.com/comment/55888246
has comment: http://stackoverflow.com/comment/55889972
has comment: http://stackoverflow.com/comment/55844326
has comment: http://stackoverflow.com/comment/55845987
type: Answer

http://stackoverflow.com/a/27901985
upvote count: 1
score: -1
has body: Just add a query string value to indicate success, then on page load check for it and add a class. So when a file download has finished: Response.Redirect("yourUrl" + "?Success=true"); Then on your page load: if (Request.QueryString["Success"] != null) { LinkButton1.CssClass += " file-downloaded"; }
has comment: http://stackoverflow.com/comment/44203945
downvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27901862

http://stackoverflow.com/a/27963090
type: AcceptedAnswer
downvote count: 0
score: 7
type: Answer
accepted answer of: http://stackoverflow.com/q/27962954
answers question: http://stackoverflow.com/q/27962954
upvote count: 7
has comment: http://stackoverflow.com/comment/44319553
has body: Use grouping by parentheses, f.e. to return modified array after slice: var a = [2,3,4,5]; somethingElse((a.splice(0,0,1), a));
has comment: http://stackoverflow.com/comment/44319354
has comment: http://stackoverflow.com/comment/44319478
has comment: http://stackoverflow.com/comment/44319687

http://stackoverflow.com/a/27858156
has comment: http://stackoverflow.com/comment/44140955
type: Answer
has comment: http://stackoverflow.com/comment/44119855
has comment: http://stackoverflow.com/comment/44121025
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44120358
has body: Solution JSFiddle: http://jsfiddle.net/7q81sfd0/15/ Tried adding event listeners before appending the child to the DOM, didn't work. Resorted to a loop, after all radio buttons were appended to the DOM. var inputRadio = document.getElementsByTagName('input'); for(var i = 0; i &lt; inputRadio.length; i++) { if(inputRadio[i].type === "radio") { inputRadio[i].onchange = function() { console.log("clicked "+this.value); }; } }
answers question: http://stackoverflow.com/q/27857958
downvote count: 0
has comment: http://stackoverflow.com/comment/44118943

http://stackoverflow.com/a/27899679
has comment: http://stackoverflow.com/comment/44201758
has comment: http://stackoverflow.com/comment/44202550
has comment: http://stackoverflow.com/comment/44203754
has comment: http://stackoverflow.com/comment/44240437
has comment: http://stackoverflow.com/comment/44199180
has comment: http://stackoverflow.com/comment/44202627
has comment: http://stackoverflow.com/comment/44201822
has comment: http://stackoverflow.com/comment/44202317
has comment: http://stackoverflow.com/comment/44199307
has body: Incorrect total number of pages, or any discrepancy in paging info, are almost always caused by an incorrect server response. If we have configured pageSize:20 and we want page 2, server must return exactly 20 records, starting from record 21 (1 based numbering) and must return correct total number of records in the table.
type: Answer
answers question: http://stackoverflow.com/q/27898907
score: 0
has comment: http://stackoverflow.com/comment/44213355
has comment: http://stackoverflow.com/comment/44240861
has comment: http://stackoverflow.com/comment/44203627

http://stackoverflow.com/comment/45220222
comment on: http://stackoverflow.com/q/27865387
score: 0
type: Comment
type: QuestionComment
has text: Whoops, I guess I misread, my bad!

http://stackoverflow.com/q/27806141
tagged with: indexeddb
has answer: http://stackoverflow.com/a/27809745
type: Question
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44022607
has comment: http://stackoverflow.com/comment/44021866
tagged with: javascript
score: 1
tagged with: http://stackoverflow.com/tag/html
has title: IndexedDB - Can't pass variable after onsuccess when opening database
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44022490
upvote count: 1
has body: I have been looking for assistance with setting up an IndexedDB for web storage, and I have run into a problem that I cannot find a good answer to. After I have successfully setup/opened the database I am having trouble passing the variable that contains the database information to access it later. Here is my code, I have been following a guide from MDN : const DB_NAME = 'database-name'; const DB_VERSION = 2; const DB_STORE_NAME = 'users'; var db; function openDb() { console.log('openDb ...') var request = indexedDB.open(DB_NAME, DB_VERSION); request.onsuccess = function(event) { db = request.result; console.log("openDb DONE"); }; request.onerror = function(event) { console.log(request.errorCode); }; request.onupgradeneeded = function(event) { console.log('openDb.onupgradeneeded'); var store = event.currentTarget.result.createObjectStore(DB_STORE_NAME, { keyPath: 'id', autoIncrement: true }); store.createIndex('age', 'age', { unique: false }); }; } function getObjectStore(store_name, mode) { var tx = db.transaction(store_name, mode); return tx.objectStore(store_name); } When getObjectStore is called the variable db is undefined. My knowledge of javascript is very limited and some concepts I don't get. The guide doesn't not show anything special being done and their demo works as is. Some other guides have mentioned implementing a callback, but they don't show how its done nor do I understand the concept of callbacks. Any help is appreciated. Thanks.
tagged with: web-storage

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/27826876
tags question: http://stackoverflow.com/q/27889545
tags question: http://stackoverflow.com/q/27915261
tags question: http://stackoverflow.com/q/27963033
tags question: http://stackoverflow.com/q/27906867
type: Tag

http://stackoverflow.com/a/27920834
has comment: http://stackoverflow.com/comment/44239957
type: Answer
has comment: http://stackoverflow.com/comment/44239669
answers question: http://stackoverflow.com/q/27919583
has comment: http://stackoverflow.com/comment/44239551
has body: First of all, make sure that me.PopupWindow.queryById('HrItemId') really returns the expected number field. Number fields do have reset method since Ext 1 so the only way how it would "become" undefined is that you're not calling it on a numberfield. There's another problem I see in the above code and it is that you use ids on components. That is a bad, or better say a deadly, practice as ids propagate down to html markup. Html ids must be unique on a page. That means if you have a window with a form and fields and fields have ids, you mustn't have two instances of that window. If you do an unpredictable behavior ensues.
has comment: http://stackoverflow.com/comment/44240058
score: 0

http://stackoverflow.com/q/27930456
has title: adding ng-model attribute in transclude function
has comment: http://stackoverflow.com/comment/51193837
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44262909
type: Question
has body: i'm trying to add the attribute ng-model inside of all elements and directives that have the "name" attribute on it, but for some reason when i use the transclude function of my link function the directives removes the ng-model that i added and then angular throws me the error: Error: [$compile:ctreq] Controller 'ngModel', required by directive 'someDirectiveThatRequiresNgModel', can't be found! When i see the DOM in my chrome developers tools the ng-model is removed (is removed from directive elements but not from simple input elements) after i added it using this code: compile: function(element, attrs){ return { pre: function ($scope, $element, $attrs, ctrl, transclude) { }, post: function($scope, $element, $attrs, ctrl, transclude){ var initializePromise = $scope.__initialize(); initializePromise.then(function(){ transclude($scope, function (clone, scope) { var inputs = clone.find('[name]'); $.each(inputs, function (index, input) { var ainput = angular.element(input); ainput.attr('ng-model', 'someValidScopeAttribute'); $compile(ainput)($scope); }); $element.prepend(clone); }); }); } } }, Why the attribute is removed when the directive is compiled inside the Transclude function?, how I can achieve what I need?
linked to: http://stackoverflow.com/q/21807834
has comment: http://stackoverflow.com/comment/44265992
tagged with: angularjs-ng-transclude
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44258139
tagged with: angularjs

http://stackoverflow.com/comment/44155320
score: 0
has text: Please provide your html code. or change from `$(".homefeed").prepend(response);` to `$(".homefeed").html(response);`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27876855

http://stackoverflow.com/a/27890675
has body: You could create two projects, one for client side and one for the back-end. If you make the two projects part of one solution I think you've got your answer. UPDATE So if I understood right you want an application where Intellisense will give you auto-complete options for js in one folder in and another one for node. You can do this the following way: you create a Solution (every project is part of a solution; solutions can contain multiple projects, it's just a matter of organizing your code) for a NodeJS project (using the plugin you mentioned). After that it is straight forward: you just need to create a folder let's say public where you put your client side code. There you add your JavaScript by adding simple js files. See the image below:
answers question: http://stackoverflow.com/q/27889870
has comment: http://stackoverflow.com/comment/44453269
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44302017
score: 1
has comment: http://stackoverflow.com/comment/44186102

http://stackoverflow.com/comment/44195906
has text: Worst case you do `if (returnVal.trim() == "success"){` but that's just a hack, better to send the right thing from the server
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27897851
score: 1

http://stackoverflow.com/comment/44208133
comment on: http://stackoverflow.com/q/27904047
score: 0
type: Comment
type: QuestionComment
has text: 'marginTop' : "-25%" is working fine. Thanks for your comment

http://stackoverflow.com/a/30485639
type: Answer
answers question: http://stackoverflow.com/q/27908393
has body: Same Problem here also. No Basic css support also for MrRio library. https://github.com/MrRio/jsPDF But you may refer: https://github.com/Flamenco/jsPDF There is css support but there is issues with margin setting for pages.
score: 0

http://stackoverflow.com/q/27936576
tagged with: javascript
tagged with: jquery
tagged with: show-hide
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27936939
has answer: http://stackoverflow.com/a/27936939
has title: Why the drop downs are not getting hide and show based on value selected from the select box in following case?
tagged with: jsfiddle
type: AnsweredQuestion
has body: Following is the concerned HTML code: Traditional Classroom Online Classroom Starts at : hh 01 02 03 04 05 06 07 08 09 10 11 12 mm 00 05 10 15 20 25 30 35 40 45 50 55 AM PM Ends at : hh 01 02 03 04 05 06 07 08 09 10 11 12 mm 00 05 10 15 20 25 30 35 40 45 50 55 AM PM All Mon Tue Wed Thu Fri Sat Sun I want to hide the select controls when user selects the option "Online Classroom" and the same should be displayed when user selects "Traditional Classroom". I've written all the code but not understanding why its' not functioning? It's not hiding and showing the drop downs? Please help me. Following is the fiddle link. JSFIDDLE
has answer: http://stackoverflow.com/a/27936616
accepted answer: http://stackoverflow.com/a/27936616
type: Question
answer count: 2

http://stackoverflow.com/a/27946972
type: AcceptedAnswer
downvote count: 0
has body: var keyword creates a local variable. Remove it to have access to variable from the outer scope: var clients; $('#clients').on('change', function(e) { clients = e.target.value; }); However, you should keep in mind that alert(clients) in your last line will always display undefined as the change event will be triggered later when the actual event will fire.
has comment: http://stackoverflow.com/comment/44289930
type: Answer
answers question: http://stackoverflow.com/q/27946934
has comment: http://stackoverflow.com/comment/44754726
has comment: http://stackoverflow.com/comment/44289723
accepted answer of: http://stackoverflow.com/q/27946934
has comment: http://stackoverflow.com/comment/44747667
has comment: http://stackoverflow.com/comment/44289388
upvote count: 9
has comment: http://stackoverflow.com/comment/44288978
score: 9

http://stackoverflow.com/q/27950056
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27950165
possible better answer: http://stackoverflow.com/a/27950297
type: Question
has answer: http://stackoverflow.com/a/27950297
answer count: 2
has title: Keyboard sequence to click on button
has body: I would like a system administrator to easily create new accounts in an application. I was thinking keys alt and shift would trigger the "Create New User" button or defaultButton2 in my application. I can get one key to work, but combining both keys doesn't seem to work. $(document).ready(function () { $("input").bind("keydown", function (event) { var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); if (keycode == 16 && keycode == 18) { document.getElementById('defaultButton2').click(); return false; } else { return true; } }); });
upvote count: 1
accepted answer: http://stackoverflow.com/a/27950165
has comment: http://stackoverflow.com/comment/44295275
tagged with: javascript
tagged with: dom
tagged with: jquery-events

http://stackoverflow.com/comment/44316779
type: Comment
has text: @Kai You mentioned the wrong ID for total in your jQuery code. Replace `$('#enttotalday'+ien)` with `$('#enttotalday')`. See this updated jsBin: http://jsbin.com/xasidewari/1/
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27960999

http://stackoverflow.com/q/27808618
has answer: http://stackoverflow.com/a/27809340
has title: eBay API response error: Resource interpreted as Script but transferred with MIME type text/xml
tagged with: ebay-api
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/79566005
upvote count: 0
type: Question
score: -2
tagged with: javascript
downvote count: 2
accepted answer: http://stackoverflow.com/a/27809340
answer count: 1
favorite count: 0
has body: I'm new to eBay's API, have been creating url string and appending it to a JS-created 'script' tag, only been calling findItem / findItemAdvanced so far and had no problems receiving and processing the response. Problem is I tried a getSingleItem request and wada-ya-know error after error. First Attempt: &lt;script&gt; url='htt'+'p://open.api.ebay.com/shopping?' +'callname=GetSingleItem' +'&amp;'+'responseencoding=XML' +'&amp;'+'appid=********-2a4d-4b23-8d37-defc1bbb868f' +'&amp;'+'siteid=0' +'&amp;'+'version=515' +'&amp;'+'ItemID=191467818411' +'&amp;'+'callback=funCB' /******************************/ elm=document.createElement('script') elm.src=url document.body.appendChild(elm) &lt;/script&gt; Which is an exact duplicate of the method for the find call except for the url &amp; REST-PAYLOAD: url='htt'+'p://svcs.ebay.com/services/search/FindingService/v1' +'?OPERATION-NAME=findItemsAdvanced' +'&amp;SERVICE-VERSION=1.0.0' +'&amp;SECURITY-APPNAME=********-2a4d-4b23-8d37-defc1bbb868f' +'&amp;GLOBAL-ID=EBAY-GB' +'&amp;RESPONSE-DATA-FORMAT=XML' +'&amp;REST-PAYLOAD=true' So I ask myself why, go on the hunt, find out about several different methods to make the call &amp; finally decide that the jQuery $.ajax() GET/POST method is best suited to my limited coding capability. After much practice I came up with a call that works for the finding but not the damn getItem url. $(document).ready(function(){ /****************************** url='htt'+'p://svcs.ebay.com/services/search/FindingService/v1' +'?OPERATION-NAME=findItemsAdvanced' +'&amp;SERVICE-VERSION=1.0.0' +'&amp;SECURITY-APPNAME=********-2a4d-4b23-8d37-defc1bbb868f' +'&amp;GLOBAL-ID=EBAY-GB' +'&amp;RESPONSE-DATA-FORMAT=XML' +'&amp;REST-PAYLOAD=true' +'&amp;paginationInput.entriesPerPage=3' +'&amp;keywords=charizard' /******************************/ url='htt'+'p://open.api.ebay.com/shopping?' +'callname=GetSingleItem' +'&amp;'+'responseencoding=XML' +'&amp;'+'appid=********-2a4d-4b23-8d37-defc1bbb868f' +'&amp;'+'siteid…

http://stackoverflow.com/comment/44088306
comment on: http://stackoverflow.com/a/27841897
type: AnswerComment
score: 0
type: Comment
has text: This works fine for SPA also. You have to check login status while splash screen is being displayed, if the user is logged in- redirect it to website else - to your login page

http://stackoverflow.com/comment/44091731
type: QuestionComment
type: Comment
score: 1
has text: @OnurYıldırım JavaScript specification doesn't mandate stability of the sorting algorithm. So its purely an implementation detail.
comment on: http://stackoverflow.com/q/27843673

http://stackoverflow.com/comment/44309478
comment on: http://stackoverflow.com/a/27957232
has text: but code is not working at all. The I have written above is not working. I will try your code latar, but please help me correct the code. There is no error, only I didn't get the result.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44184310
type: Comment
type: QuestionComment
has text: @jfriend00-let say that makeCounter have additional code in it still it is clousre ? I must return the function with the "local varible " to become a clousre ?
score: 0
comment on: http://stackoverflow.com/q/27891595

http://stackoverflow.com/q/27959156
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs
tagged with: angularjs-ng-repeat
downvote count: 0
type: UnansweredQuestion
has body: I'm using the tx3 Tag Cloud to visualize some data. Actually it is simple to use. HTML5 CSS3 Javascript jQuery ... I want to fill this elements from a list of angular scope with ngRepeat. {{element.title}} In DevTools/Firebug i can see that all li-elements are created but the data-weights are ignored. Without ngRepeat i can see that the style attribute with a size value will be added to the li element. With ngRepeat this is not the case. I think the problem is that the angular scope is not loaded/initialized at the time when the tag cloud is created. Is there a way to force that the scope is fully loaded before the page load? Thanks in advance.
type: Question
score: 1
tagged with: tag-cloud
has answer: http://stackoverflow.com/a/28043497
upvote count: 1
has title: Filling tx3 TagCloud with ngRepeat
answer count: 1

http://stackoverflow.com/q/27854581
score: 0
tagged with: wordpress
answer count: 1
has answer: http://stackoverflow.com/a/27855042
tagged with: knockout.js
has title: KnockoutJS on WordPress not working?
has body: I have KnockoutJS loaded (or probably—loaded) on this WordPress website and KnockoutJS in particular doesn't seem to work (see below): http://dev.boltonremote.com/test-2/ The thing is, I don't think it's my browser or the site not loading JS properly, because: 1.) NumeralJS works; 2.) Ordinary JS works; 3.) Bootstrap, too. That's a custom page in WordPress. I had to declare the CDNs and write the script raw on the page instead of putting it inside the page editor. But I believe that wasn't the case since I wrote a numeralJS script on the page too, and it worked. So, does anyone know if Knockout is just not tested or proven not to load in WordPress, or is there some special way to load KnockoutJS?
tagged with: javascript
tagged with: jquery
type: Question
accepted answer: http://stackoverflow.com/a/27855042
type: AnsweredQuestion

http://stackoverflow.com/comment/44378042
type: Comment
has text: if you are already using backbone, the idea is to put data in models, and listen to change events on the model, so you render upon model changes, not upon data sync with the server.
comment on: http://stackoverflow.com/a/27933686
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44112756
score: 0
type: AnswerComment
has text: I'm already doing this in my config block. This is not the solution.
type: Comment
comment on: http://stackoverflow.com/a/27854561

http://stackoverflow.com/comment/44297395
has text: How do you handle duplicates?
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27951110
type: QuestionComment

tcp
type: Tag
tags question: http://stackoverflow.com/q/27810294
tag name: tcp

http://stackoverflow.com/q/27920105
tagged with: object
has comment: http://stackoverflow.com/comment/44237771
has answer: http://stackoverflow.com/a/27920183
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27920183
has body: I'm trying to create an object and append a corresponding DOM element to which I'd like to bind an event that triggers a function. My question is: is it possible to access the object's initial values within that binded function? function Bloc() { this.DOMel; this.ID = Math.round( Math.random() * 1000); this.startPosX; this.init = function() { $('#blocs-container').append( '&lt;div class="bloc" data-id="' + this.ID + '"&gt;&lt;/div&gt;' ); this.DOMel = $('.bloc[data-id="' + this.ID + '"]'); this.DOMel.bind('touchstart', function(e) { this.startPosX = e.originalEvent.touches[0].pageX; }); } } Here, for instance, I'd like to access and modify this.startPosX within the function bound to the touchstart event. Is it possible? If not, how should I work around it? Thanks!
has title: Access object value within bound function
possible better answer: http://stackoverflow.com/a/27920174
has comment: http://stackoverflow.com/comment/44237885
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
linked to: http://stackoverflow.com/q/3127429
has answer: http://stackoverflow.com/a/27920174
favorite count: 0
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/27921305

http://stackoverflow.com/q/27946611
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has title: List item value is always 0 using jQuery
has answer: http://stackoverflow.com/a/27946681
answer count: 4
score: 3
tagged with: list
upvote count: 3
has body: Working a page of buttons which populates a textarea with the value of the buttons. This works fine for items that are buttons, but cannot get it working for list items. I have to use a list item since some buttons have a drop down. jsfiddle shows the list item alerting 0 even thought it does have a value. http://jsfiddle.net/hsw32zv8/ Click Click 2 jQuery: $(".item_value").on('click',function(){ alert(this.value); });
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27946776
has answer: http://stackoverflow.com/a/27946715
has answer: http://stackoverflow.com/a/27946674

http://stackoverflow.com/a/57002934
type: Answer
has body: The standard way of deleting a cookie in JavaScript is to overwrite cookie's value to empty value and expires date to a passed date. Example: Let's say that cookie you'd like to delete is called access_token. Below line should deleted the cookie, if cookie's domain is in the same domain, then this should work. We assume that access_token cookie is in example.com domain. // Deleting access_token cookie with implicit domain. document.cookie = "access_token=; expires=Thu, 01 Jan 1970 00:00:00 UTC;" However, If cookie's domain is in a different domain or a sub-domain above line should not work. Let me be more precise. This time, we assume that access_token cookie is in .example.com sub-domain (notice the dot in front of example.com). Then, above line should not work, thus cookie will not be deleted. Solution, for cases where cookie is in a different domain/sub-domain, then you have to explicitly specify domain/sub-domain name while deleting cookie. // Deleting access_token cookie, with explicit domain/sub-domain document.cookie = "access_token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; domain=.example.com/"
upvote count: 2
answers question: http://stackoverflow.com/q/27917245
score: 2
downvote count: 0

http://stackoverflow.com/comment/44070846
score: 0
type: Comment
type: QuestionComment
has text: @adeneo someone answer bellow is work, how bout make `videoid` to array same way ?
comment on: http://stackoverflow.com/q/27832236

http://stackoverflow.com/q/27823666
accepted answer: http://stackoverflow.com/a/27823737
has comment: http://stackoverflow.com/comment/44080718
type: Question
answer count: 2
has title: How to call a function with parameters from another function that has parameters?
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27823781
tagged with: jquery
favorite count: 0
has body: Im using D3 and JS. I have a function that creates buttons and one of the parameters is onClick which runs when the buttons is clicked (obviously). For example: simpleButton(imageURL, width, height, title, onClick){ .attr("xlink:href", imageUrl) //-original image .attr( "width", width) //-icon width .attr( "height", height) //-icon height .on("click", onClick) .append("svg:title") .text(title); //-give the button a title } Now one of my buttons I'm going to use to hide some shapes (i.e. set visibility:hidden). So I have created another function to hide the selection, something like: hideSelection(selection){ selection.classed("hidden", true); } This function takes on one parameter so that I can pass through what I want to hide. So for example what I thought would work looks like this: simpleButton("\images\dog", 100, 100, "dog", hideSelection(dog)); Now, this does work, but it works straight away without me clicking. I know it's because I'm calling the hideSelection straight away because of the parenthesis-(). But my question is, how do I stop calling this function straight away when running it ? How do I run a function with parameters via another function that has parameters (if that makes any sense at all)?
tagged with: d3.js
upvote count: 1
possible better answer: http://stackoverflow.com/a/27823781
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27823737

http://stackoverflow.com/comment/44205476
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27902691
has text: sorry friend, but all it did was make it bigger: http://i1379.photobucket.com/albums/ah126/conchairtoe/5_zps07ff9ab7.png

papaparse
type: Tag
tags question: http://stackoverflow.com/q/27951754
tag name: papaparse

http://stackoverflow.com/a/27889252
accepted answer of: http://stackoverflow.com/q/27887678
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/60684069
downvote count: 0
has comment: http://stackoverflow.com/comment/57035533
has comment: http://stackoverflow.com/comment/127136367
has body: Update for Newer Users The JSX Compiler tool has been removed as JSXTransformer has been deprecated. The React Team recommends using another tool such as the Babel REPL. If you wish to keep the JSX source code intact for better maintainability, I would keep them as .jsx files. Using the JSX Compiler, either manually or via build script, will convert your JSX syntax to normal JavaScript files. Note: It is possible to serve JSX files in your production environment but React will give you console notices about reduced performance. Personally, I would use something like gulp-jsx or gulp-reactify to convert the files. Example with gulp-jsx: var gulp = require('gulp'); var jsx = require('gulp-jsx'); gulp.task('build', function() { return gulp.src('path/to/*.jsx') .pipe(jsx()) .pipe(gulp.dest('dist')); });
type: Answer
has comment: http://stackoverflow.com/comment/82771667
upvote count: 23
answers question: http://stackoverflow.com/q/27887678
score: 23

http://stackoverflow.com/comment/44174149
type: QuestionComment
comment on: http://stackoverflow.com/q/27886204
score: 0
type: Comment
has text: Imagine what would happen if you put ` ` directly in your HTML.

http://stackoverflow.com/a/27893168
has comment: http://stackoverflow.com/comment/44187623
upvote count: 3
answers question: http://stackoverflow.com/q/27893156
has comment: http://stackoverflow.com/comment/130386280
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27893156
has body: with Jquery: $("#divADV").hide() or with plain javascript: document.getElementById(divADV).style.display = 'none'; but you're better off just doing this in css: #divADV{ display: none; }
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44187930
has comment: http://stackoverflow.com/comment/44187571
type: Answer
has comment: http://stackoverflow.com/comment/44187945
score: 3

http://stackoverflow.com/comment/84593776
type: Comment
score: 2
comment on: http://stackoverflow.com/a/44844096
type: AnswerComment
has text: Any way of do this dinamically? Like in JS ExerciseData[xxx][]

http://stackoverflow.com/comment/59133716
has text: So, `.fire('tap')` doesn't work for me. Could still use an answer on how to fire this event.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27831981
score: 0

http://stackoverflow.com/q/27934576
favorite count: 0
has answer: http://stackoverflow.com/a/69148230
has comment: http://stackoverflow.com/comment/44266681
tagged with: focus
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: if I have a content I can click on it, it will show an outline, and document.activeElement points to this element. However, if I run document.getElementById('mydiv').focus() then the element appears in document.activeElement but does not show the outline. How can I make it show the outline when focused programmatically? I'd prefer not to use a class I juggle around to style the outline into existence, as I'd like it to go away whenever the user takes any action that would blur it.
has title: Focus outline doesn't appear when focused programmatically?
has comment: http://stackoverflow.com/comment/44266685
type: Question
linked to: http://stackoverflow.com/q/7538771
upvote count: 9
has comment: http://stackoverflow.com/comment/44266802
score: 9
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27942642
score: 0
has comment: http://stackoverflow.com/comment/44280857
answers question: http://stackoverflow.com/q/27942507
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44283078
type: Answer
accepted answer of: http://stackoverflow.com/q/27942507
upvote count: 1
has body: You don't need to. &lt;script type="text/javascript"&gt; var jArray = &lt;?php echo json_encode($dataArray); ?&gt;; console.log(jArray); &lt;/script&gt; Check the console output (F12 in most browsers), it's already an array. That's because json_encode produces json which is at the same time an array literal in javascript.
downvote count: 1

http://stackoverflow.com/a/27842640
has comment: http://stackoverflow.com/comment/44092805
has comment: http://stackoverflow.com/comment/44098736
has comment: http://stackoverflow.com/comment/44089851
score: 1
answers question: http://stackoverflow.com/q/27842396
has comment: http://stackoverflow.com/comment/44093400
accepted answer of: http://stackoverflow.com/q/27842396
upvote count: 1
has comment: http://stackoverflow.com/comment/44099136
type: AcceptedAnswer
has body: You can convert your getLatLong call to return a jQuery Promise: (NB: I'm not including the getUrlFallback logic here as you haven't included that code so I can't tell what its supposed to do): function getLatLong() { return $.Deferred(function(def) { if (!Modernizr.geolocation) { def.resolve(geoplugin_latitude(), geoplugin_longitude()); } else { navigator.geolocation.getCurrentPosition( function(position) { def.resolve(position.coords.latitude, position.coords.longitude); }, def.resolve(geoplugin_latitude(), geopugin_longitude()), { enableHighAccuracy: false, timeout: 10000, maximumAge: 360000 } ); } }).promise(); } And also modify getUrl such that it returns the result of $.ajax, and omitting the success and error callbacks: function getUrl(latitude, longitude) { return $.ajax(...); } So you can now use: getLatLong().then(getUrl).then(callAction); // NB: no () after callAction callAction will automatically be passed the URL, instead of it being stored in a variable in the outer scope. Note now how the getLatLong function specifically now does that and only that. It doesn't subsequently try to convert the lat/long into a URL because getUrl does that for you (whether the URL came from the GeoAPI or the geoplugin).
has comment: http://stackoverflow.com/comment/44092744
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44090158
has comment: http://stackoverflow.com/comment/44093660

http://stackoverflow.com/comment/44186503
type: Comment
has text: @Nick You can't Include express in a HTML file. NodeJS is a platform to run javascript, express is a framewrok for NodeJS to serve websites (HTML). After looking at the code you linked in Andi's answer, I'm not even sure what you're trying to do anymore.
comment on: http://stackoverflow.com/a/27883998
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44281523
comment on: http://stackoverflow.com/q/27942688
has text: @mdxs maybe but this seems to work... its where I got the code from http://nakupanda.github.io/bootstrap3-dialog/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27869258
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I'm improving a small website, where there is a menu fixed in any position of the window, you should activate the item when the ID that this linked is in the window. To start enternder how it works, I made this fiddle http://jsfiddle.net/kanzer/ydwzwa49/1/ this works well, it is what I want. This helped me a lot the following code: // Cache selectors var lastId, topMenu = $("#prime-menu-slide"), topMenuHeight = topMenu.outerHeight()+15, // All list items menuItems = topMenu.find("a"), // Anchors corresponding to menu items scrollItems = menuItems.map(function(){ var item = $($(this).attr("href")); if (item.length) { return item; } }); // Bind to scroll $(window).scroll(function(){ // Get container scroll position var fromTop = $(this).scrollTop()+topMenuHeight; // Get id of current scroll item var cur = scrollItems.map(function(){ if ($(this).offset().top &lt; fromTop) return this; }); // Get the id of the current element cur = cur[cur.length-1]; var id = cur &amp;&amp; cur.length ? cur[0].id : ""; if (lastId !== id) { lastId = id; // Set/remove active class menuItems .parent().removeClass("active") .end().filter("[href=#"+id+"]").parent().addClass("active"); } }); But in real life, on the site that I want to put it does not work and I cannot understand, why?. leave the fiddle that does not work. http://jsfiddle.net/kanzer/ev6xn7rc/2/ Thank you for your help!!! :)
has title: How to activate an item from a menu, when the target is in top scroll?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27870477
accepted answer: http://stackoverflow.com/a/27870477
tagged with: dom
type: Question
score: 0

http://stackoverflow.com/comment/44240805
comment on: http://stackoverflow.com/a/27921561
score: 0
has text: Sorry, I don't get you. Where you see -1? Do you want to make it 0 instead?
type: Comment
type: AnswerComment

error-handling
tags question: http://stackoverflow.com/q/27867162
tag name: error-handling
tags question: http://stackoverflow.com/q/27901149
tags question: http://stackoverflow.com/q/27807183
tags question: http://stackoverflow.com/q/27937070
tags question: http://stackoverflow.com/q/27874418
type: Tag

http://stackoverflow.com/comment/44033221
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27810749
has text: Thank you very much. Is there any simple explanation why only reduce can compose map, not other direction?
type: AnswerComment

http://stackoverflow.com/comment/44294080
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27936840
has text: ok, will do, thx. Yeah, it gets called from the load callback.
score: 0

http://stackoverflow.com/comment/44071074
type: Comment
type: QuestionComment
has text: So rather you need to use $apply, otherwise the var might not get updated, i only suggest, since this is angular related
comment on: http://stackoverflow.com/q/27831945
score: 0

http://stackoverflow.com/comment/82618134
score: 1
type: AnswerComment
has text: Are you sure that this doesn't impact SEO? You are giving a 404 status to pages that actually exist. The user might never realise this, but bots do pay a lot of attention, in fact so much, that they will not scrape your page.
comment on: http://stackoverflow.com/a/41661951
type: Comment

http://stackoverflow.com/comment/44328769
comment on: http://stackoverflow.com/a/27957568
has text: @MrUpsidown, yes i was planning on implementing a "ping interval" but i dont know what kinds of costs to the user's hardware i am dealing with
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27892665
accepted answer: http://stackoverflow.com/a/27893131
has body: &lt;!-- Textarea --&gt; &lt;div class="form-group"&gt; &lt;label class="col-md-4 control-label" for ="&lt;%= id %&gt;"&gt;&lt;%= label %&gt;&lt;/label&gt; &lt;div class="col-md-4" &gt; &lt;textarea class="form-control" id="&lt;%= id %&gt;" name="&lt;%= id %&gt;" &gt;&lt;%= textarea %&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;/div&gt; I'am searching bootstrap form builder https://github.com/IhabSoliman/Bootstrap-Form-Builder No server-side programming language is used in form builder app and all file in html but some tags like &lt;%= id %> I don't know what the tag is in html file You can download builder app and then in assets/js/templates/snippet folder all the html files included. You can look that files to see this tags. Shortly, I want to know which language tag it is
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/44186645
has comment: http://stackoverflow.com/comment/44186622
tagged with: javascript
has title: In html file <% tag
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27893131
favorite count: 0
has comment: http://stackoverflow.com/comment/44186575
has answer: http://stackoverflow.com/a/27892780
has answer: http://stackoverflow.com/a/27892796
has comment: http://stackoverflow.com/comment/44186571
upvote count: 1
possible better answer: http://stackoverflow.com/a/27892780
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44162361
score: 0
comment on: http://stackoverflow.com/q/27832356
type: Comment
type: QuestionComment
has text: My answer links two JS libs that when combined will approximate the effect you want (iiuc), though what you're attempting is difficult by nature. Please accept my answer if find a solution using JS libraries as acceptable.

http://stackoverflow.com/comment/44137407
comment on: http://stackoverflow.com/a/27867435
score: 0
type: AnswerComment
has text: Oh, thanks. My mistake. Need some rest :)
type: Comment

http://stackoverflow.com/q/27875703
has title: How to change degree of gradient on mouse movement?
favorite count: 0
has comment: http://stackoverflow.com/comment/44152947
type: Question
upvote count: 2
answer count: 2
tagged with: css
has answer: http://stackoverflow.com/a/27875914
possible better answer: http://stackoverflow.com/a/27876140
tagged with: canvas
has comment: http://stackoverflow.com/comment/44152912
has answer: http://stackoverflow.com/a/27876140
downvote count: 0
accepted answer: http://stackoverflow.com/a/27875914
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44152926
has comment: http://stackoverflow.com/comment/44152979
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I was inspired by this code sinppet from http://codepen.io/andreasstorm/pen/syvoL HTML - background-image: linear-gradient( 180deg , #4ac1ff, #795bb0 ) CSS (stylus) - html height 100% body background-color #292c2f font-family monospace overflow hidden .gradient height calc(100% - 70px) background-image linear-gradient(180deg,#4ac1ff,#795bb0) position absolute width 100% header background #252525 height 70px line-height 70px #currentVal color #424242 font-size 14px font-weight 800 padding-left 240px span color #ccc #range width 180px border 0 height 4px background #424242 outline none position absolute left 30px top 32px .ui-slider-handle position absolute margin 0px 0 0 -7px border-radius 100% background white border 0 height 14px width 14px outline none cursor pointer &:hover &:focus transform scale(1.1) .ui-slider-range background #4ac1ff JavaScript (coffeeScript) - $("#range").slider range: "min" max: 360 value: 180 slide: (e, ui) -> $("#spanVal").html ui.value bg = "linear-gradient(" + ui.value + "deg,#4ac1ff,#795bb0)" $(".gradient").css "background-image", bg In the same way I am trying to implement it on a background of a webpage though I'm not well versed with JavaScript. Is there anyway we could implement the same effect on mouse movement? I mean changing the degree of the gradient along with the position of the cursor on the screen. Any help would be greatly appreciated!

http://stackoverflow.com/a/27945018
has body: The default template for a popover is: So you can just add some CSS that targets these elements. Source: http://getbootstrap.com/javascript/#popovers
has comment: http://stackoverflow.com/comment/44285466
score: 5
accepted answer of: http://stackoverflow.com/q/27944961
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/27944961
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44285715

http://stackoverflow.com/comment/44205139
comment on: http://stackoverflow.com/q/27902829
type: Comment
score: 1
has text: Don't check viewport width using window width, use `window.matchMedia` instead, handling cross browser scrollbars: https://developer.mozilla.org/en-US/docs/Web/API/Window.matchMedia See polyfill to support IE10<: https://github.com/paulirish/matchMedia.js/
type: QuestionComment

http://stackoverflow.com/a/27813730
has comment: http://stackoverflow.com/comment/44034551
upvote count: 2
has comment: http://stackoverflow.com/comment/44034693
type: Answer
answers question: http://stackoverflow.com/q/27813680
has comment: http://stackoverflow.com/comment/44034408
score: 2
has comment: http://stackoverflow.com/comment/44034426
has body: It means if Number variable is not defined or its not numeric then assign 0 to the n variable. Example Example 1&gt; var Number = 'test'; n= +Number || 0; O/P: n = 0 -------------------------------------------- Example 2&gt; var Number = 2; n= +Number || 0; O/P: n = 2 -------------------------------------------- Example 3&gt; n= +Number || 0; O/P: n = 0
downvote count: 0
has comment: http://stackoverflow.com/comment/44034436
has comment: http://stackoverflow.com/comment/44034601
has comment: http://stackoverflow.com/comment/44034655
has comment: http://stackoverflow.com/comment/44034463

http://stackoverflow.com/a/77231332
upvote count: 2
type: Answer
score: 2
downvote count: 0
has body: If using serve (npm package) to serve your React app and you can't configure your .htaccess or nginx.conf file, you can set your start command for serve to be serve dist/ -s The -s flag tells serve that your app is an SPA and it should respond with index.html to all network calls. Then your app will work. Credit: https://help.railway.app/project-help/f9v3gkPQRy4UShk5SnoPDH/getting-your-create-react-app-running-on-railway/qHRsgxa5n57xLp1yVgk9fP
answers question: http://stackoverflow.com/q/27928372

http://stackoverflow.com/comment/44086312
has text: if you are checking the lentgh is 1 why not put (maxlength="1") in the input and just check if a,b are not null -- see here about maxlength -- http://www.w3schools.com/tags/att_input_maxlength.asp
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27841252

http://stackoverflow.com/q/27878430
has comment: http://stackoverflow.com/comment/44158570
has body: I am trying to do a test app based on app from tutorial https://docs.angularjs.org/tutorial/step_00 . It works fine but I have with post method. index.html ... Chili! send! ... controllers.js 'use strict'; var phonecatControllers = angular.module('phonecatControllers', []); phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http', '$log', function ($scope, $http, $log) { $http.get('http://localhost:8080/webapp/rest/myresource/posts'). success(function (data) { $scope.posts = data; }); $scope.data = "hello world"; $scope.chiliSpicy = function () { $log.info('chili function'); }; $scope.sendData = function () { $http.post('http://localhost:8080/webapp/rest/myresource/', {'data' : $scope.data} ) .succes(function (data, status, headers, config) { // !!! here is line 39 $log.info('sent'); }) .error(function (data, status, headers, config) { $log.error('not sent') }); }; }]); Get method works ok (showed html code does not contain its usage), also chiliSpicy function works. But sendData function throws error (where success function is) TypeError: undefined is not a function at l.$scope.sendData (http://localhost:8080/webapp/controllers.js:39:18) at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:198:424 at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:798:21 at l.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:126:84) at l.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:126:310) at l.scopePrototype.$apply (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1478:22) at HTMLButtonElement.<anonymous> (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:797:25) at HTMLButtonElement.c (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:32:363) Actually, the server receives data, but success function do not pass. Any idea? Thanks.
tagged with: misspelling
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27878501
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/27878523
type: Question
has answer: http://stackoverflow.com/a/27878523
answer count: 2
tagged with: javascript
has title: Post method throws an error
tagged with: ajax
has answer: http://stackoverflow.com/a/27878501
tagged with: angularjs-http

http://stackoverflow.com/a/27942263
type: Answer
has comment: http://stackoverflow.com/comment/44310683
answers question: http://stackoverflow.com/q/27936884
has body: By default, WordPress has an admin-ajax.php file which you can send AJAX calls to. You can create a hook that is linked to your own custom function in which you can do the stuff you want, like getting the random term and send it back to the client. Then you can pass a value to your AJAX call, called 'action'. When admin-ajax.php is getting a POST request with the action you 'hooked', your custom function is being executed. Have a look at the links below for a more detailed explanation: http://premium.wpmudev.org/blog/how-to-use-ajax-with-php-on-your-wp-site-without-a-plugin/ http://codex.wordpress.org/AJAX_in_Plugins
score: 0

http://stackoverflow.com/a/27822700
has body: There is a gridOption to do exactly that: exporterSuppressColumns I edited the plunker from the UI Grid documentation to demonstrate hiding the "Gender" column in the exported PDF: http://plnkr.co/edit/89ZVlPZcQbHYzgX5l4yq?p=preview Now whether you select export "all" or export "visible", you will never see the gender column in the output. $scope.gridOptions = { columnDefs: [ { field: 'name',visible:true }, { field: 'gender', cellFilter: 'mapGender', exporterPdfAlign: 'right', visible:true, enableHiding: true }, { field: 'company', visible: false } ], exporterSuppressColumns: [ 'gender' ], The documentation is here: http://ui-grid.info/docs/#/api/ui.grid.exporter.api:GridOptions
upvote count: 25
has comment: http://stackoverflow.com/comment/71322715
score: 25
has comment: http://stackoverflow.com/comment/71360127
answers question: http://stackoverflow.com/q/27810420
accepted answer of: http://stackoverflow.com/q/27810420
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/27831900
type: AnsweredQuestion
has title: innerHTML function in Javascript not working
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/27832012
type: Question
has answer: http://stackoverflow.com/a/27831979
tagged with: javascript
has comment: http://stackoverflow.com/comment/44069774
score: 0
has comment: http://stackoverflow.com/comment/44069702
answer count: 3
has body: I am trying to make the text on the webpage update dynamically based on what day it is. But for some reason the text "OPEN Wednesday FROM 9 AM to 5:30 PM" isn't showing up. I am using XAMPP, but I don't think that matters. Her is my code. var hours = ["Closed", "Closed", "9 AM to 9 PM", "9 AM to 5:30 PM","9 AM to 9 PM", "9 AM to 5:30 PM", "9 AM to 2:30 PM"]; //Sunday -&gt; Saturday var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; // Variable to Convert getDay() to text var dayOfWeek = getDay(); document.getElementById("open").innerHTML = "OPEN " + days[dayOfWeek] + " FROM " + days[dayOfWeek]; and &lt;p id="open"&gt;&lt;/p&gt;
accepted answer: http://stackoverflow.com/a/27831967
has comment: http://stackoverflow.com/comment/44069824
has answer: http://stackoverflow.com/a/27832012
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27831967

http://stackoverflow.com/comment/108412102
has text: This in fact doesn't answer the question ...nvm alias .. sets the node/npm version that will be available as a command, but it's not setting the $NODE_PATH variable, which is needed by some applications to work correctly :/
comment on: http://stackoverflow.com/a/34777308
type: Comment
type: AnswerComment
score: 2

http://stackoverflow.com/comment/44072480
comment on: http://stackoverflow.com/a/27830507
type: Comment
score: 1
type: AnswerComment
has text: In jQuery the differences are that; (a) .then() accepts two callbacks - success and error, (b) .then() possesses "filtering power" - the callbacks' return values get passed on down the promise chain in the form of a new promise, whereas done ignores any return value and passes on its input promise in exactly the same state. (In promises/A+ implementations, .done() has a distinctly different meaning from that of jQuery's .done()). I tend not to use jQuery's .done() - it's a bit of a "rebel without a cause".

http://stackoverflow.com/comment/44044274
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27818794
has text: what is the values of rec and arr on client side?

http://stackoverflow.com/comment/44102122
comment on: http://stackoverflow.com/q/27849064
has text: Have you considered [6to5](https://6to5.org/)? I prefer it over traceur. I have not used this particular thing, but [check out this snippet](http://es6.zloirock.ru/#class%20C%20%7B%0A%20%20private%20A%2C%20B%0A%20%20constructor(a%2Cb)%7B%0A%20%20%20%20this%3A%3AA%20%3D%20a%3B%0A%20%20%20%20this%3A%3AB%20%3D%20b%3B%0A%20%20%7D%0A%20%20log()%7B%0A%20%20%20%20log(this%3A%3AA%20%2B%20this%3A%3AB)%3B%0A%20%20%7D%0A%7D%0A%0Anew%20C(42%2C%2021).log()%3B)
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/a/27927999
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27927677
has comment: http://stackoverflow.com/comment/44259533
has comment: http://stackoverflow.com/comment/44259783
has comment: http://stackoverflow.com/comment/44261654
has body: Set the background to your image and add the following to your css: background-image: url("YOUR_IMAGE_PATH_HERE"); background-size: cover; background-position: center center; See JSFiddle
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27927677

http://stackoverflow.com/q/27805387
has comment: http://stackoverflow.com/comment/44019847
has comment: http://stackoverflow.com/comment/44019764
type: Question
has title: childnodes from read XML not working inside JQuery calls?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44021565
has comment: http://stackoverflow.com/comment/44021079
score: 0
has comment: http://stackoverflow.com/comment/44021606
has comment: http://stackoverflow.com/comment/44021208
tagged with: http://stackoverflow.com/tag/xml
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44021642
has body: I read an XML I got from an API, I do this call: titol=datax.getElementsByTagName("title"); Now I have all the titles from the XML, then I need to pass this information inside a getJSON call which I call once per title, so like this: llargada=datax.getElementsByTagName("title").length; for(y=0; y&lt;llargada; y++){ $.getJSON("http://bla bla bla", function(data) { console.log("titls: "+titol[y].childNodes[0].nodeValue); }); } But I get this error: Uncaught TypeError: Cannot read property 'childNodes' of undefined I'm using jquery.min.js if relevant...

http://stackoverflow.com/q/27921856
score: 0
answer count: 2
tagged with: javascript
tagged with: angularjs
type: UnansweredQuestion
has body: im trying to execute the function below that has angular js code in it. function updateData() { var crudApp = angular.module("crudTest", []); crudApp.service("editData", function() { var editArray = ["BLAUS", "Blauer See Delikatessen", "Hanna Moos", "Sales Representative", "Forsterstr. 57", "Mannheim", ""]; return { editArrayy : editArray }; }); crudApp.controller = ("modalContent", function($scope) { $scope.inputs = editData.editArrayy; }); } however the error is as below: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.8/$injector/modulerr?p0=crudTest&amp;p1=Error%3…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.8%2Fangular.min.js%3A17%3A350) html structure is: &lt;html ng-app="crudTest"&gt; &lt;body&gt; &lt;div class="modal fade"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt; &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt; &lt;/button&gt; &lt;h4 class="modal-title"&gt;Edit Customer&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body" ng-controller="modalContent"&gt; &lt;form ng-repeat="input in inputs"&gt; &lt;span&gt;Customer ID&lt;/span&gt; &lt;input type="text" value={{input}} /&gt; &lt;/form&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; &lt;/body&gt; &lt;/html&gt;
has answer: http://stackoverflow.com/a/27922022
has answer: http://stackoverflow.com/a/27921978
has title: executing angular js in a function
type: Question

http://stackoverflow.com/comment/45300008
comment on: http://stackoverflow.com/q/27851345
score: 0
type: Comment
type: QuestionComment
has text: @JohnS: Yes, just what I say: a completely different thing. Btw, ES6 will have a `super` keyword as well

http://stackoverflow.com/a/27885577
answers question: http://stackoverflow.com/q/27885556
type: Answer
score: 2
has body: i was wondering why do we need to use anonymous function to make it work? Because you have to give the browser / engine something that can be executed when the event happens. Functions allow you to do that. Note: The function doesn't have to be anonymous, it can also be named: function handler() { // handler code here } document.getElementById('target').onclick = handler; cant we run the code without it? No (at least not on click).
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27885556
upvote count: 2

http://stackoverflow.com/comment/44316346
type: Comment
comment on: http://stackoverflow.com/a/27961195
type: AnswerComment
has text: @AtoxEl-madani - Extend it how? There doesn't seem to be anything else left to say.
score: 0

http://stackoverflow.com/comment/78384964
score: 2
type: Comment
has text: @yuji To not make it too messy one can do: `component={(props) => (<Comments {...props} myProp="value" />)}` to maintain the injected props
comment on: http://stackoverflow.com/a/39027174
type: AnswerComment

http://stackoverflow.com/comment/44189536
type: Comment
has text: it appears to be working in that fiddle you posted. Is it not? I see the content blocks changing when i click
comment on: http://stackoverflow.com/q/27894063
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44158877
comment on: http://stackoverflow.com/a/27878603
type: AnswerComment
has text: You were on the right track. The problem that you had is AFTER you found the correct rectangle, you were looping over all the rectangles again and clearing them all. Since you have already found the right rectangle once your enter the if statement, all you need to do is clear it. Make since?
type: Comment
score: 1

http://stackoverflow.com/a/27931370
score: 6
answers question: http://stackoverflow.com/q/27931162
has body: In JavaScript building an associative array* or hash map or object may not be terribly obvious. For one, everything is ultimately an object and so the syntax used with associative arrays is valid on everything that isn't an "associate array" which is probably where the confusion arises. First let's address the issue at hand. You probably wanted to use an object instead of an array: arrSummat = {}; arrSummat["987"] = "Boat"; console.log(JSON.stringify(arrSummat)); // => {"987":"Boat"} When running your fiddle (in Chrome) I pretty much get an array with 986 null values and then "Boat" (I may be wrong, I'm not hand counting the nulls in that alert). Now that you're original question is resolved I'd like to point out two things you may want to start doing differently: Prefer shorthand syntax for objects and arrays. The two examples are functionally the same but you should prefer the second for most purposes. var myArr = new Array(); var myObj = new Object(); Is the same as: var myArr = []; var myObj = {}; The shorthand can even come with some basic values: var myArr = [1, 2, 3]; var myObj = {one: "1", two: "2"}; Secondly, never use an Array object as anything other than an array. It is syntactically valid to do so but it will produce unexpected results (as you have seen here). There is no "associative array" in JavaScript, but Objects are commonly used as a substitute and provide similar functionality. Revised jsFiddle Link
type: AcceptedAnswer
upvote count: 6
type: Answer
has comment: http://stackoverflow.com/comment/44260801
accepted answer of: http://stackoverflow.com/q/27931162
downvote count: 0
has comment: http://stackoverflow.com/comment/44260612

http://stackoverflow.com/a/27871332
answers question: http://stackoverflow.com/q/27871292
downvote count: 0
has comment: http://stackoverflow.com/comment/44145228
score: 1
accepted answer of: http://stackoverflow.com/q/27871292
upvote count: 1
type: AcceptedAnswer
has body: It doesn't need to be recursive (I'm not sure you understand what that means), you just need to loop on the elements in where: function select(data, where) { return data.filter(function(e) { var k = Object.keys(where); return k.every(function(key) { return e[key] == where[key]; }); }) } var data = [ {a:'aaa',b:'bbb',c:'ccc',d:'ddd',e:'eee'}, {a:'aaa',b:'bbb',c:'ccc',d:'eee',e:'fff'}, {a:'xxx',b:'bbb',c:'ccc',d:'ddd',e:'fff'} ] var where = {a:'aaa',b:'bbb'} console.log(select(data,where));
type: Answer

http://stackoverflow.com/comment/44029589
score: 3
has text: Like this `contentEditable` attribute. Learned something new today!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27810327

http://stackoverflow.com/comment/44117394
type: Comment
comment on: http://stackoverflow.com/a/27857174
has text: `Uncaught TypeError: Cannot read property 'offsetHeight' of undefinedpage1c.html?ckcachecontrol=1420794955:62 getHeightpage1c.html?ckcachecontrol=1420794955:65 (anonymous function)`
type: AnswerComment
score: 0

http://stackoverflow.com/q/27946549
type: Question
accepted answer: http://stackoverflow.com/a/28290868
tagged with: kendo-datasource
has title: Kendo - Change DataSource onclick
has body: I have a question about changing the datasource in Kendo. Currently my dataSource and Kendo List View looks something like below: var DSOne = new kendo.data.DataSource({ dataType: 'json', transport: { read: { url: DS_URL_1, type: "GET", xhrFields: { withCredentials: true }, crossDomain: true } }, pageSize: 9, serverPaging: false }); var DSTwo = new kendo.data.DataSource({ dataType: 'json', transport: { read: { url: DS_URL_2, type: "GET", xhrFields: { withCredentials: true }, crossDomain: true } }, pageSize: 9, serverPaging: false }); var viewModel = kendo.observable({ apps: DSOne }); kendo.bind(jQuery('#listViewID'), viewModel); $("#pager").kendoPager({ dataSource: DSOne }); And what I want to be able to is when I click on a button to change the dataSource for the viewModel and the pager so that new data loads into #listViewID
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: kendo-ui
tagged with: kendo-listview
has answer: http://stackoverflow.com/a/28290868
upvote count: 1
type: AnsweredQuestion
score: 1

http://stackoverflow.com/a/27943617
has comment: http://stackoverflow.com/comment/44282783
answers question: http://stackoverflow.com/q/27941460
accepted answer of: http://stackoverflow.com/q/27941460
type: AcceptedAnswer
has body: The problem is that $scope is not shared between your controllers. Start by only having one Controller, so $scope is shared as you expect. Changing your ExampleController to this: var app = angular.module("switchExample", []); app.controller("ExampleController", ["$scope", function($scope) { $scope.selection ="settings"; $scope.signIn = function() { alert("click"); $scope.selection ="project"; } }]); ... and deleting the other Controller and the references to the unused Controllers in the HTML will display 'hello' when you click 'Login'
downvote count: 0
score: 3
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/44282691

http://stackoverflow.com/comment/44320715
type: Comment
has text: finally i got solution this not possible at all
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27962352

http://stackoverflow.com/q/27961116
has comment: http://stackoverflow.com/comment/44316806
has body: I am trying run a function after local storage gets radio selection based on a value a, b , c, d so if a is check run switch statement one function if b run switch 22 ect..Is this possible?? &lt;form&gt; &lt;input type="number" name="abcd" id="abcd"&gt; &lt;input type="radio" name="radio" value="a" onclick="example('one')"&gt; &lt;input type="radio" name="radio" value="b" onclick="example('two')"&gt; &lt;input type="radio" name="radio" value="c" onclick="example('three')"&gt; &lt;/form&gt; &lt;script&gt; function example(test) { var abcd = document.getElementById('abcd').value; switch (test) { case "one": exp_one = abcd + 5; break; case "two": exp_two = abcd + 10; break; case "three": exp_three = abcd + 15; } } &lt;/script&gt;
answer count: 1
type: AnsweredQuestion
has title: Onload check radio button value and run function
has comment: http://stackoverflow.com/comment/44317014
type: Question
has comment: http://stackoverflow.com/comment/44316850
has comment: http://stackoverflow.com/comment/44340655
has answer: http://stackoverflow.com/a/28086556
accepted answer: http://stackoverflow.com/a/28086556
has comment: http://stackoverflow.com/comment/44315827
tagged with: javascript
score: 0

http://stackoverflow.com/a/27977422
has body: I want to post my solution, for others struggling with the badly documented API of moment.js... To create a time zone, you will have to create an unpacked timezone object: var unpacked = { name : 'Asia/Bangkok', abbrs : ['ICT'], untils : [null], offsets : [-420] }; *Note that while ITC is UTC+7 the UTC offset in the array has to be the additive inverse (negative) of 7*60 = 420 for some reason.* Before you can use it, you will also have to pack this object, and for that you need to include moment-timezone-utils.js var packed = moment.tz.pack(unpacked); It will spit out the packed timezone format partly encoded in Base 60: Asia/Bangkok|ICT|-70|0| Now it can be added: moment.tz.add('Asia/Bangkok|ICT|-70|0|'); If you don't want to go through all this trouble, there is also a pre-packed file on GitHub, where you can pick the needed timezone.
accepted answer of: http://stackoverflow.com/q/27956436
score: 15
answers question: http://stackoverflow.com/q/27956436
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/85488095
upvote count: 15
has comment: http://stackoverflow.com/comment/109020347

http://stackoverflow.com/q/27839006
tagged with: node.js
has answer: http://stackoverflow.com/a/27840153
type: Question
has title: Variable works but undefined further down the code block
type: AnsweredQuestion
tagged with: mongodb
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27840153
has body: I have a function that inserts (frozen) JSON objects into a MongoDB: var result = null, OID = null ; ... var test = dbHandle.collection('TestItems') ; result = prepareObject() ; test.insert(result, {w:1}, function(err, item) { if (err) throw err ; OID = ObjectID(item[0]._id) ; test.update({_id: OID}, {$set: { userName: socket.userName, state: 'Ready'} }, {w:1}, function( err ) { if (err) throw err ; test.findOne({ _id: OID }, function (err, loaded) { if (err) throw err ; socket.emit('newData', { data: loaded }) ; }); }) ; }) ; This code works as I would expect. However, further down in my code I need to make use of both the OID and result object but they are always undefined. I know I must be doing something wrong but I do not know what. My background is in C++ and my approach makes sense to me, but this is my first venture into JavaScript / NodeJS / MongoDB. I would be obliged if someone could point me in the right direction please. As an example, when I later try to create a new object: var myObj = {Title: result.Title, TID: OID, Stuff:'More Stuff Here'} ; When this object is inserted in to the MongoDB both the Title and TID values are 'undefined', but my TestItems collection is correctly updated implying that OID has a value! Is this some form of Scope issue? I can't see how as the declarations, assignments and use are all in the same closure.
score: 0

http://stackoverflow.com/comment/55893012
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28095214
has text: what is info and how is it populated?
score: 2

http://stackoverflow.com/q/27946797
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27947334
has answer: http://stackoverflow.com/a/27947526
type: Question
has title: Node.js "Error: Can not find module"
has comment: http://stackoverflow.com/comment/44288907
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44288663
possible better answer: http://stackoverflow.com/a/27947526
score: 0
answer count: 2
tagged with: javascript
has body: I am doing the node.js lesson from lynda.com and am unable to find what is causing the "Error: Can not find module". From everything I can tell the package.json has the flight module in it. Everything has been working so far so I know node.js is installed and running correctly. The way I am running this file is by typing "node app.js" at the command line. Also all of the files are in the same folder. Here is the console log: C:\Users\Jonathan\Desktop\flight&gt;node app.js module.js:340 throw err; ^ Error: Cannot find module './flight' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.&lt;anonymous&gt; (C:\Users\Jonathan\Desktop\flight\app.js:1:76) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) C:\Users\Jonathan\Desktop\flight&gt; Here is the code. Package.json file { "name": "flight", "version": "1.0.0", "description": "a module for keeping track of a flight", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" &amp;&amp; exit 1" }, "author": "JBaxter", "license": "ISC" } index.js file var number, origin, destination; exports.setNumber = function (num){ number = num; }; exports.setOrigin = function (o){ origin = o; }; exports.setDestination = function (d){ destination = d; }; exports.getInfo = function() { return { number: number, origin: origin, destination: destination }; }; app.js file var flight = require('./flight'); flight.setOrgin('LAX'); flight.setDestination('DCA'); flight.setNumber(462); console.log(flight.getInfo()); Any help with be great. I thought the name within the package.json file was your module but maybe I am incorrect. Thanks in advance.
has answer: http://stackoverflow.com/a/27947334
has comment: http://stackoverflow.com/comment/44288738
tagged with: node.js

http://stackoverflow.com/comment/44143181
type: QuestionComment
score: 2
has text: You could try .splice instead of push to add/remove (basically replace) an item in the array.
comment on: http://stackoverflow.com/q/27870251
type: Comment

http://stackoverflow.com/comment/44176182
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27887444
has text: I tried with complete event at first as You can see in the code, but didn't get expected result. After adding async: false, no change, alert("test"), always pops up before row is added.

http://stackoverflow.com/comment/44170000
has text: So if the first date is "Sunday, 11 January 2015" The next month should be "Sunday, 1 February 2015"? Not 8 Feb right? If yes so I got it, it can be done via date object too, I will edit my answer.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27883816

http://stackoverflow.com/a/27842769
has body: the geometry of a places-result contains 2 properties, the viewport(I guess that's what you use to zoom to the bounds) and also a location-property. This location-property usually will be a point inside the country(when you search for a country), you may use it to draw the marker.
type: Answer
has comment: http://stackoverflow.com/comment/44104636
answers question: http://stackoverflow.com/q/27841664
accepted answer of: http://stackoverflow.com/q/27841664
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44115413

http://stackoverflow.com/q/27871428
score: 0
has body: I'm using a datepicker inside my directive to allow user to pick the date. I have disabled the textbox so as to force the user to only change the date using the datepicker widget. The directive is given below: function InformationDirective(){ return { restrict: 'A', link: function (scope, element, attrs, ngModelCtrl) { var date = document.getElementById('reqDate'); $(date).datepicker($.extend({ dateFormat: 'm/d/y' } )); $("#calTrigger-btn").click(function(){ $(date).datepicker("show"); }); } }; } The HTML is as below: &lt;div information-directive&gt; &lt;input id="reqDate" ng-model="date" type="text" value="{{reqDate}}" disabled/&gt; &lt;div type="button" id="calTrigger-btn"&gt; &lt;img id="calendar-img" src="css\images\calendar.gif"&gt;&lt;/img&gt; &lt;/div&gt; &lt;/div&gt; For some reason my datepicker will only allow me to pick the date once, after the that the button won't launch the widget again. the $("#calTrigger-btn").click(function() is being called every time I click the button but the widget won't be called after the first selection. The directive and everything are being added to the html, the only problem is that I can't use the datepicker after picking the date once. I am using Jquery-ui-1.8.15 and will not be able to change it to a new one. I wanted to know whether there is any way I can resolve this problem. Any help provided is appreciated. Thank you.
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: datepicker
has answer: http://stackoverflow.com/a/27871638
type: Question
has title: Jquery datepicker won't allow to change date on a disabled textbox.
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/44145790
tagged with: javascript

http://stackoverflow.com/a/27882690
has comment: http://stackoverflow.com/comment/44187195
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27882339
upvote count: 1
has body: The line: removeButton.onclick = 'removeItem(this)'; simply assigns a string to the onclick property, you need to assign a function reference so: removeButton.onclick = removeItem; Then in the removeItem function, this will be the button: function removeItem() { var r = this; var i = r.parentNode.parentNode.rowIndex; // button -&gt; cell -&gt; row document.getElementById(&amp;quot;shoppingBasketTblBody&amp;quot;).deleteRow(i); } You may find it easier to remove the button using: var row = this.parentNode.parentNode; row.parentNode.removeChild(row); to remove the dependency on getElementById. You're still tied to the DOM structure though.
has comment: http://stackoverflow.com/comment/44177893
type: Answer

http://stackoverflow.com/comment/44109917
type: Comment
score: 0
has text: Thanks for the effort in your answer! I'm gonna go about doing it another way, but I learned some new things from reading your code. Thanks again!
type: AnswerComment
comment on: http://stackoverflow.com/a/27852071

http://stackoverflow.com/a/27944899
score: 0
has comment: http://stackoverflow.com/comment/44285255
upvote count: 1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27944600
has body: in JS you can try the following, var isMobile = { Android: function() { return /Android/i.test(navigator.userAgent); }, BlackBerry: function() { return /BlackBerry/i.test(navigator.userAgent); }, iOS: function() { return /iPhone|iPad|iPod/i.test(navigator.userAgent); }, Windows: function() { return /IEMobile/i.test(navigator.userAgent); }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows()); } };

http://stackoverflow.com/q/27947445
type: AnsweredQuestion
score: 1
answer count: 6
type: Question
accepted answer: http://stackoverflow.com/a/27947593
has answer: http://stackoverflow.com/a/27947696
has answer: http://stackoverflow.com/a/27947511
downvote count: 0
has body: I need your help. Using pure javascript and not jQuery, how do you find out if an element contains more than 1 classname. ie. if (#test has the classname = "classA and classB" then { alert(true) } else { alert(false) } HTML: &lt;input type="text" id="test" "class="classA classB"&gt;
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27947762
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27947659
possible better answer: http://stackoverflow.com/a/27947501
has answer: http://stackoverflow.com/a/27947501
has answer: http://stackoverflow.com/a/27947593
has title: Checking to find out if an element contains more than 1 classname
upvote count: 1
has comment: http://stackoverflow.com/comment/44289851

http://stackoverflow.com/comment/44302715
score: 0
type: Comment
type: QuestionComment
has text: A quick look at the console gives the break point at your `if` statement. One of my first hard lessons when learning javascript is that errors are silent and must be looked up. Although you may not like it in the beginning you learn very much from just looking at the console.
comment on: http://stackoverflow.com/q/27953702

http://stackoverflow.com/comment/44288907
type: Comment
type: QuestionComment
has text: Path `./flight'` points to `C:\Users\Jonathan\Desktop\flight\flight`.
comment on: http://stackoverflow.com/q/27946797
score: 0

http://stackoverflow.com/a/27901031
upvote count: 1
has body: Updated answer that returns the value of the most recently focused div or input following a button click: $(document).on('click', '#btn', function () { var focusExist = $(".focus").length; if (focusExist) { $focus = $(".focus"); if ($focus.hasClass("tab_common")) { var tabValue = $focus.text(); alert(tabValue); } else { var inputValue = $focus.val(); alert(inputValue); } } }); $(document).on('focus', '.tab_addclass', function () { $(".focus").removeClass("focus"); $(this).addClass("focus"); }); Updated Fiddle
has comment: http://stackoverflow.com/comment/44202715
answers question: http://stackoverflow.com/q/27900717
downvote count: 0
has comment: http://stackoverflow.com/comment/44202588
accepted answer of: http://stackoverflow.com/q/27900717
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44202763
score: 1
has comment: http://stackoverflow.com/comment/44202349
type: Answer
has comment: http://stackoverflow.com/comment/44201670

http://stackoverflow.com/comment/44412886
comment on: http://stackoverflow.com/q/27843189
has text: The scope in the `for` loop is not really a separate execution context. My guess is that the variables inside the `for` loop are initialized before the loop has begun, and before `x` has any value, hence they initialize to `undefined`. When you refactored it into a separate function you set straight the order of initialization. I don't know why only Mac exhibits this behavior, though
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27918051
has comment: http://stackoverflow.com/comment/44235563
favorite count: 0
has title: DataTables.net table column sum in footer
accepted answer: http://stackoverflow.com/a/30075650
has comment: http://stackoverflow.com/comment/44234224
possible better answer: http://stackoverflow.com/a/38951624
has answer: http://stackoverflow.com/a/38951624
score: 14
type: AnsweredQuestion
upvote count: 14
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/30075650
has body: I'm having issues with a tiny detail in inserting the sum value of each column, with class "sum", into its footer. The code (more or less taken straight from DataTables.net) goes: var table = $('#example').DataTable(); table.columns('.sum').each(function (el) { var sum = table .column(el) .data() .reduce(function (a, b) { return parseInt(a, 10) + parseInt(b, 10); }); $(el).html('Sum: ' + sum); }); "sum" has the correct value but is somehow not inserted into the footer! I.e. its -element shows up empty. Note that the snippet below works fine, but I want to sum each column with class sum. var table = $('#example').DataTable(); var column = table.column(4); $(column.footer()).html( column.data().reduce(function (a, b) { return parseInt(a, 10) + parseInt(b, 10); }) ); //////////////////////////////////////////////////////////////////////////////////// EDIT - Workaround: I moved the code to where the DataTable is initialized and went with footerCallback instead. See below code: "footerCallback": function (row, data, start, end, display) { var api = this.api(), data; // Remove the formatting to get integer data for summation var intVal = function (i) { return typeof i === 'string' ? i.replace(/[\$,]/g, '') * 1 : typeof i === 'number' ? i : 0; }; // Total over this page pageTotal = api .column('.sum', { page: 'current' }) .data() .reduce(function (a, b) { return intVal(a) + intVal(b); }, 0); // Update footer $(api.column('.sum').footer()).html(pageTotal); } Somehow now the value is inserted into the right tfoot element. Still no idea why it wouldn't work in the first place (but as mentioned in comment order of including JS-files could have had to do with some of it). Now I just have to figure out how to loop multiple columns with class="sum"...
has comment: http://stackoverflow.com/comment/44240406
tagged with: datatables
downvote count: 0
linked to: http://stackoverflow.com/q/26165263

http://stackoverflow.com/a/40858869
answers question: http://stackoverflow.com/q/27853253
type: Answer
score: 7
has body: As of r81, EdgesHelper has been deprecated in favor of: // edges geometry var geometry = new THREE.EdgesGeometry( mesh.geometry ); // or WireframeGeometry var material = new THREE.LineBasicMaterial( { color: 0xffff00, linewidth: 2 } ); var edges = new THREE.LineSegments( geometry, material ); mesh.add( edges ); // add wireframe as a child of the parent mesh See the issue on Github
upvote count: 7
downvote count: 0

http://stackoverflow.com/a/27850268
answers question: http://stackoverflow.com/q/27850191
has body: JavaScript variables and changes to the DOM do not persist across pages or across page refreshes. You can use server-side coding to create and maintain a session for the user. Alternatively, you can store the background color information in a cookie or in local storage. When each page loads, check the value of the cookie or local storage item and apply the background color accordingly. See: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API https://developer.mozilla.org/en-US/docs/Web/API/document.cookie For example, if you create and set a backgroundColor key on the window.localStorage object on the first page, you can do this on the second page to apply the background color when the DOM is loaded: document.addEventListener("DOMContentLoaded", function(event) { document.getELementById('day-night').style.backgroundColor=window.localStorage['backgroundColor']; });
downvote count: 0
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44105096
upvote count: 2

http://stackoverflow.com/comment/44224062
type: AnswerComment
comment on: http://stackoverflow.com/a/27911862
type: Comment
has text: Thanks for the reply. I've decided to go with step 1, although I'm going to pull the data myself so I can display it in different ways. Now I'm trying to implement sign in by calling `gapi.auth.signIn({...})` but the sign in window opens and immediately closes, then returns an `immediate_failed` error. Any thoughts on this?
score: 0

http://stackoverflow.com/comment/44311202
type: AnswerComment
score: 0
type: Comment
has text: I was just explaining he can put it into directive by transclude but definately "NO" for intro.htm.
comment on: http://stackoverflow.com/a/27958513

http://stackoverflow.com/q/27879706
type: Question
tagged with: arcgis-js-api
answer count: 1
has answer: http://stackoverflow.com/a/27881154
has comment: http://stackoverflow.com/comment/44163453
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27881154
tagged with: http://stackoverflow.com/tag/html
has body: This is probably a simple question but I just started with Dojo/Javascript and I don't know what I'm doing wrong. I started creating my Dojo application in a programmatically way and all I want to know is how to properly align widgets (in my case they are a Toggle Button and a Dropdown Button) in the center pane one next to each other and with the right spacing between them (the center pane contains a map and I want those buttons peacefully lying on it without covering/limiting its space with another panel). I'd like to have the "Maps" Dropdown Button right next to the "Legend/Layers" Toggle Button aligned to it and rightly spaced. When I specify the region (in my case the one where the map is with id="mapDiv") creating them, they miserly overlap one on top of the other but that's the region I want them to be..just one next to each other. I know this might sound a GIS/Mapping question but I think it's more stright Dojo/Javascript (CSS/HTML?) related and that's why I'm asking it here. I set up this fiddle code to show you what I mean Thanks in advance for your help, m
has comment: http://stackoverflow.com/comment/44162333
tagged with: css
score: 0
has title: Align a Button and a Dropdown Button in the Center Pane
tagged with: dojo
type: AnsweredQuestion

http://stackoverflow.com/comment/44202337
comment on: http://stackoverflow.com/a/27901425
type: Comment
has text: This allows spaces before commas (which is worse) :)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44229412
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27915207
has text: what do you mean by an anchor?

http://stackoverflow.com/comment/44092440
comment on: http://stackoverflow.com/q/27844304
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [JavaScript - controlling the insertion point for document.write](http://stackoverflow.com/questions/1536970/javascript-controlling-the-insertion-point-for-document-write)

http://stackoverflow.com/comment/130602239
type: Comment
type: QuestionComment
has text: The linux 'tree' command can generate a HTML directory listing... `tree -H '.' -T "Listing" -L 1 --noreport --charset utf-8 > listing.html`
comment on: http://stackoverflow.com/q/27860507
score: 0

http://stackoverflow.com/a/27835449
type: Answer
answers question: http://stackoverflow.com/q/27835396
has comment: http://stackoverflow.com/comment/44075702
has comment: http://stackoverflow.com/comment/44079854
has comment: http://stackoverflow.com/comment/44080214
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44079092
has comment: http://stackoverflow.com/comment/44075792
downvote count: 0
has comment: http://stackoverflow.com/comment/44075834
has body: This is simple redirection based on $user var: Header("Location: http://mypage.com/".$user);

http://stackoverflow.com/comment/44265892
has text: I have tried the siblings. But it has problem. When i click the `anothermenu`, the css class on `menu or menu1 or menu2` will not be removed.
comment on: http://stackoverflow.com/a/27923263
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44233223
type: QuestionComment
comment on: http://stackoverflow.com/q/27917168
type: Comment
has text: i think i need to configure my web service somehow to access the Page but how :(
score: 0

http://stackoverflow.com/comment/44257340
comment on: http://stackoverflow.com/q/27920379
has text: Thanks Lanny, I have made a combined version of the same, but not sure i m getting some errors!!), Namespace issues?Not sure. As i have exported the using flash. Here is URL http://sm-apps.com/agevent/index-en-combined-1.html
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44250014
has text: First idea doesn't work. The 2nd one is not applicable because class can be tick_16, err_16, warn_16.
score: 0
comment on: http://stackoverflow.com/a/27925881
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44037774
has text: @RobG And JavaScript may not be "most languages", but even in JavaScript it's not typical to `delete` and re-add properties from objects to indicate that the property does or does not have a value. In a data structure, such as a binary search tree, the data objects are defined to have certain properties, and sometimes those properties are null to indicate that they don't have a value. If your design relies heavily on the distinction between `if('value' in object)` and `if(object.value)`, then you are setting yourself up for trouble.
score: 0
comment on: http://stackoverflow.com/q/27812367
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27843648
has body: I'm working on a shopping cart site and trying to make the search results responsive. Anything lower than a desktop resolution I would like the results to be as many items as can fit across (in most cases 3) and I want them to be centered, all the way down to a phone. The issue that I am running into is that I can not seem to get the parent div to be the same width as its children, nor can I center it. I have tried display: inline-block and that gives dimensions to the div, but it takes up 100% of the width. Here is an example of what I am running in to: http://jsfiddle.net/0jnjum30/1/ Has anyone accomplished anything like this before? If at all possible I would like to do this entirely in CSS.
type: Question
tagged with: javascript
tagged with: e-commerce
tagged with: http://stackoverflow.com/tag/html
has title: How to "shrink wrap" a div around it's floated children
downvote count: 0
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27844055
upvote count: 2
tagged with: css
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27844055

http://stackoverflow.com/comment/44253128
comment on: http://stackoverflow.com/q/27927351
score: 0
type: Comment
type: QuestionComment
has text: SOLVED: just use cmd as admin.

http://stackoverflow.com/q/27805618
accepted answer: http://stackoverflow.com/a/27805727
type: AnsweredQuestion
downvote count: 1
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
score: -1
has title: How to hide/show a div using Javascript for input validation
has body: As you can see the above warning will be only shown when there is an error while inserting the data into the login form. Now I have tried to achieve it by: Hiding the div say "warning". Use a javascript while submitting the form to check for input validation. If found any error, the hidden div "warning" will show above the form as shown as in the image. does it has something to do with visibility: hidden; I have tried it in http://jsfiddle.net/w2udrm3q/ Ples help
has answer: http://stackoverflow.com/a/27805727
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27805731
favorite count: 0
has answer: http://stackoverflow.com/a/27805731
has comment: http://stackoverflow.com/comment/44020381
has comment: http://stackoverflow.com/comment/44020131
tagged with: css
has comment: http://stackoverflow.com/comment/44020120

http://stackoverflow.com/q/27914200
has answer: http://stackoverflow.com/a/27914354
has body: This is my very first time coding with jquery from scratch, which is an immense improvement from a few weeks ago. If the answer is completely obvious, I apologize; I did search pretty thoroughly, but either I couldn't find what I needed or I just didn't word it right. In this description bar, what I'd like to happen is for the small text to slide up, then for the big text to slide down, which I've sort of forced by adding a delay. When you click the button again, I'd like for the opposite reaction to happen--for the big text to slide up, and then the small text slide down. However, what's happening is that the small text appears again before the big text disappears--which makes sense, considering the delay I've added, but it's not what I'd like to happen. Is there anything I could change for the opposite reaction to happen every time the description is toggled, or am I sort of stuck with the forced option? Here is my script: $(document).ready(function(){ $(".followme").click(function(){ $(".astrology").delay(1000).slideToggle(1000); $(".desc").slideToggle(1000); $(this).text( $(this).text() == '- less' ? "+ more" : "- less"); }); }); And the ever helpful jsfiddle. Thank you for taking the time to read, I greatly appreciate it!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27914242
type: Question
tagged with: javascript
tagged with: jquery
has title: Reverse Delay in jquery
accepted answer: http://stackoverflow.com/a/27914242
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27914354

http://stackoverflow.com/comment/44219374
type: QuestionComment
has text: cross domain problem? js from parent page cannot target child iframe directly without it being from same domain.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27909720

http://stackoverflow.com/comment/44149380
comment on: http://stackoverflow.com/a/27873044
type: AnswerComment
score: 0
type: Comment
has text: but this will hide the inner elements aslo, can you eloborate more?

http://stackoverflow.com/comment/77009146
comment on: http://stackoverflow.com/a/28482039
score: 0
type: AnswerComment
has text: Thank you rd_rscan. Can you used it in both IOS and Android devices? The most importing question is: is it working properly?
type: Comment

http://stackoverflow.com/a/27921954
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/27920314
score: 7
has body: Source: http://fullcalendar.io/docs/event_data/addEventSource/ You can dynamically add an event source. An Event Source is an url which can for example return json data. Maybe it might be sufficient for you to fire the refetch event after you changed the event data. .fullCalendar( 'refetchEvents' ) Source: http://fullcalendar.io/docs/event_data/refetchEvents/
upvote count: 8

http://stackoverflow.com/q/27851115
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27851183
tagged with: twitter-bootstrap
type: AnsweredQuestion
has body: I currently have a function that will automatically scroll to the active option in a bootstrap multiselect dropdown list. However, I have been unable to modify my code to work with a variable number of dropdowns at the same time. My problem lies in creating multiple functions, or having a single function be capable of do this. $(document).ready(function () { var $dropdowns = $('fieldset').find("button.multiselect"); //Find all the dropdowns console.log($dropdowns); //Show the ones that have been found $.each($dropdowns, function (i) { //Just get the index of each console.log(i); //Show index myFunction(i); //Create n different .click functions (each with their own globals) }); function myFunction(index) { var not_found = true; var jump_to = 0; var temp = -1; //Recursively find scrolling value in pixels, then move. //This works for a single dropdown. $('button.multiselect:eq(index)').click(function () { if (not_found == true) { $('.multiselect:eq(index)').dropdown('toggle'); temp = $('ul.multiselect-container:eq(index) li.active').position().top; $('.multiselect:eq(index)').dropdown('toggle'); if (temp &gt; jump_to) { jump_to = temp; not_found = false; } else if (temp &lt;= jump_to) { $("button.multiselect:eq(index)").click(); } } console.log($('ul.multiselect-container:eq(index) li.active').text()); $('ul.multiselect-container:eq(index)').animate({scrollTop: jump_to}, 750); //Scroll to active element }) } }); I'm not sure if I should be using some trickery with addEventListener().
accepted answer: http://stackoverflow.com/a/27851183
has title: Create dynamic number of click functions
type: Question

http://stackoverflow.com/a/27925231
answers question: http://stackoverflow.com/q/27925144
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44247457
has body: You could try this: $('.my_button').click(function(e) { alert($(this).html())); }); Below, I have a snippet you can run to check it out. $(function(){ // The binding should happen after // the document is ready. $('.my_button').click(function() { alert(alert($(this).html())); }); }); Red: Fire Blue: Water Green: Earth
score: 1
upvote count: 1

http://stackoverflow.com/a/27816069
answers question: http://stackoverflow.com/q/27815992
downvote count: 0
has body: To speed optimize your site try to combine and minify your js files via this website http://jscompress.com/ (I advise you to keep a backup of course) Go to the tab upload javascript files and upload multimuple js files.
type: Answer
upvote count: 2
score: 2

http://stackoverflow.com/comment/44070615
has text: What is `countdown`? Link to random libraries, we do not know them all.
type: Comment
comment on: http://stackoverflow.com/q/27832310
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44228056
has text: The click-me event worked just fine. Which makes things all the much weirder. I then amended the event to try the selector you mentioned, and still no luck: `var itemDue = $('.datepicker').val();`
comment on: http://stackoverflow.com/q/27912428
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44217846
type: Comment
comment on: http://stackoverflow.com/a/27907257
score: 0
type: AnswerComment
has text: for your sample documents I have : { "total" : 5000, "count" : 2, "donateTo" : "Where Most Needed" }

http://stackoverflow.com/comment/44282467
type: QuestionComment
has text: Sure, i added an online link to the project.
score: 0
comment on: http://stackoverflow.com/q/27943403
type: Comment

http://stackoverflow.com/comment/44085286
has text: All right then just `post` to the current url then or why don't you get the response and update the html.
type: Comment
comment on: http://stackoverflow.com/a/27840355
score: 0
type: AnswerComment

http://stackoverflow.com/q/27810789
has answer: http://stackoverflow.com/a/27810853
accepted answer: http://stackoverflow.com/a/27811006
has body: There is probably a simple solution to this, but for some reason I can't seem to find it on the site, or elsewhere on the net. Just trying to produce a sentence of RANDOM LENGTH from an array. Here is an example: var words = ["yes", "ok", "java", "pull my hair out", "sleep"]; Here is the code that I'm currently using to randomize the contents of the array, but it always produces a sentence where every string is used once. I want varying sentence lengths. function fisherYates(words) { var i = words.length, j, tempi, tempj; if ( i == 0 ) return false; while ( --i ) { j = Math.floor( Math.random() * ( i + 1 ) ); tempi = words[i]; tempj = words[j]; words[i] = tempj; words[j] = tempi; } return words; } Suggestions?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44032117
upvote count: 3
has comment: http://stackoverflow.com/comment/44030430
has comment: http://stackoverflow.com/comment/44030415
type: Question
has title: How To Randomize Sentence Length From Array
score: 3
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/44030355
has comment: http://stackoverflow.com/comment/44030421
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/27811006
favorite count: 0
possible better answer: http://stackoverflow.com/a/27810853

http://stackoverflow.com/comment/44174280
comment on: http://stackoverflow.com/q/27886591
has text: you might want to look at [this](http://stackoverflow.com/questions/5203407/javascript-multiple-keys-pressed-at-once).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27864951
possible better answer: http://stackoverflow.com/a/29303324
answer count: 6
has answer: http://stackoverflow.com/a/70443467
has comment: http://stackoverflow.com/comment/44133233
has title: How to access a child's state in React
favorite count: 0
has comment: http://stackoverflow.com/comment/44136567
upvote count: 321
has comment: http://stackoverflow.com/comment/44136478
has comment: http://stackoverflow.com/comment/74868791
has answer: http://stackoverflow.com/a/51192414
has body: I have the following structure: FormEditor - holds multiple instances of FieldEditor FieldEditor - edits a field of the form and saving various values about it in its state When a button is clicked within FormEditor, I want to be able to collect information about the fields from all FieldEditor components, information that's in their state, and have it all within FormEditor. I considered storing the information about the fields outside of FieldEditor's state and put it in FormEditor's state instead. However, that would require FormEditor to listen to each of its FieldEditor components as they change and store their information in its state. Can't I just access the children's state instead? Is it ideal?
has comment: http://stackoverflow.com/comment/57681609
has answer: http://stackoverflow.com/a/29303324
accepted answer: http://stackoverflow.com/a/27875018
downvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24147331
has answer: http://stackoverflow.com/a/27875018
type: Question
tagged with: reactjs
linked to: http://stackoverflow.com/q/32370994
has answer: http://stackoverflow.com/a/61547777
has answer: http://stackoverflow.com/a/60567598
score: 320
tagged with: javascript

http://stackoverflow.com/comment/44214207
type: Comment
type: AnswerComment
has text: LOL!!!!! I cant believe i can do that!!! hahaha.. thanks very muchh!!!!!!!!!!!!!!!!
score: 0
comment on: http://stackoverflow.com/a/27907453

http://stackoverflow.com/q/27848599
tagged with: user-interface
tagged with: javascript
has answer: http://stackoverflow.com/a/27849108
accepted answer: http://stackoverflow.com/a/27848722
score: 0
possible better answer: http://stackoverflow.com/a/27849108
has body: I've been trying for hours to disable a simple javascript button (id="storeButton") in this short script. I have tried every variation in syntax found on the internet to that effect, but to no avail. I am executing this in a wordpress page. Can someone please tell me what is my mistake? The wordpress page: &lt;p style="text-align: center;"&gt;Welcome!&lt;/p&gt; &lt;strong&gt;What is this project, and why contribute?&lt;/strong&gt; text &amp;nbsp; &lt;script src="/scripts/alert.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/webcamjs/webcam.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/scripts/take_snapshot.js" type="text/javascript"&gt;&lt;/script&gt; &lt;div class="centre" id="my_camera" style="width:320px; height:240px;"&gt;&lt;/div&gt; &lt;br&gt; &lt;div id="freezeButton"&gt;&lt;/div&gt; &lt;div id="storeButton"&gt;&lt;/div&gt; &lt;br&gt; &lt;div id="my_result"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; &lt;!-- ShowAlert(); webcamConfigure(); attach(); createFreezeButton(); disableBtn(); createStoreButton(); //--&gt; &lt;/script&gt; take_snapshot.js, where the problem seems to be document.getElementById("storeButton").disabled = true;: function webcamConfigure(){ Webcam.set({ width: 320, height: 240, dest_width: 640, dest_height: 480, image_format: 'jpeg', jpeg_quality: 100, force_flash: true }); } function attach(){ Webcam.attach( '#my_camera' ); } function createStoreButton(){ sendButton = document.createElement("input"); sendButton.type = "button"; sendButton.value = "Send snapshot!"; sendButton.onclick = function store(){ Webcam.snap( function(data_uri) { document.getElementById('my_result').innerHTML = '&lt;img src="'+data_uri+'"/&gt;'; } ); } placeHolder = document.getElementById("storeButton"); placeHolder.appendChild(sendButton); } function disableBtn(){ document.getElementById("storeButton").disabled = true; } function createFreezeButton(){ myButton = document.createElement("input"); myButton.type = "button"; my…
tagged with: wordpress
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27848722
has title: Why can't I disable my button?
type: Question
answer count: 2

http://stackoverflow.com/comment/44124762
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27853491
has text: This wouldn't solve my problem because Amazon s3 has a 5 MB minimum limit. My chunks are about 2 MB in size each. Whether or not I use this method, I still have to combine my chunks into a chunk that's at least 5 MB. Is there a way to combine chunks into a larger chunk or create a buffer out of multiple chunks??

http://stackoverflow.com/q/27904502
has answer: http://stackoverflow.com/a/27905390
tagged with: php
downvote count: 0
score: 1
type: Question
answer count: 2
upvote count: 1
tagged with: arrays
has comment: http://stackoverflow.com/comment/44209008
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How do i actually populate a multiple select box with php returned query, adding into multi dimensional array of jquery?
has comment: http://stackoverflow.com/comment/44208748
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27906637
has body: Sorry for my bad English as I'm not native English speaker. The question is this, I have plan to do a three multiple select box in a single page, how to retrieve the query data before hand when the query in php is executed, individual query loop result will be add into a multidimensional array. 2nd, when the user click on any one of the option on the 1st multiple select box, it will structure the 2nd select box accordingly to the by calling out reference from array, how do i work on this? Lastly, I would like to do this without using ajax. Here's part of my code, Javascript/jquery + php $(document).ready(function(){ var selectValues = { "1" : "General Health", "2": "Head and Neck", "3": "Ear, nose and throat" , "4": "Stomach, bowel and bladder", "5": "Bones and muscles", "6": "Mental Health or confusion", "7": "Pregnancy Problem", "8": "Accident, wound or injury" }; var $cateSymptom = $('#cateSymptom'); var $dropdownSymptom = $("#dropdownSymptom"); $.each(selectValues, function(key, value) { $('#cateSymptom') .append($(" ") .attr("value",key) .text(value)); }); <?php $query = "select a.*, asy.*, s.* from ailment as a join symptom_ailment as asy on a.ailment_id = asy.ailment_id join symptom as s on asy.symptom_id = s.symptom_id"; $result = mysqli_query($conn,$query) or die(mysqli_error($conn)); while($row = mysqli_fetch_assoc($result)) { $sid = $row["symptom_id"]; $sname = $row["symptom_name"]; $stype = $row["stype_id"]; $aname = $row["ailment_name"]; $aid = $row["ailment_id"]; echo " "; ?> var selectValues2 = { "<?php echo $stype; ?>" : { "<?php echo $sname ?>" : [ "<?php echo $aid ?>", "<?php echo $aname; ?>" ] } }; <?php } ?> $cateSymptom.change(function() { alert('1'); $dropdownSymptom.empty().append(function() { alert('2'); var output = ''; console.debug(selectValues2); $.each(selectValues2[$cateSymptom.val()], function(key, value) { alert('3'); output += ' ' + key + ' '; }); return output; }); }).change(); }); HTML: Choose Symptoms Category List of Symptoms Pos…
type: UnansweredQuestion

http://stackoverflow.com/comment/44288811
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27932968
has text: I do not need it ... I only need it when showing the select list. I am also having problems using selectize with validation ... Now I am trying this: https://github.com/machineboy2045/angular-selectize ... But I would prefer to use the select tag then a selectize tag

http://stackoverflow.com/comment/44141262
type: Comment
comment on: http://stackoverflow.com/q/27869088
has text: You don't really need jQuery. You could if you want, but all you really need is some form of JS that will interact with your DB and capable to interact with PHP at the same time. Those fall hand in hand.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44022951
has text: @theTinMan Thank you. I was looking for a way to handle the `,` better. I updated my post with a solution that I find more elegant.
comment on: http://stackoverflow.com/a/27806490
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27946561
score: 1
type: AcceptedAnswer
has body: You shouldn't edit the Control in the renderer anyway. The renderer ist only supposed to write the HTML required to render the Control on the page. The Model Binding is already happening in your controller. As an element in the view your custom control will inherit the model and be able to use it. In the renderer you can just access the property of the control which is going to be set by the model. View: &lt;mvc:View controllerName="view.Calendar" xmlns:mvc="sap.ui.core.mvc" xmlns:c="control" xmlns="sap.m"&gt; &lt;c:TimeCalendar id="calIdView" hoursData="{hours&amp;gt;/time/0/hours}" /&gt; &lt;/mvc:View&gt; Control: sap.ui.unified.Calendar.extend("control.TimeCalendar", { metadata: { properties: { "hoursData": "string" } }, renderer: { renderDays: function (oRm, oCal, oDate) { if (!oDate) { oDate = oCal._getFocusedDate(); } oRm.write("&lt;span class=\"hours\"&gt;"); oRm.write(oCal.getHoursData()); oRm.write("&lt;/span&gt;");
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27945724
type: Answer
answers question: http://stackoverflow.com/q/27945724
downvote count: 0

http://stackoverflow.com/comment/44299666
score: 1
has text: the answer from RichardA works, but is showing the quotes, yours is striping the quotes. which i will click as answered.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27952225

http://stackoverflow.com/comment/58218887
type: Comment
comment on: http://stackoverflow.com/a/27971771
score: 1
type: AnswerComment
has text: Did you discovered how to add attachments via eml file?

http://stackoverflow.com/a/27882726
type: Answer
answers question: http://stackoverflow.com/q/27882702
has body: It would look like this: $(function() { function myFunction() { $('section').on('click', 'div', function(e) { ... }); } $('body').on('load', function() { myFunction(); }); }); Placing the onload listener in the script like this is preferable for several reasons, such as separation of concerns, cleaner markup, etc. That said, your original code does the same job without the body onload property. You don't actually need either method.
score: 0
has comment: http://stackoverflow.com/comment/44167976

http://stackoverflow.com/q/27865608
type: Question
upvote count: 2
tagged with: browser
has title: multi-platform javascript RSA encryption
tagged with: javascript
has body: I'm currently building a multi-platform web application that will be available over the internet as a regular website, on desktop using node-webkit (node js) and also mobile using cordova. Everything uses html/js, so I'll be able to use the same code everywhere (mostly), which is what I'm aiming for! The application will need to encrypt some sensible data, and I would like to use RSA encryption for it! The problem I'm facing is that so far I haven't been able to find a pure javascript lib able to do it! And why is that, you ask?! Everything I've tryed so far doesn't work on node-webkit, because of some Uint8Array, Uint16Array or Uint32Array object. Apparently, V8 has some problem with those! Tom Wu's jsbn lib uses that, and since almost every other javascript lib is bases on Tom Wu's, they all have the same problem (ex. jsencrypt, etc.) or are node modules that we cannot use on a browser! Of course I can always workaround it, detecting if I'm running on node-webkit or not and use a node module if so, and a normal lib otherwhise. But I would really like to keep it homogeneous! What I need is: A pure javascrypt (not modular) lib that can RSA encrypt with a public key, that also works on node-webkit's V8. The decription will be made only on the backend (with c++), on the frontend I'll only need javascript to encrypt. Does anyone know something I could use?
favorite count: 0
answer count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: encryption
tagged with: node-webkit
score: 2
tagged with: rsa

http://stackoverflow.com/a/27813710
has body: run_prettify run_prettify adds styles to code snippets so that token boundaries stand out and your readers can get the gist of your code without having to mentally perform a left-to-right parse. You can include run_prettify as given below &lt;script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"&gt;&lt;/script&gt; it will load the entire system and schedule the prettifier to run on page load with the use of run_prettify our code looks great and easy readable. See More details for how it's works
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27813308

http://stackoverflow.com/q/27843821
score: 0
has title: Canvas Before HTML5: Is backwards compatibility posible / Intercept document.createElement
has answer: http://stackoverflow.com/a/27846102
upvote count: 1
answer count: 1
downvote count: 1
type: UnansweredQuestion
tagged with: canvas
has comment: http://stackoverflow.com/comment/44093318
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44093540
has comment: http://stackoverflow.com/comment/44091968
has comment: http://stackoverflow.com/comment/44092030
type: Question
has comment: http://stackoverflow.com/comment/44092833
has comment: http://stackoverflow.com/comment/44091355
has body: I have an idea... I am going to try making a JavaScript library which will support backwards compatibility for canvas to all browsers prior to HTML5. I am making the library function as a simple include, where, if canvas is not supported, the library takes over and creates support functions for all canvas calls, else if canvas is supported, the library does nothing. I would like the user to be able to use all canvas calls as they would normally with no change in syntax. I know this sounds crazy, but my thesis is beginning to sound quite feasible, aside from a few hick-ups... I somehow need to intercept document.createElement (don't shoot me yet, I'll explain!) When a call is made to document.createElement("tagName"), I need to somehow intercept the function to check the tagName parameter for the value of canvas. if(canvasNotSupported &amp;&amp; tagName === 'canvas') tagName = 'img'; I will also have to intercept the document.createElement function before the return statement to also include functions for the fake canvas such as getContext', 'toDataURL, and toBlob. I haven't tried anything along the lines of intercepting the document.createElement function yet, but is it possible? Can it be done? How? Also, I will provide a settings variable (Boolean) which will tell my function to override the creation of a canvas whether it is supported or not. This should provide full cross-browser compatibility and also make a nifty little work-around for that annoying "tainted canvas through cross origin data" ****-error. Thanks Everybody!
has comment: http://stackoverflow.com/comment/44091372

http://stackoverflow.com/comment/44165152
has text: I would help, but I can't figure out what kind of structure you want with the limited `data` sample and no visual preview. Perhaps you should make a fiddle
comment on: http://stackoverflow.com/q/27868973
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27857343
has comment: http://stackoverflow.com/comment/44118018
tagged with: wordpress
has answer: http://stackoverflow.com/a/27860978
has comment: http://stackoverflow.com/comment/44117750
type: AnsweredQuestion
has body: I'm pretty new in Wordpress plugins, so I have a question for you guys. I have a problem with admin-ajax call on the viewer-facing side of site. I'm using shortcodes in wordpress posts, to make a link, which must call ajax action. Unfortunately admin-ajax.php returns 0 every single time. Take a look on my code and maybe you can help me to discover what i'm doing wrong. PHP side: class myClass { public function __construct() { if (defined('DOING_AJAX')) { add_action( 'wp_ajax_myAction', array($this, 'myCallback') ); add_action( 'wp_ajax_nopriv_myAction', array($this, 'myCallback') ); } } public function myCallback() { echo "test"; die(); } } and there is Ajax call in Javascript: jQuery(document).ready(function($) { var link = $('a.myLink'); link.on('click', function(e) { $.ajax({ url: 'http://127.0.0.1/myapp/wp-admin/admin-ajax.php', type: 'POST', data: 'myAction', success:function(data) { console.log(data); }, error: function(error) { console.log(error); } }); }); }); Do you have some ideas why that code isn't working and admin-ajax.php returns "0"?
possible better answer: http://stackoverflow.com/a/27858139
has answer: http://stackoverflow.com/a/27858139
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/27858262
answer count: 3
has comment: http://stackoverflow.com/comment/44117967
downvote count: 0
has comment: http://stackoverflow.com/comment/44117821
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44117856
tagged with: php
accepted answer: http://stackoverflow.com/a/27858262
score: 2
has title: WordPress admin-ajax returns "0" on the Viewer-Facing Side
upvote count: 2

http://stackoverflow.com/q/27912133
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44223977
type: UnansweredQuestion
has body: I have a partial in my AngularJS application that needs a 3rd party .js file to run. In order for this partial to work correctly, I have to have the javascript load after the page is loaded in the app view. What I have so far is this for the directive to include the scripts: .directive('loadScripts',function() { return { restrict :'EA', link: function(scope, element, attrs) { angular.element('&lt;script src="/js/jquery.cycle.all.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script src="/js/main.js" type="text/javascript"&gt;&lt;/script&gt;').append(element); } } }) Then on the partial I have &lt;div load-scripts&gt;&lt;/div&gt;. The partial doesn't get anything loaded, the directive isn't adding the html tags to the page. Any ideas on what I should do? I reviewed a similar question/answer here: Correct way to integrate Jquery plugins in Angular.js I appear to be following it exactly, except i'm using angular.element instead. I'm tried different tests and none of the element is being included into the DOM
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44223981
answer count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44224054
type: Question
has title: AngularJS loading javascript in partials
tagged with: javascript
downvote count: 0
linked to: http://stackoverflow.com/q/16935095
favorite count: 0

http://stackoverflow.com/a/27935292
type: Answer
accepted answer of: http://stackoverflow.com/q/27915909
has body: After fiddling with my JS I found out that the "style" column ({"type":"string", "role":"style"}) is causing the problem. I don't know if this is a bug on Google Chart API or it is a feature that is yet to be implemented so for now I removed the style and it worked. Here is the working fiddle: http://jsfiddle.net/nb795hyx/
answers question: http://stackoverflow.com/q/27915909
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/27936265
has comment: http://stackoverflow.com/comment/44270019
score: 0
answers question: http://stackoverflow.com/q/27936229
has body: Try this $(document).ready(function() { // show popup when you click on the link $('.show-popup').hover(function(event){ event.preventDefault(); // disable normal link function so that it doesn't refresh the page var docHeight = $(document).height(); //grab the height of the page var scrollTop = $(window).scrollTop(); //grab the px value from the top of the page to where &gt;you're scrolling var selectedPopup = $(this).data('showpopup'); //get the corresponding popup to show $('.overlay-bg').show().css({ 'height' : docHeight }); //display your popup background and set &gt;height to the page height $('.popup' + selectedPopup).show().css({ 'top': scrollTop + 20 + 'px' }); //show the appropriate popup &gt;and set the content 20px from the window top $(this).removeClass("show-popup"); } });
type: Answer

http://stackoverflow.com/a/27963654
downvote count: 0
type: Answer
upvote count: 2
has body: The display issue is caused by the Editor that outputs the iframe with size "width: 0px". Next step, finding a possible solution: CSS Set a predefined width for all Iframes, example [CSS][1]; OR Jquery (Example: [change-iframe-width-and-height-using-jquery][2]) [1]: http://jsfiddle.net/7WRHM/1001/ [2]: http://stackoverflow.com/a/14913861/2842657 I have not tested thoroughly but this solution seems to solve the issue: .cke_contents &gt; iframe{ width: 100% !important; }
score: 2
answers question: http://stackoverflow.com/q/27938525
accepted answer of: http://stackoverflow.com/q/27938525
type: AcceptedAnswer

http://stackoverflow.com/q/27881445
score: 0
has answer: http://stackoverflow.com/a/27888962
has title: Sending JSON array to webservice from Google Sheet Script
linked to: http://stackoverflow.com/q/39310706
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: google-apps-script
has body: We have a webservice that returns product information. The service expects a JSON array in the post data... The A sample script from a simple HTML test web page is as follows (this works as expected): &ltscript src="//code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ // request is array of product IDs e.g. pid:[71,72,74] // request is array of search terms e.g. find:['apples','oranges','pears'] // request can contain requested fields from products // fields:['CostPrice','Published','title','Price'] jQuery.ajax({ url : 'http://somewebsite.com/__getProductData', type: 'POST', dataType : 'json', data: { pid:[658,71,6,700], fields:['pid','CostPrice','type','published','title'] }, success:function(data) { // do something with the response... }); }, error: function( jqXHR, textStatus, errorThrown) {alert('Error Status:' + textStatus + ' Error:'+errorThrown); } } ); }); &lt;/script&gt; The web service, written in PHP, receives this correctly. Dumping (print_r) the data received by the web service from the client results in the following array: Array ( [pid] => Array ( [0] => 658 [1] => 71 [2] => 6 [3] => 700 ) [fields] => Array ( [0] => pid [1] => CostPrice [2] => type [3] => type [4] => published [5] => title ) Now to the problem.... I'm trying to call the webservice from a Google Sheet Script as follows: function getProduct( pid,datetime) { // var url = 'https://somewebsite.com/__getProductData'; //pid:[658,71,6,700], fields:['pid','CostPrice','type','published','title'] var nids = new Array( 658,71,6,700 ); var fields = ['pid','CostPrice','type','published','title'] var payload = { pid : nids, fields: fields }; var options = { "method": 'POST', "payload": payload }; var response = UrlFetchApp.fetch(url, options); Logger.log(response); } When the PHP web service is called from Google Sheets script the JSON array is not receive correctly: Array ( [data] => { pid=[Ljava.lang.Object;@1bfbb500} fields…
answer count: 3
has answer: http://stackoverflow.com/a/39358557
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27932392
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/44177313

http://stackoverflow.com/a/27912056
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44336137
answers question: http://stackoverflow.com/q/27901292
has body: No need to perform conversion from mp3 compressed binary into PCM raw Float typed array twice so avoid two calls to decodeAudioData. Also, let's ask an easier question, so ignore localForage for now - just park a reference to the raw audio buffer into its own var for later replay : Test play_again Once you're happy with this then strap on the localForage - should be a snap

http://stackoverflow.com/comment/44091919
comment on: http://stackoverflow.com/q/27843673
has text: So you're basically asking, should you use mergeSort, quickSort, insertionSort, or some other, right?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27894188
score: 0
type: AcceptedAnswer
has body: Just a small example using a JS questions Array with Objects var $quizEl = $("#quizEl"); var $submit = $("#submit"); var quiz = [ { // obj "Q" : "What color is the Sun?", "A" : ["Red", "Black", "Yellow"], "C" : 2 },{ "Q" : "What color is an Elephant?", "A" : ["Gray", "Blue", "Yellow"], "C" : 0 // zero indexed! },{ "Q" : "What color is the Sea?", "A" : ["Fuchsia", "Blue", "Gold"], "C" : 1 } ]; var qNum = quiz.length; // FUNCTION THAT CREATES AND APPENDS AN `UL` TO `DIV #quizEl` function generateQuestion( obj, idx ) { var html = " "+ obj.Q +" "; for (var i=0; i<obj.A.length; i++) { html += " "+ " "+ " "+ obj.A[i] +" "+ " "; } $quizEl.append( html+" " ); } // GENERATE ALL QUESTIONS: for(var i=0; i<qNum; i++) { generateQuestion( quiz[i], i ); // quiz[i] is the {QAC} object } $quizEl.on("change", ":radio", function(){ // Record User choice (U property) quiz[this.name].U = this.value; // set 0,1,2 to the new U property {QACU} }); $submit.on("click", function(e){ e.preventDefault(); console.log( quiz ); // To test how it looks // Check if user answered them all: for(var i=0; i<qNum;i++){ if(!quiz[i].hasOwnProperty("U")){ // User did not answered if "U" property doesn't exists return alert("Please,\nanswer the question "+ (i+1) +":\n"+ quiz[i].Q ); }else{ // Add classes... $("ul").eq(i).find(":checked").closest("li") .addClass( +quiz[i].U === quiz[i].C ? "correct":"wrong"); } } // Finally colour them! $(".correct").css({background:"green"}); $(".wrong").css({background:"red"}); });
type: Answer
answers question: http://stackoverflow.com/q/27893544
accepted answer of: http://stackoverflow.com/q/27893544

http://stackoverflow.com/q/27856238
tagged with: flexbox
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44119766
has answer: http://stackoverflow.com/a/28060400
has title: Elements positioned at the bottom & cut-off from bottom
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44119823
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/28060400
type: Question
has body: I have three blocks, I want them positioned at the bottom always, regardless of the viewport height, and when there's not enough height to show all of it, I want them to hide from the bottom, NOT the top. I tired a flexbox solution: http://jsbin.com/kutipequxe/1/edit?css,output .. it almost works, except on low resolutions, the blocks hide from top, bottom remains visible. I also tried another solution: http://jsbin.com/ruhigijeba/1/edit?css,output .. well this keeps the top always visible, but just hides the bottom altogether, including the other two blocks. I even tried a JS solution: var vh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); var topHeight = document.getElementById('top').offsetHeight; console.log('Viewport Height: ' + vh); function getHeight(element) { console.log(document.getElementsByClassName(element)); var offsetHeight = document.getElementsByClassName(element)[0].offsetHeight; console.log('offsetHeight: ' + offsetHeight); var marginTop = vh - (topHeight + offsetHeight); console.log('marginTop: ' + marginTop); document.getElementsByClassName(element)[0].style.marginTop = marginTop + "px"; } getHeight("card-1"); getHeight("card-2"); getHeight("card-3"); ... but it still hides the blocks from top!
has answer: http://stackoverflow.com/a/27858826
has comment: http://stackoverflow.com/comment/44120213
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27858826
linked to: http://stackoverflow.com/q/15646747
answer count: 2

http://stackoverflow.com/comment/44308445
type: QuestionComment
comment on: http://stackoverflow.com/q/27956857
score: 0
type: Comment
has text: I'm not highly familiar with this stuff... but is there some kind of `respond_with :success` equivalent for a js response?rather than a render nothing for both success and error cases?

http://stackoverflow.com/comment/44249315
type: Comment
has text: Where did you get the pop.js? Are you sure it dies what you expect? Seems to be a script that runs itself...
score: 0
comment on: http://stackoverflow.com/q/27925777
type: QuestionComment

http://stackoverflow.com/q/27853668
has body: I have a asp.net web page where my requirement was to show loading image until the gridview loads data after clicking the Submit button. So, I have researched on the internet and managed to this as per below code: function ShowProgress() { myVar = setTimeout(function () { var modal = $('&lt;div /&gt;'); modal.addClass("modal"); $('body').append(modal); var loading = $(".loading"); loading.show(); var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0); var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0); loading.css({ top: top, left: left }); }, 200); } $('form').live("submit", function () { ShowProgress(); }); But now the problem is : when user clicks on "Submit" button then it does not check for mandatory field and it keep on showing the loading symbol until or unless we refresh the page using "F5". I am using RequiredFieldValidator of asp to check for mandatory field and it works fine with the Submit button but only the loading modal does not consider those mandatory field. Please suggest me on this how I may achieve this. Thanks in advance.
has comment: http://stackoverflow.com/comment/44111264
has answer: http://stackoverflow.com/a/27855505
has comment: http://stackoverflow.com/comment/44111517
score: 0
has comment: http://stackoverflow.com/comment/44111414
has comment: http://stackoverflow.com/comment/44113466
has title: How to check the mandatory field with javascript?
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27855505
type: AnsweredQuestion
tagged with: asp.net
type: Question
has comment: http://stackoverflow.com/comment/44113474
has comment: http://stackoverflow.com/comment/44113530
answer count: 1

http://stackoverflow.com/comment/44199906
type: Comment
has text: For me it looks like ok, so which widht you have?
comment on: http://stackoverflow.com/a/27844928
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44196237
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27897781
type: Comment
has text: The anti-pattern comment seems to be distracting from the answer, I'll remove it.

http://stackoverflow.com/a/27828314
has comment: http://stackoverflow.com/comment/44064213
answers question: http://stackoverflow.com/q/27828154
has comment: http://stackoverflow.com/comment/44062978
has comment: http://stackoverflow.com/comment/44064599
type: AcceptedAnswer
downvote count: 0
has body: " Thank you! We will be right with you. (This page will be refreshed automatically after 15 seconds)" ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Success!", "setTimeout(function(){location.href='/form.aspx';},15000); counter = 15; setInterval(function(){counter--; document.getElementById('counter').innerHTML = counter;},1000);", true); Should do it. If added a span with id counter around the refresh message number. Then I added counter = 15; to initialize a default value of 15. And another setInterval to the script block firing every second. With each pass it subtracts one from counter and updates the span with the new counter value. Users should now see the page counting down. I also changed the first setInterval to setTimout, since it's technically a timeout and not an interval that should occur every 15 seconds.
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/27828154
upvote count: 1

http://stackoverflow.com/comment/44030051
has text: What is the problem? What have you tried?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27810672
score: 1

http://stackoverflow.com/q/27862823
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27862921
has comment: http://stackoverflow.com/comment/44128921
has title: How to obtain the full url of an Angular view in Global.asax
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27862921
has body: In an ASP.NET MVC application, there is Request.Url to access the url in Global.asax. But for an Angular application where an url is like http://domain/#/home. The Request.Url we obtained from Application_BeginRequest or Application_EndRequest are http://domain/. The Angular routes are not included. It is reasonable because those routes are added at the client side. But is it possible to get the value of the true url in the MVC server side? Update: Just picked Matteo's answer as the correct one. Let me clarify a bit. I have been trying this for one purpose: rewrite my url. In the past, I used to check Request.ApplicationPath and manipulate url with string functions or built-in tools like VirtualPathUtility. The need for the hash part is valid because the query string parameters are appended there. For example, I have a url like this: http://[domain]/#/pay/cancel?paymentId=[some guid] The conventional wisdom brought me to Global.asax to access those query parameters. I find none. Everything behind the hash tag is conveniently ignored. So the correct way is to handle that part of url in the client side code. I am using ui-router. So for url rewrite/redirect, use stateProvider.when(oldUrl, newUrl);. To access query parameters, use $state.params. Lesson learned: think clearly and approach different problem with different mindset.
tagged with: asp.net-mvc

http://stackoverflow.com/q/27954319
tagged with: regex
score: 2
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44304091
type: Question
has title: Wrap words in a string with strong tags given a list of words once and in order
has comment: http://stackoverflow.com/comment/44303819
linked to: http://stackoverflow.com/q/641407
has body: I have an input which I want to match to a list of strings but I want to match each input word once in order per line. Ie var input = "One Two Three".split(" "), matchPattern = new RegExp('(' + input.join('|') + ')', 'i'); //Replace appropriately //Given the following, output as per comment "One Two Three".replace(matchPattern, "$1"); //One Two Three "One One Three".replace(matchPattern, "$1"); //One One Three "Two Three One".replace(matchPattern, "$1"); //Two Three One //In this case: // match One if not after One Two or Three // match Two if not after One Two or Three // match Three if not after One or Three (Two already matched) To clarify, what I am asking is to: Test each word in the string with each input word Once a word is found, wrap it with a strong tag and remove that word from the input test Continue with the next word and so on I attempted to do all this with negative lookbehinds, but it seems javascript cannot handle this and all the workarounds I could find either don't work with a collection of words or require reversing the string to be tested and using negative lookaheads. I don't think either of these solutions would be ideal as I plan on running this test against 50~500 strings. Javascript: negative lookbehind equivalent?
has answer: http://stackoverflow.com/a/27954359
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44303750
tagged with: negative-lookbehind
favorite count: 0

http://stackoverflow.com/comment/44021842
comment on: http://stackoverflow.com/q/27806428
has text: jQuery doesn't animate colors, you'll need a plugin or jQuery UI for that ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44139108
type: QuestionComment
comment on: http://stackoverflow.com/q/27868330
has text: There is, you could set `pointer-events:none` to the element covering it, but that has the side-effect of not firing any mouse events on the overlying element.
score: 1
type: Comment

http://stackoverflow.com/comment/44134549
type: Comment
has text: in the initial stage option is like option : []; The some data is pushed in the option array
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27848081

http://stackoverflow.com/a/27846437
type: Answer
answers question: http://stackoverflow.com/q/27846179
score: 0
has body: Try changing it to a for cycle. This might not be working, but you get the idea. document.getElementById('combo').onchange = function() { for (var i = 0; i &lt;= this.selectedIndex; i++) { var display = this.selectedIndex == i ? "inline" : "none"; document.getElementById('text'+(i+1)).style.display = display; } }

http://stackoverflow.com/comment/44226399
type: QuestionComment
comment on: http://stackoverflow.com/q/27913507
has text: You have the following error in the console: `Uncaught TypeError: undefined is not a function - intialisation.js:2`
score: 0
type: Comment

http://stackoverflow.com/comment/44088578
has text: very useful but i forgot to mention that i'm running an old version of sonata that can't recognise the SONATA_TYPE_MODEL_AUTOCOMPLETE formType, right know i can't update the sonata package
type: AnswerComment
comment on: http://stackoverflow.com/a/27841442
score: 0
type: Comment

http://stackoverflow.com/a/73046512
upvote count: 0
answers question: http://stackoverflow.com/q/27863617
score: -1
has body: Clipboard feature is available only in secure contexts (HTTPS), in some or all supporting browsers. You need change protocol to https (SSL) if (location.protocol !== 'https:') { location.replace(`https:${location.href.substring(location.protocol.length)}`); }
type: Answer
downvote count: 1

http://stackoverflow.com/a/27861755
has comment: http://stackoverflow.com/comment/44129245
answers question: http://stackoverflow.com/q/27861122
score: 10
upvote count: 10
has comment: http://stackoverflow.com/comment/44129357
downvote count: 0
has body: You can't get keyboard layout... There's no way (with a pure JS solution) to detect the user's keyboard layout. Note the "en-US" or "en-GB" doesn't map to any specific / agreed keyboard layout for those languages. The user's language is independent to how their keys map to a character. You can make assumptions based on their locale / language code, but this doesn't offer any guarantee - it just increases the probability that you're catering for the appropriate layout. Also see these questions: Translate Javascript keyCode into charCode for non-U.S. keyboard layout (i.e. azerty) Detect keyboard layout with javascript ...but you can get the character entered with it: However, depending on your required browser support (which using canvas, should be quite good), you could try to use the charCode property: http://www.w3schools.com/jsref/event_key_charcode.asp var unicodeCharCode = e.charCode; Note that this will not return the actual character - you'll get the number representing it (NOT the key): The Unicode character code is the number of a character (e.g. the number "97" represents the letter "a"). You can easily map these codes to characters as required or just use the built in function: var userInput = String.fromCharCode(unicodeCharCode); Being clever / making work for yourself, you could also (fairly trivially) write a library to guess the keyboard layout from the charCode's returned for certain keyCode's. Don't though :) Alternative approach: One suggestion to use as a workaround would be to use a hidden (or at least discrete) text input / text box, which your app sets focus on. When your app detects a keypress / keydown etc. you can grab the value the user has entered and render it on your canvas. As you're already capturing the keyboard events, handling combinations should be easy (if necessary). In some ways even that wouldn't be required as you only have to monitor the input length of the user input (your app doesn't have to care if the user needed a three-k…
type: Answer

http://stackoverflow.com/comment/44314012
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27959961
has text: Turns out `this.height/=2;` line is not needed. Your code actually solves the problem.
type: Comment

http://stackoverflow.com/a/27870877
score: 0
has body: The issue was coming from accidentally saving a query object into the state. This caused the variables to flip in the map function, setting the key to [object Object] and leaving &lt;TableRow&gt; to render given only an integer. I just called .toArray() at the end of the new_rows assignment chain and it worked!
answers question: http://stackoverflow.com/q/27869254
type: Answer

http://stackoverflow.com/comment/44184280
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27891434
type: Comment
has text: @Syed Users must know that function must be called in context of `instance` object. So they will use `.bind()` to do it.

http://stackoverflow.com/q/27927985
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44253085
tagged with: javascript
favorite count: 0
score: 0
downvote count: 1
has title: Difference between $ and $$ in angularjs
has body: I am using $scope.$on('$routeChangeStart', function (event, toState, toParams, fromState, fromParams) { //content $log.log(toState); } to keep track of the routes i am navigating to. When i print "toState" it is giving me an object, as shown below. { $$route: Object loadedTemplateUrl: "views/homepage.html" locals: Object params: Object pathParams: Object scope: ChildScope __proto__: Object } Here i am not 100% sure about "$$" in '$$route'. Can some one please explain about the difference between $ and $$.
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27928480
linked to: http://stackoverflow.com/q/19338493
type: Question

http://stackoverflow.com/a/27856067
type: Answer
has body: It is quite easily possible to use the safari remote debugging features in order to debug a website on an iOS device. Note: This only applies when using a Mac Hav a look here: http://www.hongkiat.com/blog/ios-debugging/
has comment: http://stackoverflow.com/comment/44116381
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44115451
answers question: http://stackoverflow.com/q/27855802
upvote count: 1

http://stackoverflow.com/q/27919135
score: 0
has comment: http://stackoverflow.com/comment/44309212
tagged with: javascript
has title: Can $routeProvider be replaced by $stateProvider or vice versa and how?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44353657
type: UnansweredQuestion
answer count: 0
type: Question
tagged with: firebase
has body: I have found a perfectly working and advanced Angularfire-Seed (that encompasses Simple Login). This framework uses ngRoute and $routeProvider to route the appropriate view and to make sure that certain pages are only shown when the user has logged in. Now I want to integrate this with the Ionic Framework, such that I have an Ionic App that uses this Authentication system. However, Ionic uses $stateProvider. My question then becomes: how do I combine these two? I guess one of the two has to go and be replaced by the other. But how do you do this? Below are the two projects that I want to combine: 1. Angular-Fire Seed using $routeProvider (routes.js) "use strict"; angular.module('myApp.routes', ['ngRoute', 'simpleLogin']) .constant('ROUTES', { '/home': { templateUrl: 'partials/home.html', controller: 'HomeCtrl', resolve: { // forces the page to wait for this promise to resolve before controller is loaded // the controller can then inject `user` as a dependency. This could also be done // in the controller, but this makes things cleaner (controller doesn't need to worry // about auth status or timing of displaying its UI components) user: ['simpleLogin', function(simpleLogin) { return simpleLogin.getUser(); }] } }, '/chat': { templateUrl: 'partials/chat.html', controller: 'ChatCtrl' }, '/login': { templateUrl: 'partials/login.html', controller: 'LoginCtrl' }, '/account': { templateUrl: 'partials/account.html', controller: 'AccountCtrl', // require user to be logged in to view this route // the whenAuthenticated method below will resolve the current user // before this controller loads and redirect if necessary authRequired: true } }) /** * Adds a special `whenAuthenticated` method onto $routeProvider. This special method, * when called, invokes the requireUser() service (see simpleLogin.js). * * The promise either resolves to the authenticated user object and makes it available to * dependency injection (see AuthCtrl), or rejects the promise if user is not logged in, …
has comment: http://stackoverflow.com/comment/44366187
tagged with: ionic-framework

http://stackoverflow.com/comment/44060181
type: Comment
comment on: http://stackoverflow.com/a/27827053
has text: appreciate the vote. Make sure to up juvian as his comment came in while I was typing my answer.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27950072
type: Question
tagged with: swift
score: 2
type: AnsweredQuestion
has title: How to check WKWebView has HTML string loaded
has answer: http://stackoverflow.com/a/27950293
downvote count: 0
tagged with: ios
answer count: 1
tagged with: javascript
has body: Currently, WKWebView does NOT support loading local file with URLRequest. Details can be read at: this link here I tried to create a workaround by reading my local html file and use webView.loadHTMLString to manually tell web view to render. How to I know if webView has loaded with HTML, as if I check webView.URL to see if it has loaded with an URL. I truly appreciate your help!
tagged with: wkwebview
favorite count: 0
tagged with: xcode
linked to: http://stackoverflow.com/q/24882834
accepted answer: http://stackoverflow.com/a/27950293
upvote count: 2

http://stackoverflow.com/comment/44136052
score: 0
has text: @Byc that is not pretty good, but I think that you dont have other way :/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27866666

http://stackoverflow.com/q/27930396
favorite count: 0
has comment: http://stackoverflow.com/comment/44258217
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27930480
has title: Click on img link to change text inside a div
has body: I have a page with 4 images and a div box containing some text. When I click on one of the images I want the text to change to something else. My goal is to be able to click on each image and get information about them without making an entirely different HTML just for a slight change in one div. Welcome blabla This is the code I've been trying to make it work but it doesn't. I'd like to code it in Javascript as well.
tagged with: onclick
tagged with: innerhtml
upvote count: 1
type: Question
score: 1
has comment: http://stackoverflow.com/comment/44257909
has answer: http://stackoverflow.com/a/27930537
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/44170596
score: 2
has text: change that `#crate` element to a div and this will work
comment on: http://stackoverflow.com/q/27884528
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27822291
has body: I created a custom Element wich gets data from a JSON file: &lt;polymer-element name="view-component" attributes="number"&gt; &lt;template&gt; &lt;link rel="stylesheet" href="custom_style.css" type="text/css"&gt; &lt;core-ajax auto response="{{data}}" on-core-response="{{ajaxHandler}}" url="http://www.test.com/json/{{number}}"; handleAs="json"&gt;&lt;/core-ajax&gt; &lt;div class="showbox"&gt; &lt;p&gt;&lt;b&gt;entry:&lt;/b&gt; &lt;/p&gt; &lt;/template&gt; The data.entry String looks like this: &lt;p&gt;MyBrand&amp;trade; is &lt;b&gt;very&lt;\b&gt; nice &lt;\p&gt; After finding this Question: Converting HTML Entities from JSON to String my String looks like this: &lt;p&gt;MyBrand&trade; is &lt;b&gt;very&lt;\b&gt; nice &lt;\p&gt; But How do I parse the actual Elements in that String and add them to my Custom Element? Here is my JavaScript Code so far: Polymer('view-component', { encodeEntities: function(value) { console.log(value); var div = document.createElement('div'); div.innerHTML = value; console.log(div.childNodes[0]); return div.innerHTML; }, My console log console.log(div.childNodes[0]); puts out a DOM-Tree which looks perfect! But when I want to return it to the component, the Browser renders : [object HTMLParagraphElement] instead of attaching the DOM to my element. What am I missing? Any help is appreciated!
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27826906
accepted answer: http://stackoverflow.com/a/27826906
tagged with: html-parsing
has title: Converting HTML tags from JSON-String into real HTML Elements
type: Question
tagged with: polymer
tagged with: javascript
linked to: http://stackoverflow.com/q/26385986
score: 0
tagged with: web-component
answer count: 1

http://stackoverflow.com/comment/44152727
has text: It must be something to do with ionic.. it's hard to explain unless your familiar with it.. basically inside the WWW folder, if i place all the files from my original game inside it it works fine. but obviously isn't optimised for an android and doesn't display properly.. soon as i try using the same code inside of tab-main.html it doesn't work.
comment on: http://stackoverflow.com/a/27875422
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44573092
score: 0
has text: I don't know what is wrong but the code doesn't seem to be working, for example if I put this at the start of a php file none of the php works...
type: Comment
comment on: http://stackoverflow.com/a/27961591
type: AnswerComment

http://stackoverflow.com/comment/44167411
score: 4
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27882796
has text: That isn't JSON. It's still JavaScript. It's just a different data structure.

http://stackoverflow.com/a/27954165
type: Answer
answers question: http://stackoverflow.com/q/27954014
score: 0
has body: Moments after posting this I figured it out... I needed to update my colorExists method to the following (code could use some cleanup but I hope everyone sees what I changed): function colorExists(colorName) { var colorsRef = fireBaseRef.child("colors"); colorsRef.once('value', function(snapshot) { if (snapshot !== null) { snapshot.forEach(function(snapshot) { // if the value matches the name we specified if (snapshot.val() === colorName) { exists = true; return; } }); if (exists) { alert(venueName + ' exists!'); } else { alert(venueName + ' does not exist!'); } }); }

http://stackoverflow.com/comment/44059520
score: 0
type: Comment
type: QuestionComment
has text: beacuse the '(quote) is causing issue
comment on: http://stackoverflow.com/q/27825603

http://stackoverflow.com/comment/44098254
comment on: http://stackoverflow.com/q/27846318
score: 0
has text: What are you trying to do?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27925359
has title: Using ajax with jQuery - url not accepted
has body: I'm trying to build an ajax request that will eventually allow users to sort a list by clicking buttons next to each item. Here's what I have so far: upLinks.on('click', function(e) { var link; e.preventDefault(); link = $(this)[0]; console.log(link.pathname); $.ajax({ type: 'PUT', url: link.pathname }); return false; }); console.log(link.pathname) logs out /projects/11/project_items/104/sort to the console, as expected. However, the ajax request returns an error: PUT http://localhost:3000/projects/11 400 (Bad Request) Looking at the server logs, it is in fact going to /projects/11, not /projects/11/project_items/104/sort for some reason. According to the jQuery docs, /projects/11 would be the default parameter for ajax in this case, because that's the route of the current page. Which leads me to believe it's ignoring the url parameter altogether. If I change HTTP method type to GET, the ajax runs as expected. Is there some reason /projects/11/project_items/104/sort is not an acceptable url for a PUT request? I thought that because I'm updating data (with the new position) a PUT request would be the most logical option.
linked to: http://stackoverflow.com/q/2153917
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/27925444
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44247780
score: 4
tagged with: ajax
has comment: http://stackoverflow.com/comment/44253941
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44247762
type: UnansweredQuestion

http://stackoverflow.com/a/27892942
answers question: http://stackoverflow.com/q/27892905
upvote count: 0
has comment: http://stackoverflow.com/comment/44187372
has comment: http://stackoverflow.com/comment/44187208
has comment: http://stackoverflow.com/comment/44187239
has comment: http://stackoverflow.com/comment/44187068
score: -1
has comment: http://stackoverflow.com/comment/44187183
has comment: http://stackoverflow.com/comment/44187168
has comment: http://stackoverflow.com/comment/44187336
downvote count: 1
has comment: http://stackoverflow.com/comment/44187259
has body: var elems = document.querySelectorAll('.className'); var values = Array.prototype.map.call(elems, function(obj) { return obj.onclick = function(e){ //do stuff }; }); This (adapted example from MDN) is how you could do it without a traditional loop.
type: Answer
has comment: http://stackoverflow.com/comment/44187308
has comment: http://stackoverflow.com/comment/44187243

http://stackoverflow.com/comment/44200544
has text: you can use it in `complete:function(){ // trigger here... }`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27900379

http://stackoverflow.com/a/27915816
has body: Try with First Solution Template.input.events({ "keydown #message" : function (event) { } }) Use IDS Second Solution also replace "keydown inpuchat" to just "keydown input#chatid
accepted answer of: http://stackoverflow.com/q/27915773
answers question: http://stackoverflow.com/q/27915773
downvote count: 0
has comment: http://stackoverflow.com/comment/44230359
has comment: http://stackoverflow.com/comment/44230931
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44230424
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44036564
comment on: http://stackoverflow.com/q/27814867
score: 0
type: Comment
type: QuestionComment
has text: base version was 64. and still when i am using facebookchat.mp3, its not working.

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/27899364
tags question: http://stackoverflow.com/q/27804650
tag name: sequelize.js

http://stackoverflow.com/comment/44106492
comment on: http://stackoverflow.com/a/27850581
score: 0
type: Comment
has text: Here's one place in the type script source code where non-function members are assigned to the prototype: https://github.com/Microsoft/TypeScript/blob/master/src/compiler/core.ts#L660
type: AnswerComment

http://stackoverflow.com/comment/44104740
has text: Im not using a callback for this function - i just purely wanted to return a true or false. How would i go about a promise?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27850065

http://stackoverflow.com/a/27941920
has body: I think you are looking to have a JSON stringified object containing the values in those elements (and not the elements themselves). For that, you can do: ... var friend = { "name": formAttribute[0].value, "description": formAttribute[1].value }; socket.send(JSON.stringify(friend)); ... Note: The above is assuming formAttribute[0] and formAttribute[1] are DOMElements. If they are jQuery objects, you should use .val() instead.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27941660
answers question: http://stackoverflow.com/q/27941660
score: 0

http://stackoverflow.com/comment/44283955
type: QuestionComment
comment on: http://stackoverflow.com/q/27943695
score: 0
has text: If the code is not manipulated by the server side, yes use ng-include
type: Comment

http://stackoverflow.com/comment/44225999
score: 0
comment on: http://stackoverflow.com/q/27912578
type: Comment
type: QuestionComment
has text: you can't put it in the middle of the page with those functions.

http://stackoverflow.com/comment/44314736
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27960545
has text: Sounds like you might be using a lousy text editor. What are you using?
type: Comment

http://stackoverflow.com/q/27878587
has comment: http://stackoverflow.com/comment/44164748
has title: Pass event to a sibling html element
type: Question
tagged with: javascript
has body: I have created an app with three.js were there are 2 renderers (1 canvas and 1 div(css renderer)). The css renderer is on top of the canvas and I would like to pass any type of event to the canvas element which is behind. So far I have failed to create a dispatcher... What I have tried so far: 1) // on top element css renderer $(this.cssRenderer.domElement).on("click mousedown mouseup mousemove focus blur keydown keyup change touchstart touchend touchmove", function ( event ) { event.preventDefault(); event.stopImmediatePropagation(); //canvas background domelement $(that.renderer.domElement).trigger(event); }); 2) $(this.cssRenderer.domElement).on("click mousedown mouseup mousemove focus blur keydown keyup change touchstart touchend touchmove", function ( event ) { event.preventDefault(); event.stopImmediatePropagation(); that.renderer.domElement.dispatchEvent(event.originalEvent); }); In case 2 I get the following error: Uncaught InvalidStateError: Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched. I also tried to copy the object or pass it after some timeOut but nothing seem to work. I haven't done anything similar so I'd like a little help or some guidance.
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/27878906
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/52358941
tagged with: three.js
accepted answer: http://stackoverflow.com/a/27878906
type: AnsweredQuestion

caching
tags question: http://stackoverflow.com/q/27842615
tags question: http://stackoverflow.com/q/27814621
type: Tag
tags question: http://stackoverflow.com/q/27930441
tags question: http://stackoverflow.com/q/27889930
tags question: http://stackoverflow.com/q/27848212
tags question: http://stackoverflow.com/q/27862083
tags question: http://stackoverflow.com/q/27942658
tags question: http://stackoverflow.com/q/27855951
tags question: http://stackoverflow.com/q/27939380
tag name: caching
tags question: http://stackoverflow.com/q/27912366

http://stackoverflow.com/q/27926364
has comment: http://stackoverflow.com/comment/119537846
upvote count: 3
accepted answer: http://stackoverflow.com/a/27926393
has title: How to get the last item in an object by sorted key order
has comment: http://stackoverflow.com/comment/44249805
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/27926491
has answer: http://stackoverflow.com/a/27926491
type: Question
has comment: http://stackoverflow.com/comment/44249748
answer count: 2
has comment: http://stackoverflow.com/comment/44249915
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27926393
linked to: http://stackoverflow.com/q/4317456
favorite count: 0
has body: Suppose I have an object with this structure: { "friends_count": { "1420800660": 49391, "1421149814": 49344, "1421149955": 49344 } } In the object, the first number (the key) is a timestamp. The second number is the value. I want to get the most recent item of that object. So, I need to get the key that is closest in time. How do I have to do it?
tagged with: node.js

http://stackoverflow.com/q/27803734
has comment: http://stackoverflow.com/comment/44017744
has comment: http://stackoverflow.com/comment/44016755
linked to: http://stackoverflow.com/q/9583072
has comment: http://stackoverflow.com/comment/44016857
answer count: 0
has comment: http://stackoverflow.com/comment/44017160
has comment: http://stackoverflow.com/comment/44017025
has comment: http://stackoverflow.com/comment/44016532
has comment: http://stackoverflow.com/comment/44016959
has comment: http://stackoverflow.com/comment/44017075
has body: Issue: I am unable to properly execute the event handler $('#vote_' + messagesIds[i]).click(function(). On clicking the circle, the event handler runs but consequently error.message returns "Object not found". The issue is that votingOn is undefined, as the value of this cannot be acquired. However, console.log(this); displays the id and value of '#vote_' + messagesIds[i] correctly. The handler makes reference to a circle created above on the third line of text. The event handler is inside of the function(results) where messagesIds is declared and occurs after the FOR loop that amends the HTML to display the button. Please help. Code: if (playerStatus == "active"){ //GET MESSAGES var Message = Parse.Object.extend("Messages"); var query = new Parse.Query(Message); query.equalTo("Game", gameJSON); query.ascending("createdAt"); query.find().then(function(results) { for (var i = 0; i &lt; results.length; i++) { messagesIds.push(results[i].id); messages.push(results[i].get("Message")); votes.push(results[i].get("Votes")); } console.log(results); //DISPLAY MESSAGES var text = "&lt;ul&gt;"; for (i = 0; i &lt; messages.length; i++) { text += "&lt;li class='messageContainer' id='" + messagesIds[i] + "_container " + "' value='" + messagesIds[i] + "'&gt;"; text += "&lt;div class='voteContainer' id='vote_" + messagesIds[i] + "' value='" + messagesIds[i] +"'&gt;" + votes[i] + "&lt;/div&gt;&lt;/div&gt;"; text += "&lt;/li&gt;"; } text += "&lt;/ul&gt;"; //Ammend HTML document.getElementById("messagesContainer").innerHTML = text; //VOTING [not working] for (i = 0; i &lt; messages.length; i++) { $('#vote_' + messagesIds[i]).on('click',function() { var votingOn = $(this).val(); console.log(this); var Messages = Parse.Object.extend("Messages"); var query = new Parse.Query(Messages); query.get(votingOn).then(function(results){ results.increment("Votes"); results.save(); console.log("Voted"); }, function(error) { console.log("Voting Error: " + error.message); } }) } }) //end function(res…
type: Question
tagged with: for-loop
has comment: http://stackoverflow.com/comment/44017307
tagged with: javascript
tagged with: event-handling
has title: Event Handler After FOR Loop
score: 0
has comment: http://stackoverflow.com/comment/44016462
has comment: http://stackoverflow.com/comment/44016678
type: UnansweredQuestion

http://stackoverflow.com/comment/44211146
has text: The CSS in my fiddle is only for visual demo, you don't actually need to use it at all.
comment on: http://stackoverflow.com/a/27904934
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27934153
score: 2
has comment: http://stackoverflow.com/comment/44266079
downvote count: 0
has comment: http://stackoverflow.com/comment/44265957
favorite count: 0
has title: Iterate javascript object from echoed json encoded array from PHP
has answer: http://stackoverflow.com/a/27934269
has comment: http://stackoverflow.com/comment/44266163
has comment: http://stackoverflow.com/comment/44266040
has answer: http://stackoverflow.com/a/27934240
tagged with: php
has comment: http://stackoverflow.com/comment/44266046
has answer: http://stackoverflow.com/a/27934246
answer count: 4
has body: I'm trying to get values from a PHP array in Javascript and populate a chart. The problem is I believe that the javascript variable is not receiving the values. I tried printing out the values, but nothing happens. Also it shows as object instead of an array, i don't know if it's suppose to be like that. Any help will be greatful. The PHP array when printed out: print_r("&lt;pre&gt;"); print_r($exam_grades); print_r("&lt;/pre&gt;"); Array ( [History] =&gt; 70 [Sociology] =&gt; 40 [Psychology] =&gt; 32 [Criminology] =&gt; 64 ) JS: var exam_grades = &lt;?php echo json_encode($exam_grades );?&gt;; alert(exam_grades.length); // this shows as undefined for (var i = 0; i &lt; exam_grades.length; i++) { // do something }
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27934222
upvote count: 2
has answer: http://stackoverflow.com/a/27934222
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/44266347
accepted answer: http://stackoverflow.com/a/27934240
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/a/27852768
answers question: http://stackoverflow.com/q/27852747
score: 1
upvote count: 1
downvote count: 0
has body: Try Math.floor( 4.716981132075472);. This rounds the number down to the nearest integer, thus solving your problem.
type: Answer

http://stackoverflow.com/a/27953274
downvote count: 0
has body: No. Even if it was that script will do other request to Facebooks servers to get information. If Facebook is blocked it will not work
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27953252
accepted answer of: http://stackoverflow.com/q/27953252
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/44060270
type: Comment
has text: You unclosed ` ` tags are kind of confusing.
score: 1
comment on: http://stackoverflow.com/q/27827175
type: QuestionComment

http://stackoverflow.com/a/27934367
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44279635
type: Answer
has comment: http://stackoverflow.com/comment/44276650
accepted answer of: http://stackoverflow.com/q/27910948
has comment: http://stackoverflow.com/comment/44276483
answers question: http://stackoverflow.com/q/27910948
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44276372
has body: You were merely forgetting to access the object properties in your computed. In your select, the entire object is inserted into the value bound observable. Therefore, you need to access self.setNumValue().NumValue. I made a working fiddle: http://jsfiddle.net/yku33mtq/9/ HTML: JS: function thisViewModel() { var self = this; self.addToThisSet = [{ numType: "item 1", NumValue: 300 }, { numType: "item 2", NumValue: 1234 }, { numType: "item 3", NumValue: 78 }]; self.setNumValue = ko.observable(); self.htmlSelectSet = [{ theText: "alpha", theValue: 35450 }, { theText: "bravo", theValue: 2450 }]; self.displayTheValue = ko.observable(); self.sumOfValue = ko.computed(function () { var numValue = self.setNumValue(); var display = self.displayTheValue(); if (numValue && display) { return numValue.NumValue + display.theValue; } }); self.charSymbol = ko.computed(function () { if (self.displayTheValue()) { if (self.displayTheValue().theText == "alpha") { return "A"; } if (self.displayTheValue().theText == "bravo") { return "B"; } } return null; }); } ko.applyBindings(new thisViewModel());

http://stackoverflow.com/comment/44283174
type: AnswerComment
type: Comment
has text: I'm looking into storing the value - manipulate it - and style.transform it back to element
comment on: http://stackoverflow.com/a/27940595
score: 0

http://stackoverflow.com/comment/109049845
comment on: http://stackoverflow.com/a/27826058
type: AnswerComment
score: 0
type: Comment
has text: JavaScript's purpose is to manipulate DOM elements. CSS is for styling the DOM elements. You absolutely should not require any JavaScript to do what you're asking for.

http://stackoverflow.com/q/27919051
has title: Hybrid PC/Tablet website
type: Question
has answer: http://stackoverflow.com/a/27919649
tagged with: javascript
score: 0
answer count: 1
has body: What is the reliable approach to develop a website that is used on the computer that is a hybrid, in other words have both a mouse (or a touch pad) and a touch screen and can be used by a user in both ways at the same time. Especially the question is how to deal with the mouse cursor, that must be seen when using a mouse and is distracting once the user uses her finger. The goal is to develop a single page, not two separate pages, one for mouse and other for the touch. Style cursor = 'none' is killing the cursor over the specified elements completely, this is not desired. I am not talking about scrolling or zooming, but about clickable/touchable divs/spans/images, that can react some how. For instance I have a table where each cell could be clicked to mark (change color). Same with buttons, once you touch the button with the finger, the mouse cursor will stay on top of it and distract.
accepted answer: http://stackoverflow.com/a/27919649
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/27910580
has answer: http://stackoverflow.com/a/27911254
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27911254
tagged with: jqgrid
tagged with: javascript
has body: I have the jquery grid columns like below. colNames: ['Site_Name', 'Details'], colModel: [{ name: 'Site_Name', index: 'Site_Name', width: 130,editable: false, sortable: false,formatter: 'showlink', formatoptions: { baseLinkUrl: 'javascript:', showAction: "Link('", addParam: "');"} }, { name: 'Details', index: 'Details', width: 400, editable: false, sortable: false }], Hyperlink is formed for a column. once the user clicks on that hyperlink based values in another column (let's say status of that record/row). I need to display a popup message before navigating to the actual page. How can I write a click event on a custom formatted hyperlink?
downvote count: 0
answer count: 1
has title: Hyperlink popup message based on column value
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/44201017
type: QuestionComment
comment on: http://stackoverflow.com/q/27898856
score: 0
has text: This is just a guess (because I don't know r.js at all), but shouldn't the regex match those files that you want to __exclude__?
type: Comment

http://stackoverflow.com/comment/44167447
type: Comment
comment on: http://stackoverflow.com/q/27870062
type: QuestionComment
has text: Ok, so this presumably means that min_timestamp is never getting updated, right? So my next question is: if Instagram is sending back 20 photos, why do you augment the min_timestamp using the FIRST photo? (minTimestamp = images[0].created_time;) If they are in time order, shouldn't you be using minTimestamp = images[(numImages - 1)].created_time; ? Or are they in reverse time order?
score: 0

http://stackoverflow.com/comment/44144008
comment on: http://stackoverflow.com/q/27870794
type: Comment
type: QuestionComment
has text: lol, was actually in there editing it when you commented. I just mistyped it on entering it here. it now looks exactly as it does in myscript, but is not firing.
score: 0

http://stackoverflow.com/q/27949539
tagged with: carousel
has answer: http://stackoverflow.com/a/27949575
type: UnansweredQuestion
type: Question
tagged with: background
tagged with: image
has body: This is what I currently have, and the three background images for div#hero change upon refresh. Is there any easy way to adjust this so that they fade to an alternate image after x number of seconds, instead of upon refresh?
has title: Alternating background images of a div automatically?
answer count: 1
tagged with: javascript
score: 0
tagged with: intervals

http://stackoverflow.com/comment/44275190
type: Comment
has text: sorry i am not familiar with javascript so tell me what i have to do
type: AnswerComment
comment on: http://stackoverflow.com/a/27937072
score: 0

http://stackoverflow.com/q/27956503
has title: I need help "debugging" an If/Else if/Else statement's syntax
type: Question
has answer: http://stackoverflow.com/a/27956533
tagged with: var
has answer: http://stackoverflow.com/a/27956543
downvote count: 3
has comment: http://stackoverflow.com/comment/44307669
has comment: http://stackoverflow.com/comment/44307746
has answer: http://stackoverflow.com/a/27956536
tagged with: if-statement
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44307792
score: -3
tagged with: multiple-choice
tagged with: syntax-error
answer count: 4
upvote count: 0
has answer: http://stackoverflow.com/a/27956555
has body: I am creating a game of Rock, Paper, scissors on "Codecademy" so I am using simple JavaScript for this. There are four necessities for this simple code If computerChoice is between 0 and 0.33, make computerChoice equal to "rock". If computerChoice is between 0.34 and 0.66, make computerChoice equal to "paper". If computerChoice is between 0.67 and 1, make computerChoice equal to "scissors". Needs to be an If/Else If/Else statement So basically, I need to change the value of the function "computerChoice" based on the value of the function "computerChoice". var userChoice = prompt("Do you choose rock, paper or scissors?"); var computerChoice = Math.random(); { console.log(computerChoice); } if (computerChoice &gt;= 0 &amp; &lt;= 0.33) { computerChoice = rock; } else if (computerChoice &gt;= 0.34 &amp; &lt; 0.66) { computerChoice = paper; } else { computerChoice = scissors; }
favorite count: 0

http://stackoverflow.com/q/27833553
has comment: http://stackoverflow.com/comment/44072879
score: 0
type: Question
linked to: http://stackoverflow.com/q/27831945
has body: How do I return "stories" by issuing "vm.stories = storyDataAsFactory.stories" vs. what I do now, which is "vm.stories = storyDataAsFactory.stories()" ? I've tried every combination possible without success. Furthemore, I'm able to call storyDataAsFactory.getStories without the parenthesis, which makes sense based on how I have it configured, but when I create a function that returns self.stories it doesn't work. The below code works as specified - storyDataAsFactory.$inject = ['$http', '$q']; angular.module('ccsApp').factory('storyDataAsFactory', storyDataAsFactory); function storyDataAsFactory($http, $q) { var self = this; var stories = []; function getStories(url) { url = url || ''; var deferred = $q.defer(); $http({method: 'GET', url: url}) .success(function (data, status, headers, config) { self.stories = data; deferred.resolve(data); }) .error(function (data, status, headers, config) { deferred.reject(status); }); return deferred.promise; } function listStories() { return self.stories; } return { stories: listStories, getStories: getStories('stories.json') }; } UPDATE: I'm still having problems. Here's my exact code, which I changed per the community - storyDataAsFactory.$inject = ['$http', '$q']; angular.module('ccsApp').factory('storyDataAsFactory', storyDataAsFactory); function storyDataAsFactory($http, $q) { var stories = []; function getStories(url) { url = url || ''; if (url !== '') { var deferred = $q.defer(); //determine if ajax call already occurred; //if so, data exists in cache as local var if (stories.length !== 0) { deferred.resolve(); return deferred.promise; } $http({method:'GET', url:url}) .success(function (data, status, headers, config) { stories = data; deferred.resolve(); }) .error(function (data, status, headers, config) { deferred.reject(status); }); return deferred.promise; } else { alert('URL was empty.'); } } return { stories: stories, getStories: function(url) { getStories(url); } }; } storyDataAsFactory.stories does not return anythi…
tagged with: javascript
has title: How do I avoid a function expression when trying to return a local variable within an AngularJS factory?
has comment: http://stackoverflow.com/comment/44073758
answer count: 2
has comment: http://stackoverflow.com/comment/44072659
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44073710
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27834159
has comment: http://stackoverflow.com/comment/44073457
has answer: http://stackoverflow.com/a/27834866

http://stackoverflow.com/comment/44120723
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27858629
has text: That is because the when you click on the back button, then browser render the DOM from its history. Try with History API to detect State of browser https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
score: 0

http://stackoverflow.com/a/41400730
upvote count: 4
downvote count: 0
has body: I found that the problem was caused by the webView:didFinishNavigation: being called before the page content was actually loaded. I think the website is using angularjs. I introduced a manual delay which seemed to d the trick for me : func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { print("loaded)") //abtn_run(UIButton()) self.perform(#selector(performAction), with: nil, afterDelay: 3.0) } and did my call here: func performAction() { //This function will perform this after delay of 3 seconds } Ideally the best solution would have a listener push an event for angularjs "page ready" but I am not sure this is possible in wkwebview.
answers question: http://stackoverflow.com/q/27849465
score: 4
type: Answer

http://stackoverflow.com/comment/44164371
type: Comment
type: QuestionComment
has text: What about it fails? Whats the relevance of the code posted?
score: 0
comment on: http://stackoverflow.com/q/27881314

http://stackoverflow.com/a/27805835
type: Answer
answers question: http://stackoverflow.com/q/27805769
has comment: http://stackoverflow.com/comment/44021779
has comment: http://stackoverflow.com/comment/44021532
has body: Use a child form to separate the scope. Code must be less than End Code.
accepted answer of: http://stackoverflow.com/q/27805769
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4

http://stackoverflow.com/q/27918874
has answer: http://stackoverflow.com/a/27930077
type: AnsweredQuestion
has title: isotope metafizzy and packery version?
accepted answer: http://stackoverflow.com/a/27930077
type: Question
tagged with: packery
tagged with: javascript
tagged with: jquery-isotope
has body: i have a problem with the version from isotope metafizzy packery: here is the js-version v1.1.0 = http://isotope.metafizzy.co/layout-modes/packery.html and here is the js-version v1.3.2 = http://packery.metafizzy.co/ but my code works only with this v1.1.0 code: jQuery(document).ready(function () { // isotope in bootstrap tabs $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { $container = jQuery('#teaserIsotope'); // Fire Isotope only when images are loaded $container.imagesLoaded(function(){ // init Isotope $container.fadeIn(600).isotope({ //resizable: true, itemSelector: '.item', layoutMode: 'packery', packery: { columnWidth: '.grid-sizer', gutter: '.gutter-sizer' } }); }); }); // isotope in content $container = jQuery('#teaserIsotope'); // Fire Isotope only when images are loaded $container.imagesLoaded(function(){ // init Isotope $container.fadeIn(600).isotope({ //resizable: true, itemSelector: '.item', layoutMode: 'packery', packery: { columnWidth: '.grid-sizer', gutter: '.gutter-sizer' } }); }); }); how can i update the js code ? thanks
score: 0
answer count: 1

http://stackoverflow.com/q/27821010
has answer: http://stackoverflow.com/a/27821353
accepted answer: http://stackoverflow.com/a/27821353
has answer: http://stackoverflow.com/a/27821326
upvote count: 1
favorite count: 0
has body: In my rails application I have a simple datetimepicker for selecting start and the end dates with respective input labels (Please find the attached screenshot initial.png). Upon clicking the input fields the calendar pop up comes out along with a slider which allows me to set the time (which is initially set to 10, which is the minimum value). But I need to set the default value of the end date to the maximum value (which is 19 in my case) as soon as I click on it. (Please find the attached screenshot expected.png) Here is my code, in the Rails app default.js file $(".leave-date").datetimepicker({ showMinute:false, hourMin: 10, hourMax: 19, }); Can anybody please help me to achieve this
tagged with: ruby-on-rails
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27821326
downvote count: 0
score: 1
type: Question
answer count: 2
has title: Setting the default value of the slider for datetimepicker
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44307551
type: Comment
comment on: http://stackoverflow.com/q/27956099
has text: Agree. I think I'll close it soon.
score: 0
type: QuestionComment

http://stackoverflow.com/a/27909850
has comment: http://stackoverflow.com/comment/44221033
has comment: http://stackoverflow.com/comment/44226970
accepted answer of: http://stackoverflow.com/q/27909707
has body: Before logging a player's score, be sure to update it function rollDice(player) { var score = 0; var roll1; var roll2; var playerScore = player.getScore(); do { roll1 = rollSingleDice(); roll2 = rollSingleDice(); } while (roll1 === roll2); score = roll1 + roll2; player.addToScore(score); //Add this line in playerScore = player.getScore(); if (roll1 === roll2) { console.log(player.name + "'s current score is: " + playerScore); } else { console.log(player.name + "'s current score is: " + playerScore); } // return score; } Happy coding! Leave a comment if you have any questions.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44220895
type: Answer
has comment: http://stackoverflow.com/comment/44219984
answers question: http://stackoverflow.com/q/27909707
upvote count: 1
has comment: http://stackoverflow.com/comment/44220022
score: 1

http://stackoverflow.com/comment/44167475
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27882782
has text: JavaScript closure inside loops – simple practical example: http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example
type: Comment

http://stackoverflow.com/comment/44119627
comment on: http://stackoverflow.com/a/27858254
type: Comment
has text: yes, inside if condition you may place your code u want to perform on click
score: 0
type: AnswerComment

http://stackoverflow.com/a/27950362
upvote count: 1
type: AcceptedAnswer
has body: You're using assignment operators = instead of equality comparison operators == or ===. This: if (transdec=3) {$(".atrans").html("NOT PUBLISHED");} else {$(".atransaction").html("PUBLISHED");} sets the value of "transdec" to 3, and then checks to see whether that value is "truthy". It's non-zero, so in effect that code is like transdec = 3; if (true) {$(".atrans").html("NOT PUBLISHED");} else {$(".atransaction").html("PUBLISHED");}
downvote count: 0
has comment: http://stackoverflow.com/comment/44295720
has comment: http://stackoverflow.com/comment/44295805
type: Answer
has comment: http://stackoverflow.com/comment/44295804
score: 1
has comment: http://stackoverflow.com/comment/44295763
has comment: http://stackoverflow.com/comment/44295779
accepted answer of: http://stackoverflow.com/q/27950354
answers question: http://stackoverflow.com/q/27950354

http://stackoverflow.com/comment/44209019
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27872835
has text: You can check the cookie path in the browser, for example in FireFox.
score: 0

http://stackoverflow.com/comment/44239827
has text: Post relevant code in question, thx!
comment on: http://stackoverflow.com/q/27921355
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28161795
has body: So after rewriting the jquery.media plugin due to its complex nature, Greg and I found the solution. Effectively, the extension type must be specified in the url. For example the url '/mypdfs/my.pdf' would work but the url 'mypdfs/123' will not because jquery.media cannot determine the file type. A way to get around this is to make an ajax HEAD request and get the content type and then pass the appropriate extension type as an option to the media call. $.ajax({ type: "HEAD", async: true, url: "http://myurl.com/file", success: function(message, text, response){ var contentType = response.getResponseHeader('Content-Type'); // Map content types to extension type $('.media').media({type: extensionType}); } }); Also, Malsup's library seems to be unmaintained. We did a rewrite of the library which can currently be found here. We will be adding mapping Content-Type to file extensions as time permits so that this can be more flexibly implemented. Feel free to make a pull request.
accepted answer of: http://stackoverflow.com/q/27845336
answers question: http://stackoverflow.com/q/27845336
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44028700
comment on: http://stackoverflow.com/q/27809287
type: Comment
has text: My model should look like the json atleast that's my goal, if json has label attribute model should, if not then the model shouldn't. But the way backbone behaves right now is that if there's a new attribute, it adds it and subsequent fetches will populate the attribute with the latest one that it got from the past, if it makes sense.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/117784031
has text: It the code inside the traverse uses async, how can you make the we_are_done_traversing wait until the async code finishes?
comment on: http://stackoverflow.com/a/27954743
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27898455
has title: Convert Ruby String gsub! to javascript string replace method
type: Question
has body: I have snip code in Ruby that used gsub! method as below # handle headings (H1-H6) text.gsub!(/(&lt;\/h[1-6]&gt;)/i, "\n\\1") # move closing tags to new lines text.gsub!(/[\s]*&lt;h([1-6]+)[^&gt;]*&gt;[\s]*(.*)[\s]*&lt;\/h[1-6]+&gt;/i) do |s| hlevel = $1.to_i htext = $2 htext.gsub!(/&lt;br[\s]*\/?&gt;/i, "\n") # handle &lt;br&gt;s htext.gsub!(/&lt;\/?[^&gt;]*&gt;/i, '') # strip tags hlength = 3 case hlevel when 1 # H1, equal below htext = "\n" + htext.upcase + "\n" + ('=' * hlength) when 2 # H1, dashes below htext = "\n" + htext.upcase + "\n" + ('-' * hlength) else # H3-H6, dashes below htext = "\n" + htext + "\n" + ('+' * hlength) end htext end Above snip will convert html string to plain text. this process for H(s) tag. I need to port the snip to javascript that will use replace method Someone can help me, thanks
has comment: http://stackoverflow.com/comment/44197994
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44206334
tagged with: ruby
type: UnansweredQuestion
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/27899241
has comment: http://stackoverflow.com/comment/44209161
has comment: http://stackoverflow.com/comment/44198156

http://stackoverflow.com/comment/113706745
comment on: http://stackoverflow.com/a/63007586
type: Comment
has text: The question was about merging, not cloning.
score: 1
type: AnswerComment

http://stackoverflow.com/q/27883740
type: Question
tagged with: object
answer count: 2
possible better answer: http://stackoverflow.com/a/27883865
has body: I'm going over some online tuts and the subject is to put elements that are in an object into an array only if a certain property of the obj is unique. for this example that property would be "phoneNumber" the function to do that uniquePush() should work because it was on the website for a correct solution. my problem is outputting the array. I guess I don't quite understand how the return true or return false stuff works in terms of outputing the result. I know true and false are Booleans . I believe i tried something like if(uniquePush(nameArr, person){ then out put the obj.name } but that didn't work here is the example from the tuts. var person = { name:'bob', phoneNumber:1234, name:'joe', phoneNumber:123, name:'jack', phoneNumber:456, name:'duped1', phoneNumber:2345, name:'duped2', phoneNumber:2345 } var nameArr =[]; function uniquePush(arr, obj) { if(! ('phoneNumber' in obj)) { return false; } var unique = true; arr.forEach(function(element) { if(element.phoneNumber === obj.phoneNumber) { unique = false; } }); if(unique) { arr.push(obj); return true; } return false; } I just want to have a pop up alert box that list the unique names like [bob, joe, jack] not duped1 or duped 2 I want to do that by doing something like this uniquePush(nameArr, person); alert(nameArr.name);
tagged with: arrays
has answer: http://stackoverflow.com/a/27883865
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27884015
score: 0
has answer: http://stackoverflow.com/a/27884015
type: AnsweredQuestion
has title: How to output an array of unique items?

http://stackoverflow.com/a/28614043
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: I finally came up with a working solution. Firstly, you have to call FB.ui after FB.init. But according to https://stackoverflow.com/a/3549043/745266 this won't solve the problem completely - FB.init is doing an asynchronous request to facebook, so calling FB.ui must be delayed until Facebook is fully setup. The following code should work: window.onload = function() { var e = document.getElementById('share_on_fb_link'); e.onclick = share_on_fb; function share_on_fb() { // Code from https://developers.facebook.com/docs/javascript/quickstart/v2.2 // Basic Setup window.fbAsyncInit = function() { FB.init({ appId : 'your-app-id', xfbml : true, version : 'v2.1' }); // Delay FB.ui code until Facebook is fully initialized FB.getLoginStatus(function(response){ // Using the SDK to trigger a Share dialog FB.ui({ method: 'share', href: 'https://developers.facebook.com/docs/' }, function(response){}); }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); return false; } }
answers question: http://stackoverflow.com/q/27888999

http://stackoverflow.com/comment/44288977
type: Comment
has text: It gives me an error saying that I have no locally stored library for the HTTP link...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27946989

http://stackoverflow.com/comment/44507710
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27948209
score: 0
has text: Right now, looks like fine, so works properly?

http://stackoverflow.com/comment/44207810
comment on: http://stackoverflow.com/q/27904102
type: Comment
type: QuestionComment
has text: what you do is pointless, however it will write the content to a file, it happens before user has any chance to edit, what you need to do is post request using ajax: http://stackoverflow.com/questions/9758738/save-content-of-a-div-to-new-file-with-jquery-ajax-and-php
score: 0

http://stackoverflow.com/q/27871955
tagged with: javascript
has title: Undefined is not a function on a valid function
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27871973
downvote count: 0
tagged with: web-scraping
has comment: http://stackoverflow.com/comment/44146357
type: AnsweredQuestion
score: 1
has body: I'm writing a scraper, as a test I went to on IMDB and tried to get out some actor names from a list here is a link to the page. I'm trying to grab out the name out from the html when I call this function in the console $('.list_item').find('.info a:eq(0)').each(function (){ console.log(this)}) The console will log everything in the tag, however when I try to grab out the html I get an error undefined is not a function. $('.list_item').find('.info a:eq(0)').each(function (){ console.log(this.html())}) However if I give their tag an id I can grab it out with $('#testname').html(); This grabs out the correct name
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27871977
accepted answer: http://stackoverflow.com/a/27871977
upvote count: 1
possible better answer: http://stackoverflow.com/a/27871973

http://stackoverflow.com/comment/44192285
has text: The way I have the page set up is in four adjacent squares. The tablenav element is located in one of those squares, and I'm trying to add the navigation elements to the table1 element.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27895407
score: 0

http://stackoverflow.com/q/27896708
type: Question
has comment: http://stackoverflow.com/comment/44212672
tagged with: javascript
has title: Submitted form is not getting re-enabled values from HTML text input when proccesed with Python script server side
downvote count: 0
score: 1
favorite count: 0
has body: I have a form that gives the user the chance to enter a project name and click a button that "sets" it. This then runs a JavaScript that disables the input box and button and enables a handful of other fields that need set for the project. When submit is clicked I run another JavaScript to re-enable the disabled project name HTML text input box. When the project is submitted, for some reason, the project name is not submitted while everything else in the form is. I have tried to use onSubmit= in the form header tag and also onClick on the submit button. I am processing server side using Python. Any ideas why I am not getting the projectName variable on form submit? Error I get from python script is: /var/www/ARCHlang/cgi-bin/pythonTest.cgi in () 32 myN = 0 33 myC = 0 34 projectPath = "../prPages/userFiles/" + projectName + "/" 35 mainTclPath = projectPath + "pr.tcl" 36 systemCheckpointToOpen = "" projectPath undefined, projectName = None <type 'exceptions.TypeError'>: cannot concatenate 'str' and 'NoneType' objects args = ("cannot concatenate 'str' and 'NoneType' objects",) message = "cannot concatenate 'str' and 'NoneType' objects" Code is Below: HTML: CSDL MPSoPC <!-- <![if !IE]> <![endif]> --> <![if !IE]> <![endif]> Home Build Your Own HEMPS System You can create your own system First set project name to enable other system options. Project Name: Board: VC707 System: 2 Node 3 Node 4 Node 5 Node 6 Node 7 Node 8 Node Select the accelerators for your project: Pre-Built Accelerators Added Pre-Built Accelerators CRC Vector Matrix Multiply Quick Sort --> >" onClick="SelectMoveRows(document.projectBuild.selectList,document.projectBuild.userSelections)" disabled="disabled"> <input type="button" name="remove" value="<< Remove" onClick="SelectMoveRows(document.projectBuild.userSelections,document.projectBuild.selectList)" disabled="disabled"> User Added Accelerators Enter Filename: Python: #!/usr/bin/python import cgi, os, sys, commands import zipfile import os.path # impo…
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44207017
tagged with: python
answer count: 0
tagged with: cgi
tagged with: forms
upvote count: 1

http://stackoverflow.com/q/27807279
has body: Below is the chart I am trying to create , I took it straight from the examples and replaced the x-axis data and added in my own series data. In the console it prints out both of the arrays I used like this: Reports:28,16,1,4,6,4,5,31,59,43,31,56,4 HOURSSS:0,1,2,4,6,7,9,11,12,13,14,15,16 and for some reason the chart just ends up looking like the pic below. I have been stumped on this for hours. Any idea whats going on? var activityTotalDayByHour = <?php echo json_encode($activityTotalDayByHour); ?>; console.log("ACTIVITY:"+activityTotalDayByHour); var Reports = []; var Hours =[] for (var i = 0; i < activityTotalDayByHour.length; i++) { Reports.push(activityTotalDayByHour[i]['Records']); Hours.push(activityTotalDayByHour[i]['Hour']); } $(function () { $('#highChartDiv').highcharts({ chart: { type: 'area' }, title: { text: 'US and USSR nuclear stockpiles' }, subtitle: { text: 'Source: ' + 'thebulletin.metapress.com' }, xAxis: { categories: Hours }, tooltip: { pointFormat: '{series.name} produced {point.y:,.0f} warheads in {point.x}' }, series: [{ name: 'USA', data:Reports }] }); }); EDIT: Thanks to @Jeromy French I have discovered it has to be something funky going on w. my data source. When I plug in the exact same data into static arrays it works just fine, but when I use the arrays created via my loops it does not work. Even more weird is that if I create 2 versions of my data ( one formed through looping through the dynamic data and one formed by plugging in the exact same static data into arrays it console.log's out identical like this : ---Looped Versions---- Reports:28,16,1,4,6,4,5,31,59,43,31,56,10 HOURSSS:0,1,2,4,6,7,9,11,12,13,14,15,16 --Static Versions--- REPORTS_B:28,16,1,4,6,4,5,31,59,43,31,56,4 HOURS_B:0,1,2,4,6,7,9,11,12,13,14,15,16 var activityTotalDayByHour = <?php echo json_encode($activityTotalDayByHour); ?>; console.log("ACTIVITY:"+activityTotalDayByHour); var Reports = []; var Hours =[] for (var i = 0; i < activityTotalDayByHour.length; i++) { Re…
has comment: http://stackoverflow.com/comment/44024089
has comment: http://stackoverflow.com/comment/44024690
score: 2
has comment: http://stackoverflow.com/comment/44024272
has comment: http://stackoverflow.com/comment/44024503
upvote count: 2
has comment: http://stackoverflow.com/comment/44023931
has comment: http://stackoverflow.com/comment/44023637
type: AnsweredQuestion
has title: HighChart Renders Blank with Small Data Set
has comment: http://stackoverflow.com/comment/44023594
has comment: http://stackoverflow.com/comment/44023837
type: Question
tagged with: highcharts
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44024399
has answer: http://stackoverflow.com/a/27807653
has comment: http://stackoverflow.com/comment/44023762
accepted answer: http://stackoverflow.com/a/27807653
has comment: http://stackoverflow.com/comment/44023679

http://stackoverflow.com/a/27936048
upvote count: 1
has comment: http://stackoverflow.com/comment/44269068
downvote count: 0
answers question: http://stackoverflow.com/q/27935938
type: Answer
has body: You can create 1 blank &lt;div class="curve"&gt;&lt;/div&gt; and display only left border of that div as below: .curve{ border-left:2px solid #000; height:200px; width:100px; border-radius:50px; /*see how much you want to curve*/ } OR else create 1 curve image and apply to that background div and with help of position float your dot div on it and with hover effect show your text. check here http://jsfiddle.net/Lz97rgyf/2/
score: 1

http://stackoverflow.com/a/77635401
answers question: http://stackoverflow.com/q/27897112
score: 0
type: Answer
has body: The previous answers were missing some important details. I've demonstrated how to fetch various headers in the data hook. The email body can have multiple children. Each hook needs to call the callback (next) to proceed with the next stage in the pipeline of processing the email. exports.hook_data = function (next, connection) { // enable mail body parsing - should be enabled in hook_data connection.transaction.parse_body = true; // get a decoded copy of a header, e.g. From const from_header = connection.transaction.header.get_decoded('From'); connection.loginfo(this, `From: ${from_header}`); // get a header that doesn't need to be decoded: const msg_id = connection.transaction.header.get('Message-ID'); // get multiple headers, e.g. Received: const received = connection.transaction.header.get_all('received'); next(); } exports.hook_data_post = function (next, connection) { // confirm body has text if(connection.transaction.body.bodytext) { this.examine_body(connection.transaction.body.bodytext); } next(); } exports.examine_body = function (body) { if (!body.bodytext) return; this.loginfo(body.bodytext); // recursively get all of the children if (body.children?.length) { for (const child of body.children) { this.examine_body(child); } } }

http://stackoverflow.com/comment/44323262
comment on: http://stackoverflow.com/a/27963704
type: AnswerComment
score: 0
has text: *"What you are doing is declaring a function called c"*. The first sentence is completely wrong. You just misread the code.
type: Comment

http://stackoverflow.com/a/27850613
type: Answer
has body: If I get what you're trying to do you can pass the opened submenu as a # param in your url so when they do click a link to the new page you can have Javascript/jQuery read the # and open the proper submenu. Something like this.. Applications And then with Javascript & jQuery we can read it with.. $(document).ready(function() { hash = window.location.hash; $(hash).collapse('show'); }); We can use $(hash).collapse('show'); to show the content because you're using Bootstrap. But this goes under the impression I understand what you're trying to say. :)
score: 0
answers question: http://stackoverflow.com/q/27826598

http://stackoverflow.com/comment/44217726
type: QuestionComment
comment on: http://stackoverflow.com/q/27909173
has text: Is your model `subStatuses` bound asyncronously?
score: 0
type: Comment

http://stackoverflow.com/q/27826083
has comment: http://stackoverflow.com/comment/44057975
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44058283
score: 3
has answer: http://stackoverflow.com/a/27897132
answer count: 2
has answer: http://stackoverflow.com/a/29919993
tagged with: javascript
favorite count: 0
upvote count: 3
has title: Authorization and authentication in Strongloop
tagged with: loopbackjs
tagged with: node.js
tagged with: strongloop
has body: I am using Strongloop. Strongloop gives built in User model. I want to extend the User model to be saved in Mongodb Also I want to make authenticated requests once a user in logged. By authenticated requests I mean, when a user logs in an access token is generated and that access token is required in processing further APIs for different models. The tutorials does not seem to help much.
downvote count: 0

http://stackoverflow.com/a/27809080
has comment: http://stackoverflow.com/comment/44027158
score: 0
has comment: http://stackoverflow.com/comment/44027188
type: Answer
has body: Using bind is the correct approach, but you should also make sure that you aren't polluting your current scope (especially if it's the global one) with an unecessary oldfoocreate variable. Here's how you should probably do it: foo.create = (function (oldfoocreate) { return function (t,e) { alert(JSON.stringify(t) + " ? " + JSON.stringify(e)); oldfoocreate(t, e); }; })(foo.create.bind(foo)); Now oldfoocreate is only reachable where needed and no one could ever call the old one without going through the new one. Note that you can also do it without bind: foo.create = (function (oldfoocreate) { return function (t,e) { alert(JSON.stringify(t) + " ? " + JSON.stringify(e)); oldfoocreate.call(this, t, e); }; })(foo.create);
answers question: http://stackoverflow.com/q/27808762

http://stackoverflow.com/comment/44113521
type: Comment
has text: You are doing wrong. I absolutely sure, that my way will correctly prevent form submit. Your `valid()` is broken.
comment on: http://stackoverflow.com/a/27855002
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44055857
type: QuestionComment
comment on: http://stackoverflow.com/q/27824908
score: 0
has text: wrap the script in a named function instead of the document ready function, then call that function with the onclick event of the button
type: Comment

http://stackoverflow.com/comment/44194099
has text: Sorry i can't help you with more :) - just trying to point out some problems. I wouldn't go for the trouble of making a function which will make it slide when you scroll, i don't think it's userfriendly in anyway because it changes the original function of the scroll.
type: AnswerComment
comment on: http://stackoverflow.com/a/27877465
type: Comment
score: 0

http://stackoverflow.com/comment/44273941
type: Comment
has text: Also, == is a char less and signals that we already know about type equality, which is important information.
comment on: http://stackoverflow.com/a/27938574
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44230324
comment on: http://stackoverflow.com/q/27905376
score: 0
type: Comment
type: QuestionComment
has text: Actually, there is one aspect where I didn't touch on since I don't have much knowledge about - that is how the source file in some non-Unicode encoding is read and written. If the text is not stored according to writing order (by a text editor with some crazy implementation, for example), it may cause discrepancies when the browser reads and interprets the source code.

http://stackoverflow.com/comment/44141668
score: 0
type: Comment
type: QuestionComment
has text: maybe its possible ... let me think of a solution.
comment on: http://stackoverflow.com/q/27868990

http://stackoverflow.com/comment/44164466
comment on: http://stackoverflow.com/q/27881071
has text: mmm It perfectly works with IE8 and IE11 ... but not with Chrome :'(
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27886191
answer count: 1
tagged with: gruntjs
has answer: http://stackoverflow.com/a/27906937
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: grunt-contrib-jasmine ReferenceError: Can't find variable: jQuery
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/27906937
score: 1
tagged with: grunt-contrib-jasmine
has body: Here is my Gruntfile jasmine config task. I've added jquery and jasmine-jquery via vendor options. jasmine: { src: { src: '&lt;%= paths.dist %&gt;/**/*.js', options: { specs: '&lt;%= paths.tests %&gt;/specs/*Spec.js', helpers: '&lt;%= paths.tests %&gt;/helpers/*Helper.js', outfile: '&lt;%= paths.tests %&gt;/_SpecRunner.html' }, vendor: [ "&lt;%= paths.bower %&gt;/jquery/dist/jquery.js", "&lt;%= paths.bower %&gt;/jasmine-jquery/lib/jasmine-jquery.js" ] } }, After running grunt gets errors. Looks like grunt-jasmine don't including vendors setted in task. Running "jasmine:src" (jasmine) task Testing jasmine specs via PhantomJS &gt;&gt; ReferenceError: Can't find variable: jQuery at &gt;&gt; dist/script.js:97 Core X should return element ReferenceError: Can't find variable: $ in file:///Users/jedrzejchalubek/Dropbox/Script/tests/specs/CoreSpec.js (line 6) (1) ReferenceError: Can't find variable: $ in file:///Users/jedrzejchalubek/Dropbox/Script/tests/specs/CoreSpec.js (line 10) (2)
upvote count: 1

http://stackoverflow.com/comment/44296222
score: 0
type: Comment
has text: @indubitablee The question is not clear enough to indicate that spaces should be skipped, a space is a character too
type: AnswerComment
comment on: http://stackoverflow.com/a/27950568

http://stackoverflow.com/q/27941779
type: Question
has answer: http://stackoverflow.com/a/28355921
linked to: http://stackoverflow.com/q/14666931
accepted answer: http://stackoverflow.com/a/28470478
tagged with: css
has answer: http://stackoverflow.com/a/28467983
has comment: http://stackoverflow.com/comment/45251894
has answer: http://stackoverflow.com/a/28374531
has comment: http://stackoverflow.com/comment/45168422
possible better answer: http://stackoverflow.com/a/28355921
has comment: http://stackoverflow.com/comment/45261911
tagged with: overflow
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/45103054
has answer: http://stackoverflow.com/a/28389099
has title: Detect overflow fails in Firefox using (this.clientWidth < this.scrollWidth)
has comment: http://stackoverflow.com/comment/45179286
has comment: http://stackoverflow.com/comment/45054533
tagged with: javascript
answer count: 5
has answer: http://stackoverflow.com/a/28470478
has body: We're trying to detect if an element is overflowing using this simple Javascript code: this.clientWidth &lt; this.scrollWidth This works perfectly on Chrome/IE but on Firefox it fails in until there's too much overflowing. The example can be seen here: http://colnect.com/en/coins/countries#-1;yemen This page show a list of countries. We do vertical centering of the text if it fits in a single line. If it's too long for one line (which is why we want to detect the overflow), we change it so the text appears in two lines. In this attachment you can see what happens on Firefox (depending on the width of your window). When the overflow isn't "big enough", it's not detected even though CSS has clearly added the ellipsis for it so it IS overflowing. First 4 "countries" shown are correct (the 4th even broke into two lines) but the others are not. To recreate, simply start resizing your Firefox window slowly until you see where this breaks. Any ideas? A different way to detect overflow?
type: AnsweredQuestion
tagged with: firefox
score: 1
favorite count: 0

scope
tags question: http://stackoverflow.com/q/27810717
tags question: http://stackoverflow.com/q/27913355
tags question: http://stackoverflow.com/q/27935130
tags question: http://stackoverflow.com/q/27905088
tag name: scope
tags question: http://stackoverflow.com/q/27874828
tags question: http://stackoverflow.com/q/27865013
tags question: http://stackoverflow.com/q/27818620
tags question: http://stackoverflow.com/q/27916946
type: Tag
tags question: http://stackoverflow.com/q/27880545
tags question: http://stackoverflow.com/q/27897227
tags question: http://stackoverflow.com/q/27893143
tags question: http://stackoverflow.com/q/27928916
tags question: http://stackoverflow.com/q/27869118
tags question: http://stackoverflow.com/q/27955691
tags question: http://stackoverflow.com/q/27834008
tags question: http://stackoverflow.com/q/27923582
tags question: http://stackoverflow.com/q/27881291
tags question: http://stackoverflow.com/q/27890664

http://stackoverflow.com/comment/44159307
has text: Adding window.onload made it work. After quick googling, jquery's .ready is executed as soon as the html ends parsing while window.onload is executed after all content has been loaded. So with window.onload I can keep defer on the other scripts. Thanks.
comment on: http://stackoverflow.com/a/27878687
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44073187
has text: Well you learn something new each day :). That's a lot simpler.
type: Comment
comment on: http://stackoverflow.com/a/27833907
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44094077
type: Comment
comment on: http://stackoverflow.com/a/27844810
score: 0
type: AnswerComment
has text: looks like you are right. I updated your fiddle to make the loop take more time: http://jsfiddle.net/yVbYQ/6683/

http://stackoverflow.com/a/48277995
has body: Increase delay(). &lt;script&gt; $(window).on('load', function () { var $preloader = $('#page-preloader'), $spinner = $preloader.find('.spinner'); $spinner.fadeOut(); $preloader.delay(3000).fadeOut('slow'); });
answers question: http://stackoverflow.com/q/27929790
score: 0
type: Answer

jaydata
tag name: jaydata
type: Tag
tags question: http://stackoverflow.com/q/27829194

http://stackoverflow.com/comment/44292818
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27948622
has text: Yeah, I know, but I want to use CSS for transition and controllability with SASS. JS only for calculating height of blocks.